1
0

segflush 944 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. .TH SEGFLUSH 2
  2. .SH NAME
  3. segflush \- flush instruction and data caches
  4. .SH SYNOPSIS
  5. .B #include <u.h>
  6. .br
  7. .B #include <libc.h>
  8. .PP
  9. .B
  10. int segflush(void *va, ulong len)
  11. .PP
  12. .SH DESCRIPTION
  13. .I Segflush
  14. invalidates any instruction cache and writes back any data
  15. cache associated with pages contained in a segment.
  16. All subsequent new pages in the segment will also be flushed when first referenced.
  17. .PP
  18. .I Va
  19. is an address within the segment to be flushed;
  20. it is rounded down to the nearest page boundary.
  21. .I Len
  22. specifies the length in bytes of
  23. the memory to flush;
  24. .IB va + len
  25. is rounded up to the nearest page boundary.
  26. .I Segflush
  27. works correctly when the memory straddles multiple segments.
  28. .PP
  29. Correct use of
  30. .I segflush
  31. depends on an understanding of the cache architecture of the specific
  32. machine.
  33. .SH SOURCE
  34. .B /sys/src/libc/9syscall
  35. .SH SEE ALSO
  36. .IR segattach (2),
  37. .IR segbrk (2)
  38. .br
  39. .BR /proc/*/segment
  40. .SH DIAGNOSTICS
  41. Sets
  42. .IR errstr .