Changeset 7f1c620 in mainline for arch/ia32/include
- Timestamp:
- 2006-07-04T17:17:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- Location:
- arch/ia32/include
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/include/asm.h
r991779c5 r7f1c620 41 41 #include <config.h> 42 42 43 extern __u32interrupt_handler_size;43 extern uint32_t interrupt_handler_size; 44 44 45 45 extern void paging_on(void); … … 50 50 51 51 52 extern void asm_delay_loop( __u32t);53 extern void asm_fake_loop( __u32t);52 extern void asm_delay_loop(uint32_t t); 53 extern void asm_fake_loop(uint32_t t); 54 54 55 55 … … 61 61 static inline void cpu_sleep(void) { __asm__("hlt\n"); }; 62 62 63 #define GEN_READ_REG(reg) static inline __nativeread_ ##reg (void) \63 #define GEN_READ_REG(reg) static inline unative_t read_ ##reg (void) \ 64 64 { \ 65 __nativeres; \65 unative_t res; \ 66 66 __asm__ volatile ("movl %%" #reg ", %0" : "=r" (res) ); \ 67 67 return res; \ 68 68 } 69 69 70 #define GEN_WRITE_REG(reg) static inline void write_ ##reg ( __nativeregn) \70 #define GEN_WRITE_REG(reg) static inline void write_ ##reg (unative_t regn) \ 71 71 { \ 72 72 __asm__ volatile ("movl %0, %%" #reg : : "r" (regn)); \ … … 99 99 * @param val Value to write 100 100 */ 101 static inline void outb( __u16 port, __u8val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); }101 static inline void outb(uint16_t port, uint8_t val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); } 102 102 103 103 /** Word to port … … 108 108 * @param val Value to write 109 109 */ 110 static inline void outw( __u16 port, __u16val) { __asm__ volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) ); }110 static inline void outw(uint16_t port, uint16_t val) { __asm__ volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) ); } 111 111 112 112 /** Double word to port … … 117 117 * @param val Value to write 118 118 */ 119 static inline void outl( __u16 port, __u32val) { __asm__ volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) ); }119 static inline void outl(uint16_t port, uint32_t val) { __asm__ volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) ); } 120 120 121 121 /** Byte from port … … 126 126 * @return Value read 127 127 */ 128 static inline __u8 inb(__u16 port) { __u8val; __asm__ volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; }128 static inline uint8_t inb(uint16_t port) { uint8_t val; __asm__ volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; } 129 129 130 130 /** Word from port … … 135 135 * @return Value read 136 136 */ 137 static inline __u16 inw(__u16 port) { __u16val; __asm__ volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port) ); return val; }137 static inline uint16_t inw(uint16_t port) { uint16_t val; __asm__ volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port) ); return val; } 138 138 139 139 /** Double word from port … … 144 144 * @return Value read 145 145 */ 146 static inline __u32 inl(__u16 port) { __u32val; __asm__ volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port) ); return val; }146 static inline uint32_t inl(uint16_t port) { uint32_t val; __asm__ volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port) ); return val; } 147 147 148 148 /** Enable interrupts. … … 220 220 * The stack must start on page boundary. 221 221 */ 222 static inline __addressget_stack_base(void)223 { 224 __addressv;222 static inline uintptr_t get_stack_base(void) 223 { 224 uintptr_t v; 225 225 226 226 __asm__ volatile ("andl %%esp, %0\n" : "=r" (v) : "0" (~(STACK_SIZE-1))); … … 229 229 } 230 230 231 static inline __u64rdtsc(void)232 { 233 __u64v;231 static inline uint64_t rdtsc(void) 232 { 233 uint64_t v; 234 234 235 235 __asm__ volatile("rdtsc\n" : "=A" (v)); … … 239 239 240 240 /** Return current IP address */ 241 static inline __address* get_ip()242 { 243 __address*ip;241 static inline uintptr_t * get_ip() 242 { 243 uintptr_t *ip; 244 244 245 245 __asm__ volatile ( … … 254 254 * @param addr Address on a page whose TLB entry is to be invalidated. 255 255 */ 256 static inline void invlpg( __addressaddr)257 { 258 __asm__ volatile ("invlpg %0\n" :: "m" (*( __native*)addr));256 static inline void invlpg(uintptr_t addr) 257 { 258 __asm__ volatile ("invlpg %0\n" :: "m" (*(unative_t *)addr)); 259 259 } 260 260 … … 290 290 * @param sel Selector specifying descriptor of TSS segment. 291 291 */ 292 static inline void tr_load( __u16sel)292 static inline void tr_load(uint16_t sel) 293 293 { 294 294 __asm__ volatile ("ltr %0" : : "r" (sel)); -
arch/ia32/include/atomic.h
r991779c5 r7f1c620 84 84 #define atomic_predec(val) (atomic_postdec(val)-1) 85 85 86 static inline __u32test_and_set(atomic_t *val) {87 __u32v;86 static inline uint32_t test_and_set(atomic_t *val) { 87 uint32_t v; 88 88 89 89 __asm__ volatile ( … … 99 99 static inline void atomic_lock_arch(atomic_t *val) 100 100 { 101 __u32tmp;101 uint32_t tmp; 102 102 103 103 preemption_disable(); -
arch/ia32/include/bios/bios.h
r991779c5 r7f1c620 40 40 #define BIOS_EBDA_PTR 0x40e 41 41 42 extern __addressebda;42 extern uintptr_t ebda; 43 43 44 44 extern void bios_init(void); -
arch/ia32/include/boot/memmap.h
r991779c5 r7f1c620 59 59 60 60 struct e820memmap_ { 61 __u64base_address;62 __u64size;63 __u32type;61 uint64_t base_address; 62 uint64_t size; 63 uint32_t type; 64 64 } __attribute__ ((packed)); 65 65 66 66 extern struct e820memmap_ e820table[MEMMAP_E820_MAX_RECORDS]; 67 67 68 extern __u8e820counter;68 extern uint8_t e820counter; 69 69 70 extern __u32e801memorysize; /**< Size of available memory in KB. */70 extern uint32_t e801memorysize; /**< Size of available memory in KB. */ 71 71 72 72 #endif -
arch/ia32/include/byteorder.h
r991779c5 r7f1c620 37 37 38 38 /* IA-32 is little-endian */ 39 #define __native_le2host(n) (n)40 #define __u64_le2host(n) (n)39 #define unative_t_le2host(n) (n) 40 #define uint64_t_le2host(n) (n) 41 41 42 42 #endif -
arch/ia32/include/context.h
r991779c5 r7f1c620 53 53 */ 54 54 struct context { 55 __addresssp;56 __addresspc;57 __u32ebx;58 __u32esi;59 __u32edi;60 __u32ebp;55 uintptr_t sp; 56 uintptr_t pc; 57 uint32_t ebx; 58 uint32_t esi; 59 uint32_t edi; 60 uint32_t ebp; 61 61 ipl_t ipl; 62 62 } __attribute__ ((packed)); -
arch/ia32/include/cpuid.h
r991779c5 r7f1c620 39 39 40 40 struct cpu_info { 41 __u32cpuid_eax;42 __u32cpuid_ebx;43 __u32cpuid_ecx;44 __u32cpuid_edx;41 uint32_t cpuid_eax; 42 uint32_t cpuid_ebx; 43 uint32_t cpuid_ecx; 44 uint32_t cpuid_edx; 45 45 } __attribute__ ((packed)); 46 46 … … 53 53 { 54 54 struct __cpuid_extended_feature_info bits; 55 __u32word;55 uint32_t word; 56 56 }cpuid_extended_feature_info; 57 57 … … 69 69 { 70 70 struct __cpuid_feature_info bits; 71 __u32word ;71 uint32_t word ; 72 72 }cpuid_feature_info; 73 73 74 74 75 static inline __u32has_cpuid(void)75 static inline uint32_t has_cpuid(void) 76 76 { 77 __u32val, ret;77 uint32_t val, ret; 78 78 79 79 __asm__ volatile ( … … 98 98 } 99 99 100 static inline void cpuid( __u32cmd, struct cpu_info *info)100 static inline void cpuid(uint32_t cmd, struct cpu_info *info) 101 101 { 102 102 __asm__ volatile ( -
arch/ia32/include/drivers/i8042.h
r991779c5 r7f1c620 46 46 #define i8042_STATUS 0x64 47 47 48 static inline void i8042_data_write( __u8data)48 static inline void i8042_data_write(uint8_t data) 49 49 { 50 50 outb(i8042_DATA, data); 51 51 } 52 52 53 static inline __u8i8042_data_read(void)53 static inline uint8_t i8042_data_read(void) 54 54 { 55 55 return inb(i8042_DATA); 56 56 } 57 57 58 static inline __u8i8042_status_read(void)58 static inline uint8_t i8042_status_read(void) 59 59 { 60 60 return inb(i8042_STATUS); 61 61 } 62 62 63 static inline void i8042_command_write( __u8command)63 static inline void i8042_command_write(uint8_t command) 64 64 { 65 65 outb(i8042_STATUS, command); -
arch/ia32/include/drivers/i8259.h
r991779c5 r7f1c620 48 48 49 49 extern void i8259_init(void); 50 extern void pic_enable_irqs( __u16irqmask);51 extern void pic_disable_irqs( __u16irqmask);50 extern void pic_enable_irqs(uint16_t irqmask); 51 extern void pic_disable_irqs(uint16_t irqmask); 52 52 extern void pic_eoi(void); 53 53 -
arch/ia32/include/faddr.h
r991779c5 r7f1c620 38 38 #include <arch/types.h> 39 39 40 #define FADDR(fptr) (( __address) (fptr))40 #define FADDR(fptr) ((uintptr_t) (fptr)) 41 41 42 42 #endif -
arch/ia32/include/fpu_context.h
r991779c5 r7f1c620 46 46 47 47 struct fpu_context { 48 __u8fpu[512]; /* FXSAVE & FXRSTOR storage area */48 uint8_t fpu[512]; /* FXSAVE & FXRSTOR storage area */ 49 49 }; 50 50 -
arch/ia32/include/interrupt.h
r991779c5 r7f1c620 70 70 71 71 struct istate { 72 __u32eax;73 __u32ecx;74 __u32edx;75 __u32esi;76 __u32edi;77 __u32ebp;78 __u32ebx;72 uint32_t eax; 73 uint32_t ecx; 74 uint32_t edx; 75 uint32_t esi; 76 uint32_t edi; 77 uint32_t ebp; 78 uint32_t ebx; 79 79 80 __u32gs;81 __u32fs;82 __u32es;83 __u32ds;80 uint32_t gs; 81 uint32_t fs; 82 uint32_t es; 83 uint32_t ds; 84 84 85 __u32error_word;86 __u32eip;87 __u32cs;88 __u32eflags;89 __u32stack[];85 uint32_t error_word; 86 uint32_t eip; 87 uint32_t cs; 88 uint32_t eflags; 89 uint32_t stack[]; 90 90 }; 91 91 … … 96 96 } 97 97 98 static inline void istate_set_retaddr(istate_t *istate, __addressretaddr)98 static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) 99 99 { 100 100 istate->eip = retaddr; 101 101 } 102 102 103 static inline __nativeistate_get_pc(istate_t *istate)103 static inline unative_t istate_get_pc(istate_t *istate) 104 104 { 105 105 return istate->eip; 106 106 } 107 107 108 extern void (* disable_irqs_function)( __u16irqmask);109 extern void (* enable_irqs_function)( __u16irqmask);108 extern void (* disable_irqs_function)(uint16_t irqmask); 109 extern void (* enable_irqs_function)(uint16_t irqmask); 110 110 extern void (* eoi_function)(void); 111 111 … … 119 119 extern void tlb_shootdown_ipi(int n, istate_t *istate); 120 120 121 extern void trap_virtual_enable_irqs( __u16irqmask);122 extern void trap_virtual_disable_irqs( __u16irqmask);121 extern void trap_virtual_enable_irqs(uint16_t irqmask); 122 extern void trap_virtual_disable_irqs(uint16_t irqmask); 123 123 extern void trap_virtual_eoi(void); 124 124 -
arch/ia32/include/memstr.h
r991779c5 r7f1c620 50 50 static inline void * memcpy(void * dst, const void * src, size_t cnt) 51 51 { 52 __natived0, d1, d2;52 unative_t d0, d1, d2; 53 53 54 54 __asm__ __volatile__( … … 66 66 "1:\n" 67 67 : "=&c" (d0), "=&D" (d1), "=&S" (d2) 68 : "0" (( __native) (cnt / 4)), "g" ((__native) cnt), "1" ((__native) dst), "2" ((__native) src)68 : "0" ((unative_t) (cnt / 4)), "g" ((unative_t) cnt), "1" ((unative_t) dst), "2" ((unative_t) src) 69 69 : "memory"); 70 70 … … 86 86 static inline int memcmp(const void * src, const void * dst, size_t cnt) 87 87 { 88 __u32d0, d1, d2;88 uint32_t d0, d1, d2; 89 89 int ret; 90 90 … … 96 96 "1:\n" 97 97 : "=a" (ret), "=%S" (d0), "=&D" (d1), "=&c" (d2) 98 : "0" (0), "1" (( __native) src), "2" ((__native) dst), "3" ((__native) cnt)98 : "0" (0), "1" ((unative_t) src), "2" ((unative_t) dst), "3" ((unative_t) cnt) 99 99 ); 100 100 … … 111 111 * @param x Value to fill 112 112 */ 113 static inline void memsetw( __address dst, size_t cnt, __u16x)113 static inline void memsetw(uintptr_t dst, size_t cnt, uint16_t x) 114 114 { 115 __u32d0, d1;115 uint32_t d0, d1; 116 116 117 117 __asm__ __volatile__ ( … … 133 133 * @param x Value to fill 134 134 */ 135 static inline void memsetb( __address dst, size_t cnt, __u8x)135 static inline void memsetb(uintptr_t dst, size_t cnt, uint8_t x) 136 136 { 137 __u32d0, d1;137 uint32_t d0, d1; 138 138 139 139 __asm__ __volatile__ ( -
arch/ia32/include/mm/frame.h
r991779c5 r7f1c620 45 45 #include <arch/types.h> 46 46 47 extern __addresslast_frame;47 extern uintptr_t last_frame; 48 48 49 49 extern void frame_arch_init(void); -
arch/ia32/include/mm/page.h
r991779c5 r7f1c620 44 44 45 45 #ifndef __ASM__ 46 # define KA2PA(x) ((( __address) (x)) - 0x80000000)47 # define PA2KA(x) ((( __address) (x)) + 0x80000000)46 # define KA2PA(x) (((uintptr_t) (x)) - 0x80000000) 47 # define PA2KA(x) (((uintptr_t) (x)) + 0x80000000) 48 48 #else 49 49 # define KA2PA(x) ((x) - 0x80000000) … … 68 68 #define GET_PTL2_ADDRESS_ARCH(ptl1, i) (ptl1) 69 69 #define GET_PTL3_ADDRESS_ARCH(ptl2, i) (ptl2) 70 #define GET_FRAME_ADDRESS_ARCH(ptl3, i) (( __address)((((pte_t *)(ptl3))[(i)].frame_address)<<12))70 #define GET_FRAME_ADDRESS_ARCH(ptl3, i) ((uintptr_t)((((pte_t *)(ptl3))[(i)].frame_address)<<12)) 71 71 72 #define SET_PTL0_ADDRESS_ARCH(ptl0) (write_cr3(( __address) (ptl0)))72 #define SET_PTL0_ADDRESS_ARCH(ptl0) (write_cr3((uintptr_t) (ptl0))) 73 73 #define SET_PTL1_ADDRESS_ARCH(ptl0, i, a) (((pte_t *)(ptl0))[(i)].frame_address = (a)>>12) 74 74 #define SET_PTL2_ADDRESS_ARCH(ptl1, i, a) … … 86 86 #define SET_FRAME_FLAGS_ARCH(ptl3, i, x) set_pt_flags((pte_t *)(ptl3), (index_t)(i), (x)) 87 87 88 #define PTE_VALID_ARCH(p) (*(( __u32*) (p)) != 0)88 #define PTE_VALID_ARCH(p) (*((uint32_t *) (p)) != 0) 89 89 #define PTE_PRESENT_ARCH(p) ((p)->present != 0) 90 90 #define PTE_GET_FRAME_ARCH(p) ((p)->frame_address<<FRAME_WIDTH) -
arch/ia32/include/pm.h
r991779c5 r7f1c620 86 86 87 87 struct ptr_16_32 { 88 __u16limit;89 __u32base;88 uint16_t limit; 89 uint32_t base; 90 90 } __attribute__ ((packed)); 91 91 typedef struct ptr_16_32 ptr_16_32_t; … … 115 115 116 116 struct tss { 117 __u16link;117 uint16_t link; 118 118 unsigned : 16; 119 __u32esp0;120 __u16ss0;119 uint32_t esp0; 120 uint16_t ss0; 121 121 unsigned : 16; 122 __u32esp1;123 __u16ss1;122 uint32_t esp1; 123 uint16_t ss1; 124 124 unsigned : 16; 125 __u32esp2;126 __u16ss2;125 uint32_t esp2; 126 uint16_t ss2; 127 127 unsigned : 16; 128 __u32cr3;129 __u32eip;130 __u32eflags;131 __u32eax;132 __u32ecx;133 __u32edx;134 __u32ebx;135 __u32esp;136 __u32ebp;137 __u32esi;138 __u32edi;139 __u16es;128 uint32_t cr3; 129 uint32_t eip; 130 uint32_t eflags; 131 uint32_t eax; 132 uint32_t ecx; 133 uint32_t edx; 134 uint32_t ebx; 135 uint32_t esp; 136 uint32_t ebp; 137 uint32_t esi; 138 uint32_t edi; 139 uint16_t es; 140 140 unsigned : 16; 141 __u16cs;141 uint16_t cs; 142 142 unsigned : 16; 143 __u16ss;143 uint16_t ss; 144 144 unsigned : 16; 145 __u16ds;145 uint16_t ds; 146 146 unsigned : 16; 147 __u16fs;147 uint16_t fs; 148 148 unsigned : 16; 149 __u16gs;149 uint16_t gs; 150 150 unsigned : 16; 151 __u16ldtr;151 uint16_t ldtr; 152 152 unsigned : 16; 153 153 unsigned : 16; 154 __u16iomap_base;155 __u8iomap[TSS_IOMAP_SIZE];154 uint16_t iomap_base; 155 uint8_t iomap[TSS_IOMAP_SIZE]; 156 156 } __attribute__ ((packed)); 157 157 typedef struct tss tss_t; … … 166 166 extern void pm_init(void); 167 167 168 extern void gdt_setbase(descriptor_t *d, __addressbase);169 extern void gdt_setlimit(descriptor_t *d, __u32limit);168 extern void gdt_setbase(descriptor_t *d, uintptr_t base); 169 extern void gdt_setlimit(descriptor_t *d, uint32_t limit); 170 170 171 171 extern void idt_init(void); 172 extern void idt_setoffset(idescriptor_t *d, __addressoffset);172 extern void idt_setoffset(idescriptor_t *d, uintptr_t offset); 173 173 174 174 extern void tss_initialize(tss_t *t); 175 extern void set_tls_desc( __addresstls);175 extern void set_tls_desc(uintptr_t tls); 176 176 177 177 #endif /* __ASM__ */ -
arch/ia32/include/proc/thread.h
r991779c5 r7f1c620 39 39 40 40 typedef struct { 41 __nativetls;41 unative_t tls; 42 42 } thread_arch_t; 43 43 -
arch/ia32/include/smp/apic.h
r991779c5 r7f1c620 106 106 107 107 /** Interrupt Command Register. */ 108 #define ICRlo (0x300/sizeof( __u32))109 #define ICRhi (0x310/sizeof( __u32))108 #define ICRlo (0x300/sizeof(uint32_t)) 109 #define ICRhi (0x310/sizeof(uint32_t)) 110 110 struct icr { 111 111 union { 112 __u32lo;112 uint32_t lo; 113 113 struct { 114 __u8vector; /**< Interrupt Vector. */114 uint8_t vector; /**< Interrupt Vector. */ 115 115 unsigned delmod : 3; /**< Delivery Mode. */ 116 116 unsigned destmod : 1; /**< Destination Mode. */ … … 125 125 }; 126 126 union { 127 __u32hi;127 uint32_t hi; 128 128 struct { 129 129 unsigned : 24; /**< Reserved. */ 130 __u8dest; /**< Destination field. */130 uint8_t dest; /**< Destination field. */ 131 131 } __attribute__ ((packed)); 132 132 }; … … 135 135 136 136 /* End Of Interrupt. */ 137 #define EOI (0x0b0/sizeof( __u32))137 #define EOI (0x0b0/sizeof(uint32_t)) 138 138 139 139 /** Error Status Register. */ 140 #define ESR (0x280/sizeof( __u32))140 #define ESR (0x280/sizeof(uint32_t)) 141 141 union esr { 142 __u32value;143 __u8err_bitmap;142 uint32_t value; 143 uint8_t err_bitmap; 144 144 struct { 145 145 unsigned send_checksum_error : 1; … … 157 157 158 158 /* Task Priority Register */ 159 #define TPR (0x080/sizeof( __u32))159 #define TPR (0x080/sizeof(uint32_t)) 160 160 union tpr { 161 __u32value;161 uint32_t value; 162 162 struct { 163 163 unsigned pri_sc : 4; /**< Task Priority Sub-Class. */ … … 168 168 169 169 /** Spurious-Interrupt Vector Register. */ 170 #define SVR (0x0f0/sizeof( __u32))170 #define SVR (0x0f0/sizeof(uint32_t)) 171 171 union svr { 172 __u32value;173 struct { 174 __u8vector; /**< Spurious Vector. */172 uint32_t value; 173 struct { 174 uint8_t vector; /**< Spurious Vector. */ 175 175 unsigned lapic_enabled : 1; /**< APIC Software Enable/Disable. */ 176 176 unsigned focus_checking : 1; /**< Focus Processor Checking. */ … … 181 181 182 182 /** Time Divide Configuration Register. */ 183 #define TDCR (0x3e0/sizeof( __u32))183 #define TDCR (0x3e0/sizeof(uint32_t)) 184 184 union tdcr { 185 __u32value;185 uint32_t value; 186 186 struct { 187 187 unsigned div_value : 4; /**< Divide Value, bit 2 is always 0. */ … … 192 192 193 193 /* Initial Count Register for Timer */ 194 #define ICRT (0x380/sizeof( __u32))194 #define ICRT (0x380/sizeof(uint32_t)) 195 195 196 196 /* Current Count Register for Timer */ 197 #define CCRT (0x390/sizeof( __u32))197 #define CCRT (0x390/sizeof(uint32_t)) 198 198 199 199 /** LVT Timer register. */ 200 #define LVT_Tm (0x320/sizeof( __u32))200 #define LVT_Tm (0x320/sizeof(uint32_t)) 201 201 union lvt_tm { 202 __u32value;203 struct { 204 __u8vector; /**< Local Timer Interrupt vector. */202 uint32_t value; 203 struct { 204 uint8_t vector; /**< Local Timer Interrupt vector. */ 205 205 unsigned : 4; /**< Reserved. */ 206 206 unsigned delivs : 1; /**< Delivery status (RO). */ … … 214 214 215 215 /** LVT LINT registers. */ 216 #define LVT_LINT0 (0x350/sizeof( __u32))217 #define LVT_LINT1 (0x360/sizeof( __u32))216 #define LVT_LINT0 (0x350/sizeof(uint32_t)) 217 #define LVT_LINT1 (0x360/sizeof(uint32_t)) 218 218 union lvt_lint { 219 __u32value;220 struct { 221 __u8vector; /**< LINT Interrupt vector. */219 uint32_t value; 220 struct { 221 uint8_t vector; /**< LINT Interrupt vector. */ 222 222 unsigned delmod : 3; /**< Delivery Mode. */ 223 223 unsigned : 1; /**< Reserved. */ … … 233 233 234 234 /** LVT Error register. */ 235 #define LVT_Err (0x370/sizeof( __u32))235 #define LVT_Err (0x370/sizeof(uint32_t)) 236 236 union lvt_error { 237 __u32value;238 struct { 239 __u8vector; /**< Local Timer Interrupt vector. */237 uint32_t value; 238 struct { 239 uint8_t vector; /**< Local Timer Interrupt vector. */ 240 240 unsigned : 4; /**< Reserved. */ 241 241 unsigned delivs : 1; /**< Delivery status (RO). */ … … 248 248 249 249 /** Local APIC ID Register. */ 250 #define L_APIC_ID (0x020/sizeof( __u32))250 #define L_APIC_ID (0x020/sizeof(uint32_t)) 251 251 union l_apic_id { 252 __u32value;252 uint32_t value; 253 253 struct { 254 254 unsigned : 24; /**< Reserved. */ 255 __u8apic_id; /**< Local APIC ID. */255 uint8_t apic_id; /**< Local APIC ID. */ 256 256 } __attribute__ ((packed)); 257 257 }; … … 259 259 260 260 /** Local APIC Version Register */ 261 #define LAVR (0x030/sizeof( __u32))261 #define LAVR (0x030/sizeof(uint32_t)) 262 262 #define LAVR_Mask 0xff 263 263 #define is_local_apic(x) (((x)&LAVR_Mask&0xf0)==0x1) … … 266 266 267 267 /** Logical Destination Register. */ 268 #define LDR (0x0d0/sizeof( __u32))268 #define LDR (0x0d0/sizeof(uint32_t)) 269 269 union ldr { 270 __u32value;270 uint32_t value; 271 271 struct { 272 272 unsigned : 24; /**< Reserved. */ 273 __u8id; /**< Logical APIC ID. */273 uint8_t id; /**< Logical APIC ID. */ 274 274 } __attribute__ ((packed)); 275 275 }; … … 277 277 278 278 /** Destination Format Register. */ 279 #define DFR (0x0e0/sizeof( __u32))279 #define DFR (0x0e0/sizeof(uint32_t)) 280 280 union dfr { 281 __u32value;281 uint32_t value; 282 282 struct { 283 283 unsigned : 28; /**< Reserved, all ones. */ … … 288 288 289 289 /* IO APIC */ 290 #define IOREGSEL (0x00/sizeof( __u32))291 #define IOWIN (0x10/sizeof( __u32))290 #define IOREGSEL (0x00/sizeof(uint32_t)) 291 #define IOWIN (0x10/sizeof(uint32_t)) 292 292 293 293 #define IOAPICID 0x00 … … 298 298 /** I/O Register Select Register. */ 299 299 union io_regsel { 300 __u32value;301 struct { 302 __u8reg_addr; /**< APIC Register Address. */300 uint32_t value; 301 struct { 302 uint8_t reg_addr; /**< APIC Register Address. */ 303 303 unsigned : 24; /**< Reserved. */ 304 304 } __attribute__ ((packed)); … … 309 309 struct io_redirection_reg { 310 310 union { 311 __u32lo;311 uint32_t lo; 312 312 struct { 313 __u8intvec; /**< Interrupt Vector. */313 uint8_t intvec; /**< Interrupt Vector. */ 314 314 unsigned delmod : 3; /**< Delivery Mode. */ 315 315 unsigned destmod : 1; /**< Destination mode. */ … … 323 323 }; 324 324 union { 325 __u32hi;325 uint32_t hi; 326 326 struct { 327 327 unsigned : 24; /**< Reserved. */ 328 __u8dest : 8; /**< Destination Field. */328 uint8_t dest : 8; /**< Destination Field. */ 329 329 } __attribute__ ((packed)); 330 330 }; … … 336 336 /** IO APIC Identification Register. */ 337 337 union io_apic_id { 338 __u32value;338 uint32_t value; 339 339 struct { 340 340 unsigned : 24; /**< Reserved. */ … … 345 345 typedef union io_apic_id io_apic_id_t; 346 346 347 extern volatile __u32*l_apic;348 extern volatile __u32*io_apic;349 350 extern __u32apic_id_mask;347 extern volatile uint32_t *l_apic; 348 extern volatile uint32_t *io_apic; 349 350 extern uint32_t apic_id_mask; 351 351 352 352 extern void apic_init(void); … … 354 354 extern void l_apic_init(void); 355 355 extern void l_apic_eoi(void); 356 extern int l_apic_broadcast_custom_ipi( __u8vector);357 extern int l_apic_send_init_ipi( __u8apicid);356 extern int l_apic_broadcast_custom_ipi(uint8_t vector); 357 extern int l_apic_send_init_ipi(uint8_t apicid); 358 358 extern void l_apic_debug(void); 359 extern __u8l_apic_id(void);360 361 extern __u32 io_apic_read(__u8address);362 extern void io_apic_write( __u8 address , __u32x);363 extern void io_apic_change_ioredtbl(int pin, int dest, __u8v, int flags);364 extern void io_apic_disable_irqs( __u16irqmask);365 extern void io_apic_enable_irqs( __u16irqmask);359 extern uint8_t l_apic_id(void); 360 361 extern uint32_t io_apic_read(uint8_t address); 362 extern void io_apic_write(uint8_t address , uint32_t x); 363 extern void io_apic_change_ioredtbl(int pin, int dest, uint8_t v, int flags); 364 extern void io_apic_disable_irqs(uint16_t irqmask); 365 extern void io_apic_enable_irqs(uint16_t irqmask); 366 366 367 367 #endif -
arch/ia32/include/smp/mps.h
r991779c5 r7f1c620 46 46 47 47 struct mps_fs { 48 __u32signature;49 __u32configuration_table;50 __u8length;51 __u8revision;52 __u8checksum;53 __u8config_type;54 __u8mpfib2;55 __u8mpfib3;56 __u8mpfib4;57 __u8mpfib5;48 uint32_t signature; 49 uint32_t configuration_table; 50 uint8_t length; 51 uint8_t revision; 52 uint8_t checksum; 53 uint8_t config_type; 54 uint8_t mpfib2; 55 uint8_t mpfib3; 56 uint8_t mpfib4; 57 uint8_t mpfib5; 58 58 } __attribute__ ((packed)); 59 59 60 60 struct mps_ct { 61 __u32signature;62 __u16base_table_length;63 __u8revision;64 __u8checksum;65 __u8oem_id[8];66 __u8product_id[12];67 __u32oem_table;68 __u16oem_table_size;69 __u16entry_count;70 __u32l_apic;71 __u16ext_table_length;72 __u8ext_table_checksum;73 __u8xxx;74 __u8base_table[0];61 uint32_t signature; 62 uint16_t base_table_length; 63 uint8_t revision; 64 uint8_t checksum; 65 uint8_t oem_id[8]; 66 uint8_t product_id[12]; 67 uint32_t oem_table; 68 uint16_t oem_table_size; 69 uint16_t entry_count; 70 uint32_t l_apic; 71 uint16_t ext_table_length; 72 uint8_t ext_table_checksum; 73 uint8_t xxx; 74 uint8_t base_table[0]; 75 75 } __attribute__ ((packed)); 76 76 77 77 struct __processor_entry { 78 __u8type;79 __u8l_apic_id;80 __u8l_apic_version;81 __u8cpu_flags;82 __u8cpu_signature[4];83 __u32feature_flags;84 __u32xxx[2];78 uint8_t type; 79 uint8_t l_apic_id; 80 uint8_t l_apic_version; 81 uint8_t cpu_flags; 82 uint8_t cpu_signature[4]; 83 uint32_t feature_flags; 84 uint32_t xxx[2]; 85 85 } __attribute__ ((packed)); 86 86 87 87 struct __bus_entry { 88 __u8type;89 __u8bus_id;90 __u8bus_type[6];88 uint8_t type; 89 uint8_t bus_id; 90 uint8_t bus_type[6]; 91 91 } __attribute__ ((packed)); 92 92 93 93 struct __io_apic_entry { 94 __u8type;95 __u8io_apic_id;96 __u8io_apic_version;97 __u8io_apic_flags;98 __u32io_apic;94 uint8_t type; 95 uint8_t io_apic_id; 96 uint8_t io_apic_version; 97 uint8_t io_apic_flags; 98 uint32_t io_apic; 99 99 } __attribute__ ((packed)); 100 100 101 101 struct __io_intr_entry { 102 __u8type;103 __u8intr_type;104 __u8poel;105 __u8xxx;106 __u8src_bus_id;107 __u8src_bus_irq;108 __u8dst_io_apic_id;109 __u8dst_io_apic_pin;102 uint8_t type; 103 uint8_t intr_type; 104 uint8_t poel; 105 uint8_t xxx; 106 uint8_t src_bus_id; 107 uint8_t src_bus_irq; 108 uint8_t dst_io_apic_id; 109 uint8_t dst_io_apic_pin; 110 110 } __attribute__ ((packed)); 111 111 112 112 struct __l_intr_entry { 113 __u8type;114 __u8intr_type;115 __u8poel;116 __u8xxx;117 __u8src_bus_id;118 __u8src_bus_irq;119 __u8dst_l_apic_id;120 __u8dst_l_apic_pin;113 uint8_t type; 114 uint8_t intr_type; 115 uint8_t poel; 116 uint8_t xxx; 117 uint8_t src_bus_id; 118 uint8_t src_bus_irq; 119 uint8_t dst_l_apic_id; 120 uint8_t dst_l_apic_pin; 121 121 } __attribute__ ((packed)); 122 122 -
arch/ia32/include/smp/smp.h
r991779c5 r7f1c620 44 44 bool (* cpu_enabled)(index_t i); /**< Check whether the processor of index i is enabled. */ 45 45 bool (*cpu_bootstrap)(index_t i); /**< Check whether the processor of index i is BSP. */ 46 __u8(*cpu_apic_id)(index_t i); /**< Return APIC ID of the processor of index i. */46 uint8_t (*cpu_apic_id)(index_t i); /**< Return APIC ID of the processor of index i. */ 47 47 int (*irq_to_pin)(int irq); /**< Return mapping between irq and APIC pin. */ 48 48 }; -
arch/ia32/include/types.h
r991779c5 r7f1c620 27 27 */ 28 28 29 29 /** @addtogroup ia32 30 30 * @{ 31 31 */ … … 38 38 #define NULL 0 39 39 40 typedef signed char __s8;41 typedef signed short __s16;42 typedef signed long __s32;43 typedef signed long long __s64;40 typedef signed char int8_t; 41 typedef signed short int16_t; 42 typedef signed long int32_t; 43 typedef signed long long int64_t; 44 44 45 typedef unsigned char __u8;46 typedef unsigned short __u16;47 typedef unsigned long __u32;48 typedef unsigned long long __u64;45 typedef unsigned char uint8_t; 46 typedef unsigned short uint16_t; 47 typedef unsigned long uint32_t; 48 typedef unsigned long long uint64_t; 49 49 50 typedef __u32 __address;51 typedef __u32pfn_t;50 typedef uint32_t uintptr_t; 51 typedef uint32_t pfn_t; 52 52 53 typedef __u32ipl_t;53 typedef uint32_t ipl_t; 54 54 55 typedef __u32 __native;56 typedef __s32 __snative;55 typedef uint32_t unative_t; 56 typedef int32_t native_t; 57 57 58 58 typedef struct page_specifier pte_t; … … 60 60 #endif 61 61 62 62 /** @} 63 63 */ 64 64
Note:
See TracChangeset
for help on using the changeset viewer.