uncached.h 734 B

123456789101112131415161718192021222324252627282930313233343536
  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. #define allocb ucallocb
  16. #define iallocb uciallocb
  17. #define freeb ucfreeb
  18. static void *
  19. ucallocz(uint n, int)
  20. {
  21. char *p = ucalloc(n);
  22. if (p)
  23. memset(p, 0, n);
  24. else
  25. panic("ucalloc: out of memory");
  26. return p;
  27. }
  28. static void *
  29. myucalloc(uint n)
  30. {
  31. return ucallocz(n, 1);
  32. }