Subversion Repositories HelenOS

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright (c) 2003-2007 Jakub Jermar
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  * - Redistributions of source code must retain the above copyright
  10.  *   notice, this list of conditions and the following disclaimer.
  11.  * - Redistributions in binary form must reproduce the above copyright
  12.  *   notice, this list of conditions and the following disclaimer in the
  13.  *   documentation and/or other materials provided with the distribution.
  14.  * - The name of the author may not be used to endorse or promote products
  15.  *   derived from this software without specific prior written permission.
  16.  *
  17.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  18.  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  19.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  20.  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  21.  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  22.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  23.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  24.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  26.  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27.  */
  28.  
  29. /** @addtogroup arm32mm
  30.  * @{
  31.  */
  32. /** @file
  33.  */
  34.  
  35. #ifndef KERN_arm32_PAGE_H_
  36. #define KERN_arm32_PAGE_H_
  37.  
  38. #include <arch/mm/frame.h>
  39.  
  40. #define PAGE_WIDTH  FRAME_WIDTH
  41. #define PAGE_SIZE   FRAME_SIZE
  42.  
  43. #define PAGE_COLOR_BITS 0           /* dummy */
  44.  
  45. #ifndef __ASM__
  46. #   define KA2PA(x) (((uintptr_t) (x)) - 0x80000000)
  47. #   define PA2KA(x) (((uintptr_t) (x)) + 0x80000000)
  48. #else
  49. #   define KA2PA(x) ((x) - 0x80000000)
  50. #   define PA2KA(x) ((x) + 0x80000000)
  51. #endif
  52.  
  53. #ifdef KERNEL
  54.  
  55. #define PTL0_ENTRIES_ARCH   0   /* TODO */
  56. #define PTL1_ENTRIES_ARCH   0   /* TODO */
  57. #define PTL2_ENTRIES_ARCH   0   /* TODO */
  58. #define PTL3_ENTRIES_ARCH   0   /* TODO */
  59.  
  60. #define PTL0_INDEX_ARCH(vaddr)  0   /* TODO */
  61. #define PTL1_INDEX_ARCH(vaddr)  0   /* TODO */
  62. #define PTL2_INDEX_ARCH(vaddr)  0   /* TODO */
  63. #define PTL3_INDEX_ARCH(vaddr)  0   /* TODO */
  64.  
  65. #define SET_PTL0_ADDRESS_ARCH(ptl0)
  66.  
  67. #define GET_PTL1_ADDRESS_ARCH(ptl0, i)      0   /* TODO */
  68. #define GET_PTL2_ADDRESS_ARCH(ptl1, i)      0   /* TODO */
  69. #define GET_PTL3_ADDRESS_ARCH(ptl2, i)      0   /* TODO */
  70. #define GET_FRAME_ADDRESS_ARCH(ptl3, i)     0   /* TODO */
  71.  
  72. #define SET_PTL1_ADDRESS_ARCH(ptl0, i, a)   /* TODO */
  73. #define SET_PTL2_ADDRESS_ARCH(ptl1, i, a)   /* TODO */
  74. #define SET_PTL3_ADDRESS_ARCH(ptl2, i, a)   /* TODO */
  75. #define SET_FRAME_ADDRESS_ARCH(ptl3, i, a)  /* TODO */
  76.  
  77. #define GET_PTL1_FLAGS_ARCH(ptl0, i)        0   /* TODO */
  78. #define GET_PTL2_FLAGS_ARCH(ptl1, i)        0   /* TODO */
  79. #define GET_PTL3_FLAGS_ARCH(ptl2, i)        0   /* TODO */
  80. #define GET_FRAME_FLAGS_ARCH(ptl3, i)       0   /* TODO */
  81.  
  82. #define SET_PTL1_FLAGS_ARCH(ptl0, i, x)     /* TODO */
  83. #define SET_PTL2_FLAGS_ARCH(ptl1, i, x)     /* TODO */
  84. #define SET_PTL3_FLAGS_ARCH(ptl2, i, x)     /* TODO */
  85. #define SET_FRAME_FLAGS_ARCH(ptl3, i, x)    /* TODO */
  86.  
  87. #define PTE_VALID_ARCH(pte)         0   /* TODO */
  88. #define PTE_PRESENT_ARCH(pte)           0   /* TODO */
  89. #define PTE_GET_FRAME_ARCH(pte)         0   /* TODO */
  90. #define PTE_WRITABLE_ARCH(pte)          0   /* TODO */
  91. #define PTE_EXECUTABLE_ARCH(pte)        0   /* TODO */
  92.  
  93. #ifndef __ASM__
  94.  
  95. #include <mm/mm.h>
  96. #include <arch/exception.h>
  97.  
  98. static inline int get_pt_flags(pte_t *pt, index_t i)
  99. {
  100.     return 0;   /* TODO */
  101. }
  102.  
  103. static inline void set_pt_flags(pte_t *pt, index_t i, int flags)
  104. {
  105.     /* TODO */
  106.     return;
  107. }
  108.  
  109. extern void page_arch_init(void);
  110.  
  111. #endif /* __ASM__ */
  112.  
  113. #endif /* KERNEL */
  114.  
  115. #endif
  116.  
  117. /** @}
  118.  */
  119.