xref: /plan9/sys/src/9/omap/uncached.h (revision 436938c05685afd6a22a40ad955f1d0adb99ad97)
1 /*
2  * running the l2 cache as write-back and using cached memory for
3  * usb data structures yields spurious errors such as
4  *
5  *	qhintr: td 0x60ee3d80 csw 0x8824a error 0x48 transaction error
6  *
7  * from usbehci.  so, at least for now, we will use uncached memory until
8  * we sort out the write-back problems.
9  */
10 #define free			ucfree
11 #define malloc			myucalloc
12 #define mallocz			ucallocz
13 #define smalloc			myucalloc
14 #define xspanalloc		ucallocalign
15 
16 #define allocb			ucallocb
17 #define iallocb			uciallocb
18 #define freeb			ucfreeb
19 
20 static void *
ucallocz(uint n,int)21 ucallocz(uint n, int)
22 {
23 	char *p = ucalloc(n);
24 
25 	if (p)
26 		memset(p, 0, n);
27 	else
28 		panic("ucalloc: out of memory");
29 	return p;
30 }
31 
32 static void *
myucalloc(uint n)33 myucalloc(uint n)
34 {
35 	return ucallocz(n, 1);
36 }
37