Changeset 98000fb in mainline for kernel/arch
- Timestamp:
- 2009-06-03T19:34:45Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 301ff30
- Parents:
- 69e68e3
- Location:
- kernel/arch
- Files:
-
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/cpu.h
r69e68e3 r98000fb 65 65 tss_t *tss; 66 66 67 count_t iomapver_copy; /** Copy of TASK's I/O Permission bitmap generation count. */67 size_t iomapver_copy; /** Copy of TASK's I/O Permission bitmap generation count. */ 68 68 } cpu_arch_t; 69 69 -
kernel/arch/amd64/include/mm/page.h
r69e68e3 r98000fb 113 113 (write_cr3((uintptr_t) (ptl0))) 114 114 #define SET_PTL1_ADDRESS_ARCH(ptl0, i, a) \ 115 set_pt_addr((pte_t *) (ptl0), ( index_t) (i), a)115 set_pt_addr((pte_t *) (ptl0), (size_t) (i), a) 116 116 #define SET_PTL2_ADDRESS_ARCH(ptl1, i, a) \ 117 set_pt_addr((pte_t *) (ptl1), ( index_t) (i), a)117 set_pt_addr((pte_t *) (ptl1), (size_t) (i), a) 118 118 #define SET_PTL3_ADDRESS_ARCH(ptl2, i, a) \ 119 set_pt_addr((pte_t *) (ptl2), ( index_t) (i), a)119 set_pt_addr((pte_t *) (ptl2), (size_t) (i), a) 120 120 #define SET_FRAME_ADDRESS_ARCH(ptl3, i, a) \ 121 set_pt_addr((pte_t *) (ptl3), ( index_t) (i), a)121 set_pt_addr((pte_t *) (ptl3), (size_t) (i), a) 122 122 123 123 /* Get PTE flags accessors for each level. */ 124 124 #define GET_PTL1_FLAGS_ARCH(ptl0, i) \ 125 get_pt_flags((pte_t *) (ptl0), ( index_t) (i))125 get_pt_flags((pte_t *) (ptl0), (size_t) (i)) 126 126 #define GET_PTL2_FLAGS_ARCH(ptl1, i) \ 127 get_pt_flags((pte_t *) (ptl1), ( index_t) (i))127 get_pt_flags((pte_t *) (ptl1), (size_t) (i)) 128 128 #define GET_PTL3_FLAGS_ARCH(ptl2, i) \ 129 get_pt_flags((pte_t *) (ptl2), ( index_t) (i))129 get_pt_flags((pte_t *) (ptl2), (size_t) (i)) 130 130 #define GET_FRAME_FLAGS_ARCH(ptl3, i) \ 131 get_pt_flags((pte_t *) (ptl3), ( index_t) (i))131 get_pt_flags((pte_t *) (ptl3), (size_t) (i)) 132 132 133 133 /* Set PTE flags accessors for each level. */ 134 134 #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) \ 135 set_pt_flags((pte_t *) (ptl0), ( index_t) (i), (x))135 set_pt_flags((pte_t *) (ptl0), (size_t) (i), (x)) 136 136 #define SET_PTL2_FLAGS_ARCH(ptl1, i, x) \ 137 set_pt_flags((pte_t *) (ptl1), ( index_t) (i), (x))137 set_pt_flags((pte_t *) (ptl1), (size_t) (i), (x)) 138 138 #define SET_PTL3_FLAGS_ARCH(ptl2, i, x) \ 139 set_pt_flags((pte_t *) (ptl2), ( index_t) (i), (x))139 set_pt_flags((pte_t *) (ptl2), (size_t) (i), (x)) 140 140 #define SET_FRAME_FLAGS_ARCH(ptl3, i, x) \ 141 set_pt_flags((pte_t *) (ptl3), ( index_t) (i), (x))141 set_pt_flags((pte_t *) (ptl3), (size_t) (i), (x)) 142 142 143 143 /* Macros for querying the last-level PTE entries. */ … … 177 177 #define PFERR_CODE_ID (1 << 4) 178 178 179 static inline int get_pt_flags(pte_t *pt, index_t i)179 static inline int get_pt_flags(pte_t *pt, size_t i) 180 180 { 181 181 pte_t *p = &pt[i]; … … 190 190 } 191 191 192 static inline void set_pt_addr(pte_t *pt, index_t i, uintptr_t a)192 static inline void set_pt_addr(pte_t *pt, size_t i, uintptr_t a) 193 193 { 194 194 pte_t *p = &pt[i]; … … 198 198 } 199 199 200 static inline void set_pt_flags(pte_t *pt, index_t i, int flags)200 static inline void set_pt_flags(pte_t *pt, size_t i, int flags) 201 201 { 202 202 pte_t *p = &pt[i]; -
kernel/arch/amd64/include/proc/task.h
r69e68e3 r98000fb 41 41 typedef struct { 42 42 /** I/O Permission bitmap Generation counter. */ 43 count_t iomapver;43 size_t iomapver; 44 44 /** I/O Permission bitmap. */ 45 45 bitmap_t iomap; -
kernel/arch/amd64/include/types.h
r69e68e3 r98000fb 47 47 48 48 typedef uint64_t size_t; 49 typedef uint64_t count_t;50 typedef uint64_t index_t;51 49 52 50 typedef uint64_t uintptr_t; … … 61 59 } fncptr_t; 62 60 63 /**< Formats for uintptr_t, size_t , count_t and index_t*/61 /**< Formats for uintptr_t, size_t */ 64 62 #define PRIp "llx" 65 63 #define PRIs "llu" 66 #define PRIc "llu"67 #define PRIi "llu"68 64 69 65 /**< Formats for (u)int8_t, (u)int16_t, (u)int32_t, (u)int64_t and (u)native_t */ -
kernel/arch/amd64/src/ddi/ddi.c
r69e68e3 r98000fb 57 57 int ddi_iospace_enable_arch(task_t *task, uintptr_t ioaddr, size_t size) 58 58 { 59 count_t bits;59 size_t bits; 60 60 61 61 bits = ioaddr + size; … … 99 99 * Enable the range and we are done. 100 100 */ 101 bitmap_clear_range(&task->arch.iomap, ( index_t) ioaddr, (count_t) size);101 bitmap_clear_range(&task->arch.iomap, (size_t) ioaddr, (size_t) size); 102 102 103 103 /* … … 118 118 void io_perm_bitmap_install(void) 119 119 { 120 count_t bits;120 size_t bits; 121 121 ptr_16_64_t cpugdtr; 122 122 descriptor_t *gdt_p; 123 123 tss_descriptor_t *tss_desc; 124 count_t ver;124 size_t ver; 125 125 126 126 /* First, copy the I/O Permission Bitmap. */ -
kernel/arch/amd64/src/interrupt.c
r69e68e3 r98000fb 102 102 { 103 103 if (TASK) { 104 count_t ver;104 size_t ver; 105 105 106 106 spinlock_lock(&TASK->lock); -
kernel/arch/arm32/include/mm/page.h
r69e68e3 r98000fb 95 95 /* Get PTE flags accessors for each level. */ 96 96 #define GET_PTL1_FLAGS_ARCH(ptl0, i) \ 97 get_pt_level0_flags((pte_level0_t *) (ptl0), ( index_t) (i))97 get_pt_level0_flags((pte_level0_t *) (ptl0), (size_t) (i)) 98 98 #define GET_PTL2_FLAGS_ARCH(ptl1, i) \ 99 99 PAGE_PRESENT … … 101 101 PAGE_PRESENT 102 102 #define GET_FRAME_FLAGS_ARCH(ptl3, i) \ 103 get_pt_level1_flags((pte_level1_t *) (ptl3), ( index_t) (i))103 get_pt_level1_flags((pte_level1_t *) (ptl3), (size_t) (i)) 104 104 105 105 /* Set PTE flags accessors for each level. */ 106 106 #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) \ 107 set_pt_level0_flags((pte_level0_t *) (ptl0), ( index_t) (i), (x))107 set_pt_level0_flags((pte_level0_t *) (ptl0), (size_t) (i), (x)) 108 108 #define SET_PTL2_FLAGS_ARCH(ptl1, i, x) 109 109 #define SET_PTL3_FLAGS_ARCH(ptl2, i, x) 110 110 #define SET_FRAME_FLAGS_ARCH(ptl3, i, x) \ 111 set_pt_level1_flags((pte_level1_t *) (ptl3), ( index_t) (i), (x))111 set_pt_level1_flags((pte_level1_t *) (ptl3), (size_t) (i), (x)) 112 112 113 113 /* Macros for querying the last-level PTE entries. */ … … 205 205 * @param i Index of the entry to return. 206 206 */ 207 static inline int get_pt_level0_flags(pte_level0_t *pt, index_t i)207 static inline int get_pt_level0_flags(pte_level0_t *pt, size_t i) 208 208 { 209 209 pte_level0_t *p = &pt[i]; … … 220 220 * @param i Index of the entry to return. 221 221 */ 222 static inline int get_pt_level1_flags(pte_level1_t *pt, index_t i)222 static inline int get_pt_level1_flags(pte_level1_t *pt, size_t i) 223 223 { 224 224 pte_level1_t *p = &pt[i]; … … 245 245 * @param flags new flags 246 246 */ 247 static inline void set_pt_level0_flags(pte_level0_t *pt, index_t i, int flags)247 static inline void set_pt_level0_flags(pte_level0_t *pt, size_t i, int flags) 248 248 { 249 249 pte_level0_t *p = &pt[i]; … … 273 273 * @param flags New flags. 274 274 */ 275 static inline void set_pt_level1_flags(pte_level1_t *pt, index_t i, int flags)275 static inline void set_pt_level1_flags(pte_level1_t *pt, size_t i, int flags) 276 276 { 277 277 pte_level1_t *p = &pt[i]; -
kernel/arch/arm32/include/types.h
r69e68e3 r98000fb 54 54 55 55 typedef uint32_t size_t; 56 typedef uint32_t count_t;57 typedef uint32_t index_t;58 56 59 57 typedef uint32_t uintptr_t; … … 70 68 #define PRIp "x" /**< Format for uintptr_t. */ 71 69 #define PRIs "u" /**< Format for size_t. */ 72 #define PRIc "u" /**< Format for count_t. */73 #define PRIi "u" /**< Format for index_t. */74 70 75 71 #define PRId8 "d" /**< Format for int8_t. */ -
kernel/arch/arm32/src/mm/tlb.c
r69e68e3 r98000fb 81 81 * @param cnt Number of entries to invalidate. 82 82 */ 83 void tlb_invalidate_pages(asid_t asid __attribute__((unused)), uintptr_t page, count_t cnt)83 void tlb_invalidate_pages(asid_t asid __attribute__((unused)), uintptr_t page, size_t cnt) 84 84 { 85 85 unsigned int i; -
kernel/arch/ia32/include/cpu.h
r69e68e3 r98000fb 58 58 tss_t *tss; 59 59 60 count_t iomapver_copy; /** Copy of TASK's I/O Permission bitmap generation count. */60 size_t iomapver_copy; /** Copy of TASK's I/O Permission bitmap generation count. */ 61 61 } cpu_arch_t; 62 62 -
kernel/arch/ia32/include/mm/page.h
r69e68e3 r98000fb 96 96 /* Get PTE flags accessors for each level. */ 97 97 #define GET_PTL1_FLAGS_ARCH(ptl0, i) \ 98 get_pt_flags((pte_t *) (ptl0), ( index_t) (i))98 get_pt_flags((pte_t *) (ptl0), (size_t) (i)) 99 99 #define GET_PTL2_FLAGS_ARCH(ptl1, i) \ 100 100 PAGE_PRESENT … … 102 102 PAGE_PRESENT 103 103 #define GET_FRAME_FLAGS_ARCH(ptl3, i) \ 104 get_pt_flags((pte_t *) (ptl3), ( index_t) (i))104 get_pt_flags((pte_t *) (ptl3), (size_t) (i)) 105 105 106 106 /* Set PTE flags accessors for each level. */ 107 107 #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) \ 108 set_pt_flags((pte_t *) (ptl0), ( index_t) (i), (x))108 set_pt_flags((pte_t *) (ptl0), (size_t) (i), (x)) 109 109 #define SET_PTL2_FLAGS_ARCH(ptl1, i, x) 110 110 #define SET_PTL3_FLAGS_ARCH(ptl2, i, x) 111 111 #define SET_FRAME_FLAGS_ARCH(ptl3, i, x) \ 112 set_pt_flags((pte_t *) (ptl3), ( index_t) (i), (x))112 set_pt_flags((pte_t *) (ptl3), (size_t) (i), (x)) 113 113 114 114 /* Macros for querying the last level entries. */ … … 146 146 #define PFERR_CODE_RSVD (1 << 3) 147 147 148 static inline int get_pt_flags(pte_t *pt, index_t i)148 static inline int get_pt_flags(pte_t *pt, size_t i) 149 149 { 150 150 pte_t *p = &pt[i]; … … 159 159 } 160 160 161 static inline void set_pt_flags(pte_t *pt, index_t i, int flags)161 static inline void set_pt_flags(pte_t *pt, size_t i, int flags) 162 162 { 163 163 pte_t *p = &pt[i]; -
kernel/arch/ia32/include/proc/task.h
r69e68e3 r98000fb 41 41 typedef struct { 42 42 /** I/O Permission bitmap Generation counter. */ 43 count_t iomapver;43 size_t iomapver; 44 44 /** I/O Permission bitmap. */ 45 45 bitmap_t iomap; -
kernel/arch/ia32/include/smp/smp.h
r69e68e3 r98000fb 40 40 /** SMP config opertaions interface. */ 41 41 struct smp_config_operations { 42 count_t (* cpu_count)(void); /**< Return number of detected processors. */43 bool (* cpu_enabled)( index_t i); /**< Check whether the processor of index i is enabled. */44 bool (*cpu_bootstrap)( index_t i); /**< Check whether the processor of index i is BSP. */45 uint8_t (*cpu_apic_id)( index_t i); /**< Return APIC ID of the processor of index i. */42 size_t (* cpu_count)(void); /**< Return number of detected processors. */ 43 bool (* cpu_enabled)(size_t i); /**< Check whether the processor of index i is enabled. */ 44 bool (*cpu_bootstrap)(size_t i); /**< Check whether the processor of index i is BSP. */ 45 uint8_t (*cpu_apic_id)(size_t i); /**< Return APIC ID of the processor of index i. */ 46 46 int (*irq_to_pin)(unsigned int irq); /**< Return mapping between irq and APIC pin. */ 47 47 }; -
kernel/arch/ia32/include/types.h
r69e68e3 r98000fb 47 47 48 48 typedef uint32_t size_t; 49 typedef uint32_t count_t;50 typedef uint32_t index_t;51 49 52 50 typedef uint32_t uintptr_t; … … 63 61 #define PRIp "x" /**< Format for uintptr_t. */ 64 62 #define PRIs "u" /**< Format for size_t. */ 65 #define PRIc "u" /**< Format for count_t. */66 #define PRIi "u" /**< Format for index_t. */67 63 68 64 #define PRId8 "d" /**< Format for int8_t. */ -
kernel/arch/ia32/src/ddi/ddi.c
r69e68e3 r98000fb 58 58 int ddi_iospace_enable_arch(task_t *task, uintptr_t ioaddr, size_t size) 59 59 { 60 count_t bits;60 size_t bits; 61 61 62 62 bits = ioaddr + size; … … 100 100 * Enable the range and we are done. 101 101 */ 102 bitmap_clear_range(&task->arch.iomap, ( index_t) ioaddr, (count_t) size);102 bitmap_clear_range(&task->arch.iomap, (size_t) ioaddr, (size_t) size); 103 103 104 104 /* … … 119 119 void io_perm_bitmap_install(void) 120 120 { 121 count_t bits;121 size_t bits; 122 122 ptr_16_32_t cpugdtr; 123 123 descriptor_t *gdt_p; 124 count_t ver;124 size_t ver; 125 125 126 126 /* First, copy the I/O Permission Bitmap. */ -
kernel/arch/ia32/src/interrupt.c
r69e68e3 r98000fb 102 102 { 103 103 if (TASK) { 104 count_t ver;104 size_t ver; 105 105 106 106 spinlock_lock(&TASK->lock); -
kernel/arch/ia32/src/mm/frame.c
r69e68e3 r98000fb 71 71 #endif 72 72 pfn_t pfn; 73 count_t count;73 size_t count; 74 74 75 75 if (e820table[i].type == MEMMAP_MEMORY_AVAILABLE) { -
kernel/arch/ia32/src/mm/tlb.c
r69e68e3 r98000fb 60 60 * @param cnt Number of entries to invalidate. 61 61 */ 62 void tlb_invalidate_pages(asid_t asid __attribute__((unused)), uintptr_t page, count_t cnt)62 void tlb_invalidate_pages(asid_t asid __attribute__((unused)), uintptr_t page, size_t cnt) 63 63 { 64 64 unsigned int i; -
kernel/arch/ia32/src/smp/mps.c
r69e68e3 r98000fb 87 87 * Implementation of IA-32 SMP configuration interface. 88 88 */ 89 static count_t get_cpu_count(void);90 static bool is_cpu_enabled( index_t i);91 static bool is_bsp( index_t i);92 static uint8_t get_cpu_apic_id( index_t i);89 static size_t get_cpu_count(void); 90 static bool is_cpu_enabled(size_t i); 91 static bool is_bsp(size_t i); 92 static uint8_t get_cpu_apic_id(size_t i); 93 93 static int mps_irq_to_pin(unsigned int irq); 94 94 … … 101 101 }; 102 102 103 count_t get_cpu_count(void)103 size_t get_cpu_count(void) 104 104 { 105 105 return processor_entry_cnt; 106 106 } 107 107 108 bool is_cpu_enabled( index_t i)108 bool is_cpu_enabled(size_t i) 109 109 { 110 110 ASSERT(i < processor_entry_cnt); … … 112 112 } 113 113 114 bool is_bsp( index_t i)114 bool is_bsp(size_t i) 115 115 { 116 116 ASSERT(i < processor_entry_cnt); … … 118 118 } 119 119 120 uint8_t get_cpu_apic_id( index_t i)120 uint8_t get_cpu_apic_id(size_t i) 121 121 { 122 122 ASSERT(i < processor_entry_cnt); -
kernel/arch/ia64/include/mm/page.h
r69e68e3 r98000fb 241 241 * @return Current contents of rr[i]. 242 242 */ 243 static inline uint64_t rr_read( index_t i)243 static inline uint64_t rr_read(size_t i) 244 244 { 245 245 uint64_t ret; … … 254 254 * @param v Value to be written to rr[i]. 255 255 */ 256 static inline void rr_write( index_t i, uint64_t v)256 static inline void rr_write(size_t i, uint64_t v) 257 257 { 258 258 ASSERT(i < REGION_REGISTERS); -
kernel/arch/ia64/include/mm/tlb.h
r69e68e3 r98000fb 77 77 extern void itc_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry); 78 78 79 extern void tr_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry, bool dtr, index_t tr);80 extern void dtr_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry, index_t tr);81 extern void itr_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry, index_t tr);79 extern void tr_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry, bool dtr, size_t tr); 80 extern void dtr_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry, size_t tr); 81 extern void itr_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry, size_t tr); 82 82 83 extern void dtlb_kernel_mapping_insert(uintptr_t page, uintptr_t frame, bool dtr, index_t tr);84 extern void dtr_purge(uintptr_t page, count_t width);83 extern void dtlb_kernel_mapping_insert(uintptr_t page, uintptr_t frame, bool dtr, size_t tr); 84 extern void dtr_purge(uintptr_t page, size_t width); 85 85 86 86 extern void dtc_pte_copy(pte_t *t); -
kernel/arch/ia64/include/types.h
r69e68e3 r98000fb 55 55 56 56 typedef uint64_t size_t; 57 typedef uint64_t count_t;58 typedef uint64_t index_t;59 57 60 58 typedef uint64_t uintptr_t; … … 73 71 #define PRIp "lx" /**< Format for uintptr_t. */ 74 72 #define PRIs "lu" /**< Format for size_t. */ 75 #define PRIc "lu" /**< Format for count_t. */76 #define PRIi "lu" /**< Format for index_t. */77 73 78 74 #define PRId8 "d" /**< Format for int8_t. */ -
kernel/arch/ia64/src/mm/page.c
r69e68e3 r98000fb 132 132 { 133 133 region_register rr_save, rr; 134 index_t vrn;134 size_t vrn; 135 135 rid_t rid; 136 136 vhpt_entry_t *v; … … 177 177 { 178 178 region_register rr_save, rr; 179 index_t vrn;179 size_t vrn; 180 180 rid_t rid; 181 181 bool match; … … 224 224 { 225 225 region_register rr_save, rr; 226 index_t vrn;226 size_t vrn; 227 227 rid_t rid; 228 228 uint64_t tag; -
kernel/arch/ia64/src/mm/tlb.c
r69e68e3 r98000fb 101 101 102 102 103 void tlb_invalidate_pages(asid_t asid, uintptr_t page, count_t cnt)103 void tlb_invalidate_pages(asid_t asid, uintptr_t page, size_t cnt) 104 104 { 105 105 region_register rr; … … 268 268 */ 269 269 void 270 itr_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry, index_t tr)270 itr_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry, size_t tr) 271 271 { 272 272 tr_mapping_insert(va, asid, entry, false, tr); … … 282 282 */ 283 283 void 284 dtr_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry, index_t tr)284 dtr_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry, size_t tr) 285 285 { 286 286 tr_mapping_insert(va, asid, entry, true, tr); … … 299 299 void 300 300 tr_mapping_insert(uintptr_t va, asid_t asid, tlb_entry_t entry, bool dtr, 301 index_t tr)301 size_t tr) 302 302 { 303 303 region_register rr; … … 354 354 void 355 355 dtlb_kernel_mapping_insert(uintptr_t page, uintptr_t frame, bool dtr, 356 index_t tr)356 size_t tr) 357 357 { 358 358 tlb_entry_t entry; … … 383 383 * @param width Width of the purge in bits. 384 384 */ 385 void dtr_purge(uintptr_t page, count_t width)385 void dtr_purge(uintptr_t page, size_t width) 386 386 { 387 387 asm volatile ("ptr.d %0, %1\n" : : "r" (page), "r" (width << 2)); -
kernel/arch/ia64/src/mm/vhpt.c
r69e68e3 r98000fb 54 54 { 55 55 region_register rr_save, rr; 56 index_t vrn;56 size_t vrn; 57 57 rid_t rid; 58 58 uint64_t tag; -
kernel/arch/mips32/include/arch.h
r69e68e3 r98000fb 43 43 #include <typedefs.h> 44 44 45 extern count_t cpu_count;45 extern size_t cpu_count; 46 46 47 47 typedef struct { -
kernel/arch/mips32/include/debugger.h
r69e68e3 r98000fb 54 54 unative_t nextinstruction; /**< Original instruction following break */ 55 55 int flags; /**< Flags regarding breakpoint */ 56 count_t counter;56 size_t counter; 57 57 void (*bkfunc)(void *b, istate_t *istate); 58 58 } bpinfo_t; -
kernel/arch/mips32/include/mm/page.h
r69e68e3 r98000fb 113 113 /* Get PTE flags accessors for each level. */ 114 114 #define GET_PTL1_FLAGS_ARCH(ptl0, i) \ 115 get_pt_flags((pte_t *) (ptl0), ( index_t) (i))115 get_pt_flags((pte_t *) (ptl0), (size_t) (i)) 116 116 #define GET_PTL2_FLAGS_ARCH(ptl1, i) \ 117 117 PAGE_PRESENT … … 119 119 PAGE_PRESENT 120 120 #define GET_FRAME_FLAGS_ARCH(ptl3, i) \ 121 get_pt_flags((pte_t *) (ptl3), ( index_t) (i))121 get_pt_flags((pte_t *) (ptl3), (size_t) (i)) 122 122 123 123 /* Set PTE flags accessors for each level. */ 124 124 #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) \ 125 set_pt_flags((pte_t *) (ptl0), ( index_t) (i), (x))125 set_pt_flags((pte_t *) (ptl0), (size_t) (i), (x)) 126 126 #define SET_PTL2_FLAGS_ARCH(ptl1, i, x) 127 127 #define SET_PTL3_FLAGS_ARCH(ptl2, i, x) 128 128 #define SET_FRAME_FLAGS_ARCH(ptl3, i, x) \ 129 set_pt_flags((pte_t *) (ptl3), ( index_t) (i), (x))129 set_pt_flags((pte_t *) (ptl3), (size_t) (i), (x)) 130 130 131 131 /* Last-level info macros. */ … … 141 141 #include <arch/exception.h> 142 142 143 static inline int get_pt_flags(pte_t *pt, index_t i)143 static inline int get_pt_flags(pte_t *pt, size_t i) 144 144 { 145 145 pte_t *p = &pt[i]; … … 154 154 } 155 155 156 static inline void set_pt_flags(pte_t *pt, index_t i, int flags)156 static inline void set_pt_flags(pte_t *pt, size_t i, int flags) 157 157 { 158 158 pte_t *p = &pt[i]; -
kernel/arch/mips32/include/types.h
r69e68e3 r98000fb 47 47 48 48 typedef uint32_t size_t; 49 typedef uint32_t count_t;50 typedef uint32_t index_t;51 49 52 50 typedef uint32_t uintptr_t; … … 63 61 #define PRIp "x" /**< Format for uintptr_t. */ 64 62 #define PRIs "u" /**< Format for size_t. */ 65 #define PRIc "u" /**< Format for count_t. */66 #define PRIi "u" /**< Format for index_t. */67 63 68 64 #define PRId8 "d" /**< Format for int8_t. */ -
kernel/arch/mips32/src/mips32.c
r69e68e3 r98000fb 77 77 uintptr_t supervisor_sp __attribute__ ((section (".text"))); 78 78 79 count_t cpu_count = 0;79 size_t cpu_count = 0; 80 80 81 81 /** Performs mips32-specific initialization before main_bsp() is called. */ … … 85 85 init.cnt = bootinfo->cnt; 86 86 87 count_t i;87 size_t i; 88 88 for (i = 0; i < min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); i++) { 89 89 init.tasks[i].addr = bootinfo->tasks[i].addr; -
kernel/arch/mips32/src/mm/frame.c
r69e68e3 r98000fb 63 63 } phys_region_t; 64 64 65 static count_t phys_regions_count = 0;65 static size_t phys_regions_count = 0; 66 66 static phys_region_t phys_regions[MAX_REGIONS]; 67 67 … … 120 120 /* Init tasks */ 121 121 bool safe = true; 122 count_t i;122 size_t i; 123 123 for (i = 0; i < init.cnt; i++) 124 124 if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE, … … 175 175 cp0_entry_hi_write(0); 176 176 177 count_t i;177 size_t i; 178 178 for (i = 0; i < TLB_ENTRY_COUNT; i++) { 179 179 cp0_index_write(i); … … 252 252 printf("---------- ----------\n"); 253 253 254 count_t i;254 size_t i; 255 255 for (i = 0; i < phys_regions_count; i++) { 256 256 printf("%#010x %10u\n", -
kernel/arch/mips32/src/mm/tlb.c
r69e68e3 r98000fb 561 561 * @param cnt Number of entries to invalidate. 562 562 */ 563 void tlb_invalidate_pages(asid_t asid, uintptr_t page, count_t cnt)563 void tlb_invalidate_pages(asid_t asid, uintptr_t page, size_t cnt) 564 564 { 565 565 unsigned int i; -
kernel/arch/ppc32/include/mm/page.h
r69e68e3 r98000fb 103 103 /* Get PTE flags accessors for each level. */ 104 104 #define GET_PTL1_FLAGS_ARCH(ptl0, i) \ 105 get_pt_flags((pte_t *) (ptl0), ( index_t) (i))105 get_pt_flags((pte_t *) (ptl0), (size_t) (i)) 106 106 #define GET_PTL2_FLAGS_ARCH(ptl1, i) \ 107 107 PAGE_PRESENT … … 109 109 PAGE_PRESENT 110 110 #define GET_FRAME_FLAGS_ARCH(ptl3, i) \ 111 get_pt_flags((pte_t *) (ptl3), ( index_t) (i))111 get_pt_flags((pte_t *) (ptl3), (size_t) (i)) 112 112 113 113 /* Set PTE flags accessors for each level. */ 114 114 #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) \ 115 set_pt_flags((pte_t *) (ptl0), ( index_t) (i), (x))115 set_pt_flags((pte_t *) (ptl0), (size_t) (i), (x)) 116 116 #define SET_PTL2_FLAGS_ARCH(ptl1, i, x) 117 117 #define SET_PTL3_FLAGS_ARCH(ptl2, i, x) 118 118 #define SET_FRAME_FLAGS_ARCH(ptl3, i, x) \ 119 set_pt_flags((pte_t *) (ptl3), ( index_t) (i), (x))119 set_pt_flags((pte_t *) (ptl3), (size_t) (i), (x)) 120 120 121 121 /* Macros for querying the last-level PTEs. */ … … 131 131 #include <arch/interrupt.h> 132 132 133 static inline int get_pt_flags(pte_t *pt, index_t i)133 static inline int get_pt_flags(pte_t *pt, size_t i) 134 134 { 135 135 pte_t *p = &pt[i]; … … 144 144 } 145 145 146 static inline void set_pt_flags(pte_t *pt, index_t i, int flags)146 static inline void set_pt_flags(pte_t *pt, size_t i, int flags) 147 147 { 148 148 pte_t *p = &pt[i]; -
kernel/arch/ppc32/include/types.h
r69e68e3 r98000fb 47 47 48 48 typedef uint32_t size_t; 49 typedef uint32_t count_t;50 typedef uint32_t index_t;51 49 52 50 typedef uint32_t uintptr_t; … … 61 59 } fncptr_t; 62 60 63 /**< Formats for uintptr_t, size_t , count_t and index_t*/61 /**< Formats for uintptr_t, size_t */ 64 62 #define PRIp "x" 65 63 #define PRIs "u" 66 #define PRIc "u"67 #define PRIi "u"68 64 69 65 /**< Formats for (u)int8_t, (u)int16_t, (u)int32_t, (u)int64_t and (u)native_t */ -
kernel/arch/ppc32/src/mm/frame.c
r69e68e3 r98000fb 58 58 { 59 59 pfn_t minconf = 2; 60 count_t i;60 size_t i; 61 61 pfn_t start, conf; 62 62 size_t size; -
kernel/arch/ppc32/src/mm/tlb.c
r69e68e3 r98000fb 550 550 551 551 552 void tlb_invalidate_pages(asid_t asid, uintptr_t page, count_t cnt)552 void tlb_invalidate_pages(asid_t asid, uintptr_t page, size_t cnt) 553 553 { 554 554 // TODO -
kernel/arch/sparc64/include/mm/tlb.h
r69e68e3 r98000fb 323 323 * Register. 324 324 */ 325 static inline uint64_t itlb_data_access_read( index_t entry)325 static inline uint64_t itlb_data_access_read(size_t entry) 326 326 { 327 327 itlb_data_access_addr_t reg; … … 337 337 * @param value Value to be written. 338 338 */ 339 static inline void itlb_data_access_write( index_t entry, uint64_t value)339 static inline void itlb_data_access_write(size_t entry, uint64_t value) 340 340 { 341 341 itlb_data_access_addr_t reg; … … 354 354 * Register. 355 355 */ 356 static inline uint64_t dtlb_data_access_read( index_t entry)356 static inline uint64_t dtlb_data_access_read(size_t entry) 357 357 { 358 358 dtlb_data_access_addr_t reg; … … 368 368 * @param value Value to be written. 369 369 */ 370 static inline void dtlb_data_access_write( index_t entry, uint64_t value)370 static inline void dtlb_data_access_write(size_t entry, uint64_t value) 371 371 { 372 372 dtlb_data_access_addr_t reg; … … 384 384 * @return Current value of specified IMMU TLB Tag Read Register. 385 385 */ 386 static inline uint64_t itlb_tag_read_read( index_t entry)386 static inline uint64_t itlb_tag_read_read(size_t entry) 387 387 { 388 388 itlb_tag_read_addr_t tag; … … 399 399 * @return Current value of specified DMMU TLB Tag Read Register. 400 400 */ 401 static inline uint64_t dtlb_tag_read_read( index_t entry)401 static inline uint64_t dtlb_tag_read_read(size_t entry) 402 402 { 403 403 dtlb_tag_read_addr_t tag; … … 419 419 * Register. 420 420 */ 421 static inline uint64_t itlb_data_access_read(int tlb, index_t entry)421 static inline uint64_t itlb_data_access_read(int tlb, size_t entry) 422 422 { 423 423 itlb_data_access_addr_t reg; … … 434 434 * @param value Value to be written. 435 435 */ 436 static inline void itlb_data_access_write(int tlb, index_t entry,436 static inline void itlb_data_access_write(int tlb, size_t entry, 437 437 uint64_t value) 438 438 { … … 454 454 * Register. 455 455 */ 456 static inline uint64_t dtlb_data_access_read(int tlb, index_t entry)456 static inline uint64_t dtlb_data_access_read(int tlb, size_t entry) 457 457 { 458 458 dtlb_data_access_addr_t reg; … … 470 470 * @param value Value to be written. 471 471 */ 472 static inline void dtlb_data_access_write(int tlb, index_t entry,472 static inline void dtlb_data_access_write(int tlb, size_t entry, 473 473 uint64_t value) 474 474 { … … 489 489 * @return Current value of specified IMMU TLB Tag Read Register. 490 490 */ 491 static inline uint64_t itlb_tag_read_read(int tlb, index_t entry)491 static inline uint64_t itlb_tag_read_read(int tlb, size_t entry) 492 492 { 493 493 itlb_tag_read_addr_t tag; … … 506 506 * @return Current value of specified DMMU TLB Tag Read Register. 507 507 */ 508 static inline uint64_t dtlb_tag_read_read(int tlb, index_t entry)508 static inline uint64_t dtlb_tag_read_read(int tlb, size_t entry) 509 509 { 510 510 dtlb_tag_read_addr_t tag; -
kernel/arch/sparc64/include/mm/tsb.h
r69e68e3 r98000fb 161 161 struct pte; 162 162 163 extern void tsb_invalidate(struct as *as, uintptr_t page, count_t pages);164 extern void itsb_pte_copy(struct pte *t, index_t index);165 extern void dtsb_pte_copy(struct pte *t, index_t index, bool ro);163 extern void tsb_invalidate(struct as *as, uintptr_t page, size_t pages); 164 extern void itsb_pte_copy(struct pte *t, size_t index); 165 extern void dtsb_pte_copy(struct pte *t, size_t index, bool ro); 166 166 167 167 #endif /* !def __ASM__ */ -
kernel/arch/sparc64/include/types.h
r69e68e3 r98000fb 47 47 48 48 typedef uint64_t size_t; 49 typedef uint64_t count_t;50 typedef uint64_t index_t;51 49 52 50 typedef uint64_t uintptr_t; … … 61 59 } fncptr_t; 62 60 63 /**< Formats for uintptr_t, size_t , count_t and index_t*/61 /**< Formats for uintptr_t, size_t */ 64 62 #define PRIp "llx" 65 63 #define PRIs "llu" 66 #define PRIc "llu"67 #define PRIi "llu"68 64 69 65 /**< Formats for (u)int8_t, (u)int16_t, (u)int32_t, (u)int64_t and (u)native_t */ -
kernel/arch/sparc64/src/drivers/fhc.c
r69e68e3 r98000fb 72 72 return NULL; 73 73 74 count_t regs = prop->size / sizeof(ofw_central_reg_t);74 size_t regs = prop->size / sizeof(ofw_central_reg_t); 75 75 if (regs + 1 < UART_IMAP_REG) 76 76 return NULL; -
kernel/arch/sparc64/src/drivers/pci.c
r69e68e3 r98000fb 92 92 93 93 ofw_upa_reg_t *reg = prop->value; 94 count_t regs = prop->size / sizeof(ofw_upa_reg_t);94 size_t regs = prop->size / sizeof(ofw_upa_reg_t); 95 95 96 96 if (regs < SABRE_INTERNAL_REG + 1) … … 139 139 140 140 ofw_upa_reg_t *reg = prop->value; 141 count_t regs = prop->size / sizeof(ofw_upa_reg_t);141 size_t regs = prop->size / sizeof(ofw_upa_reg_t); 142 142 143 143 if (regs < PSYCHO_INTERNAL_REG + 1) -
kernel/arch/sparc64/src/mm/as.c
r69e68e3 r98000fb 90 90 * size. 91 91 */ 92 count_t cnt = ((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) *92 size_t cnt = ((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) * 93 93 sizeof(tsb_entry_t)) >> FRAME_WIDTH; 94 94 frame_free(KA2PA((uintptr_t) as->arch.itsb)); … … 102 102 { 103 103 #ifdef CONFIG_TSB 104 tsb_invalidate(as, 0, ( count_t) -1);104 tsb_invalidate(as, 0, (size_t) -1); 105 105 #endif 106 106 return 0; -
kernel/arch/sparc64/src/mm/tlb.c
r69e68e3 r98000fb 55 55 #endif 56 56 57 static void dtlb_pte_copy(pte_t *, index_t, bool);58 static void itlb_pte_copy(pte_t *, index_t);57 static void dtlb_pte_copy(pte_t *, size_t, bool); 58 static void itlb_pte_copy(pte_t *, size_t); 59 59 static void do_fast_instruction_access_mmu_miss_fault(istate_t *, const char *); 60 60 static void do_fast_data_access_mmu_miss_fault(istate_t *, tlb_tag_access_reg_t, … … 131 131 * of its w field. 132 132 */ 133 void dtlb_pte_copy(pte_t *t, index_t index, bool ro)133 void dtlb_pte_copy(pte_t *t, size_t index, bool ro) 134 134 { 135 135 tlb_tag_access_reg_t tag; … … 168 168 * @param index Zero if lower 8K-subpage, one if higher 8K-subpage. 169 169 */ 170 void itlb_pte_copy(pte_t *t, index_t index)170 void itlb_pte_copy(pte_t *t, size_t index) 171 171 { 172 172 tlb_tag_access_reg_t tag; … … 201 201 { 202 202 uintptr_t page_16k = ALIGN_DOWN(istate->tpc, PAGE_SIZE); 203 index_t index = (istate->tpc >> MMU_PAGE_WIDTH) % MMU_PAGES_PER_PAGE;203 size_t index = (istate->tpc >> MMU_PAGE_WIDTH) % MMU_PAGES_PER_PAGE; 204 204 pte_t *t; 205 205 … … 246 246 uintptr_t page_8k; 247 247 uintptr_t page_16k; 248 index_t index;248 size_t index; 249 249 pte_t *t; 250 250 … … 310 310 { 311 311 uintptr_t page_16k; 312 index_t index;312 size_t index; 313 313 pte_t *t; 314 314 … … 580 580 * @param cnt Number of ITLB and DTLB entries to invalidate. 581 581 */ 582 void tlb_invalidate_pages(asid_t asid, uintptr_t page, count_t cnt)582 void tlb_invalidate_pages(asid_t asid, uintptr_t page, size_t cnt) 583 583 { 584 584 unsigned int i; -
kernel/arch/sparc64/src/mm/tsb.c
r69e68e3 r98000fb 51 51 * @param as Address space. 52 52 * @param page First page to invalidate in TSB. 53 * @param pages Number of pages to invalidate. Value of ( count_t) -1 means the53 * @param pages Number of pages to invalidate. Value of (size_t) -1 means the 54 54 * whole TSB. 55 55 */ 56 void tsb_invalidate(as_t *as, uintptr_t page, count_t pages)56 void tsb_invalidate(as_t *as, uintptr_t page, size_t pages) 57 57 { 58 index_t i0, i; 59 count_t cnt; 58 size_t i0; 59 size_t i; 60 size_t cnt; 60 61 61 62 ASSERT(as->arch.itsb && as->arch.dtsb); … … 64 65 ASSERT(i0 < ITSB_ENTRY_COUNT && i0 < DTSB_ENTRY_COUNT); 65 66 66 if (pages == ( count_t) -1 || (pages * 2) > ITSB_ENTRY_COUNT)67 if (pages == (size_t) -1 || (pages * 2) > ITSB_ENTRY_COUNT) 67 68 cnt = ITSB_ENTRY_COUNT; 68 69 else … … 82 83 * @param index Zero if lower 8K-subpage, one if higher 8K subpage. 83 84 */ 84 void itsb_pte_copy(pte_t *t, index_t index)85 void itsb_pte_copy(pte_t *t, size_t index) 85 86 { 86 87 as_t *as; 87 88 tsb_entry_t *tsb; 88 index_t entry;89 size_t entry; 89 90 90 91 ASSERT(index <= 1); … … 128 129 * @param ro If true, the mapping is copied read-only. 129 130 */ 130 void dtsb_pte_copy(pte_t *t, index_t index, bool ro)131 void dtsb_pte_copy(pte_t *t, size_t index, bool ro) 131 132 { 132 133 as_t *as; 133 134 tsb_entry_t *tsb; 134 index_t entry;135 size_t entry; 135 136 136 137 ASSERT(index <= 1); -
kernel/arch/sparc64/src/smp/smp.c
r69e68e3 r98000fb 62 62 { 63 63 ofw_tree_node_t *node; 64 count_t cnt = 0;64 size_t cnt = 0; 65 65 66 66 if (is_us() || is_us_iii()) {
Note:
See TracChangeset
for help on using the changeset viewer.