paging.inc 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ; Copyright (C) 2021 Rain
  2. ; This file is part of Cunix.
  3. ; Cunix is free software: you can redistribute it and/or modify
  4. ; it under the terms of the GNU General Public Licene and published by
  5. ; the Free Software Foundation, either version 3 of the License, or
  6. ; (at your option) any later version.
  7. ; Cunix is distributed in the hope that it will be useful,
  8. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. ; GNU General Public License for more details.
  11. ; You should have recceived a copy of the GNU General Public License
  12. ; along with Cunix. If not, see <https://www.gnu.org/licenses/>.
  13. ; this page is already in memory (it's not swapped)
  14. PATT_PRESENT equ 0x00000001
  15. ; read + write
  16. PATT_RDWR equ 0x00000002
  17. ; user mode or kernel mode
  18. PATT_USER equ 0x00000004
  19. ; write cache + memory or cache only
  20. PATT_CACHEMEM equ 0x00000008
  21. ; this page cannot cache
  22. PATT_NCACHE equ 0x00000010
  23. ; this page has been accessed
  24. PATT_ACCESSED equ 0x00000020
  25. ; this page is dirty
  26. PATT_DIRTY equ 0x00000040
  27. ; this page is in PAT
  28. PATT_PAT equ 0x00000080
  29. ; this is a global page
  30. PATT_GLOBAL equ 0x00000100
  31. ; 0x83
  32. PAGE_KERNEL equ PATT_PRESENT | PATT_RDWR | PATT_PAT
  33. ; 0x07
  34. PAGE_USER equ PATT_RDWR | PATT_USER | PATT_PRESENT