]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/kw/uncached.h
Import sources from 2011-03-30 iso image
[plan9front.git] / sys / src / 9 / kw / uncached.h
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 *
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 *
33 myucalloc(uint n)
34 {
35         return ucallocz(n, 1);
36 }