Changeset 7f1c620 in mainline for arch/ia32/include


Ignore:
Timestamp:
2006-07-04T17:17:56Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ffa3ef5
Parents:
991779c5
Message:

Replace old u?? types with respective C99 variants (e.g. uint32_t, int64_t, uintptr_t etc.).

Location:
arch/ia32/include
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/include/asm.h

    r991779c5 r7f1c620  
    4141#include <config.h>
    4242
    43 extern __u32 interrupt_handler_size;
     43extern uint32_t interrupt_handler_size;
    4444
    4545extern void paging_on(void);
     
    5050
    5151
    52 extern void asm_delay_loop(__u32 t);
    53 extern void asm_fake_loop(__u32 t);
     52extern void asm_delay_loop(uint32_t t);
     53extern void asm_fake_loop(uint32_t t);
    5454
    5555
     
    6161static inline void cpu_sleep(void) { __asm__("hlt\n"); };
    6262
    63 #define GEN_READ_REG(reg) static inline __native read_ ##reg (void) \
     63#define GEN_READ_REG(reg) static inline unative_t read_ ##reg (void) \
    6464    { \
    65         __native res; \
     65        unative_t res; \
    6666        __asm__ volatile ("movl %%" #reg ", %0" : "=r" (res) ); \
    6767        return res; \
    6868    }
    6969
    70 #define GEN_WRITE_REG(reg) static inline void write_ ##reg (__native regn) \
     70#define GEN_WRITE_REG(reg) static inline void write_ ##reg (unative_t regn) \
    7171    { \
    7272        __asm__ volatile ("movl %0, %%" #reg : : "r" (regn)); \
     
    9999 * @param val Value to write
    100100 */
    101 static inline void outb(__u16 port, __u8 val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); }
     101static inline void outb(uint16_t port, uint8_t val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); }
    102102
    103103/** Word to port
     
    108108 * @param val Value to write
    109109 */
    110 static inline void outw(__u16 port, __u16 val) { __asm__ volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) ); }
     110static inline void outw(uint16_t port, uint16_t val) { __asm__ volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) ); }
    111111
    112112/** Double word to port
     
    117117 * @param val Value to write
    118118 */
    119 static inline void outl(__u16 port, __u32 val) { __asm__ volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) ); }
     119static inline void outl(uint16_t port, uint32_t val) { __asm__ volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) ); }
    120120
    121121/** Byte from port
     
    126126 * @return Value read
    127127 */
    128 static inline __u8 inb(__u16 port) { __u8 val; __asm__ volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; }
     128static inline uint8_t inb(uint16_t port) { uint8_t val; __asm__ volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; }
    129129
    130130/** Word from port
     
    135135 * @return Value read
    136136 */
    137 static inline __u16 inw(__u16 port) { __u16 val; __asm__ volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port) ); return val; }
     137static inline uint16_t inw(uint16_t port) { uint16_t val; __asm__ volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port) ); return val; }
    138138
    139139/** Double word from port
     
    144144 * @return Value read
    145145 */
    146 static inline __u32 inl(__u16 port) { __u32 val; __asm__ volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port) ); return val; }
     146static inline uint32_t inl(uint16_t port) { uint32_t val; __asm__ volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port) ); return val; }
    147147
    148148/** Enable interrupts.
     
    220220 * The stack must start on page boundary.
    221221 */
    222 static inline __address get_stack_base(void)
    223 {
    224         __address v;
     222static inline uintptr_t get_stack_base(void)
     223{
     224        uintptr_t v;
    225225       
    226226        __asm__ volatile ("andl %%esp, %0\n" : "=r" (v) : "0" (~(STACK_SIZE-1)));
     
    229229}
    230230
    231 static inline __u64 rdtsc(void)
    232 {
    233         __u64 v;
     231static inline uint64_t rdtsc(void)
     232{
     233        uint64_t v;
    234234       
    235235        __asm__ volatile("rdtsc\n" : "=A" (v));
     
    239239
    240240/** Return current IP address */
    241 static inline __address * get_ip()
    242 {
    243         __address *ip;
     241static inline uintptr_t * get_ip()
     242{
     243        uintptr_t *ip;
    244244
    245245        __asm__ volatile (
     
    254254 * @param addr Address on a page whose TLB entry is to be invalidated.
    255255 */
    256 static inline void invlpg(__address addr)
    257 {
    258         __asm__ volatile ("invlpg %0\n" :: "m" (*(__native *)addr));
     256static inline void invlpg(uintptr_t addr)
     257{
     258        __asm__ volatile ("invlpg %0\n" :: "m" (*(unative_t *)addr));
    259259}
    260260
     
    290290 * @param sel Selector specifying descriptor of TSS segment.
    291291 */
    292 static inline void tr_load(__u16 sel)
     292static inline void tr_load(uint16_t sel)
    293293{
    294294        __asm__ volatile ("ltr %0" : : "r" (sel));
  • arch/ia32/include/atomic.h

    r991779c5 r7f1c620  
    8484#define atomic_predec(val) (atomic_postdec(val)-1)
    8585
    86 static inline __u32 test_and_set(atomic_t *val) {
    87         __u32 v;
     86static inline uint32_t test_and_set(atomic_t *val) {
     87        uint32_t v;
    8888       
    8989        __asm__ volatile (
     
    9999static inline void atomic_lock_arch(atomic_t *val)
    100100{
    101         __u32 tmp;
     101        uint32_t tmp;
    102102
    103103        preemption_disable();
  • arch/ia32/include/bios/bios.h

    r991779c5 r7f1c620  
    4040#define BIOS_EBDA_PTR   0x40e
    4141
    42 extern __address ebda;
     42extern uintptr_t ebda;
    4343
    4444extern void bios_init(void);
  • arch/ia32/include/boot/memmap.h

    r991779c5 r7f1c620  
    5959
    6060struct e820memmap_ {
    61         __u64 base_address;
    62         __u64 size;
    63         __u32 type;
     61        uint64_t base_address;
     62        uint64_t size;
     63        uint32_t type;
    6464} __attribute__ ((packed));
    6565
    6666extern struct e820memmap_ e820table[MEMMAP_E820_MAX_RECORDS];
    6767
    68 extern __u8 e820counter;
     68extern uint8_t e820counter;
    6969
    70 extern __u32 e801memorysize; /**< Size of available memory in KB. */
     70extern uint32_t e801memorysize; /**< Size of available memory in KB. */
    7171
    7272#endif
  • arch/ia32/include/byteorder.h

    r991779c5 r7f1c620  
    3737
    3838/* 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)
    4141
    4242#endif
  • arch/ia32/include/context.h

    r991779c5 r7f1c620  
    5353 */
    5454struct context {
    55         __address sp;
    56         __address pc;
    57         __u32 ebx;
    58         __u32 esi;
    59         __u32 edi;
    60         __u32 ebp;
     55        uintptr_t sp;
     56        uintptr_t pc;
     57        uint32_t ebx;
     58        uint32_t esi;
     59        uint32_t edi;
     60        uint32_t ebp;
    6161        ipl_t ipl;
    6262} __attribute__ ((packed));
  • arch/ia32/include/cpuid.h

    r991779c5 r7f1c620  
    3939
    4040struct cpu_info {
    41         __u32 cpuid_eax;
    42         __u32 cpuid_ebx;
    43         __u32 cpuid_ecx;
    44         __u32 cpuid_edx;
     41        uint32_t cpuid_eax;
     42        uint32_t cpuid_ebx;
     43        uint32_t cpuid_ecx;
     44        uint32_t cpuid_edx;
    4545} __attribute__ ((packed));
    4646
     
    5353{
    5454        struct __cpuid_extended_feature_info bits;
    55         __u32                                word;
     55        uint32_t                                word;
    5656}cpuid_extended_feature_info;
    5757
     
    6969{
    7070        struct __cpuid_feature_info bits;
    71         __u32                word       ;
     71        uint32_t                word       ;
    7272}cpuid_feature_info;
    7373
    7474
    75 static inline __u32 has_cpuid(void)
     75static inline uint32_t has_cpuid(void)
    7676{
    77         __u32 val, ret;
     77        uint32_t val, ret;
    7878       
    7979        __asm__ volatile (
     
    9898}
    9999
    100 static inline void cpuid(__u32 cmd, struct cpu_info *info)
     100static inline void cpuid(uint32_t cmd, struct cpu_info *info)
    101101{
    102102        __asm__ volatile (
  • arch/ia32/include/drivers/i8042.h

    r991779c5 r7f1c620  
    4646#define i8042_STATUS            0x64
    4747
    48 static inline void i8042_data_write(__u8 data)
     48static inline void i8042_data_write(uint8_t data)
    4949{
    5050        outb(i8042_DATA, data);
    5151}
    5252
    53 static inline __u8 i8042_data_read(void)
     53static inline uint8_t i8042_data_read(void)
    5454{
    5555        return inb(i8042_DATA);
    5656}
    5757
    58 static inline __u8 i8042_status_read(void)
     58static inline uint8_t i8042_status_read(void)
    5959{
    6060        return inb(i8042_STATUS);
    6161}
    6262
    63 static inline void i8042_command_write(__u8 command)
     63static inline void i8042_command_write(uint8_t command)
    6464{
    6565        outb(i8042_STATUS, command);
  • arch/ia32/include/drivers/i8259.h

    r991779c5 r7f1c620  
    4848
    4949extern void i8259_init(void);
    50 extern void pic_enable_irqs(__u16 irqmask);
    51 extern void pic_disable_irqs(__u16 irqmask);
     50extern void pic_enable_irqs(uint16_t irqmask);
     51extern void pic_disable_irqs(uint16_t irqmask);
    5252extern void pic_eoi(void);
    5353
  • arch/ia32/include/faddr.h

    r991779c5 r7f1c620  
    3838#include <arch/types.h>
    3939
    40 #define FADDR(fptr)             ((__address) (fptr))
     40#define FADDR(fptr)             ((uintptr_t) (fptr))
    4141
    4242#endif
  • arch/ia32/include/fpu_context.h

    r991779c5 r7f1c620  
    4646
    4747struct fpu_context {
    48         __u8 fpu[512];          /* FXSAVE & FXRSTOR storage area */
     48        uint8_t fpu[512];               /* FXSAVE & FXRSTOR storage area */
    4949};
    5050
  • arch/ia32/include/interrupt.h

    r991779c5 r7f1c620  
    7070
    7171struct istate {
    72         __u32 eax;
    73         __u32 ecx;
    74         __u32 edx;
    75         __u32 esi;
    76         __u32 edi;
    77         __u32 ebp;
    78         __u32 ebx;
     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;
    7979
    80         __u32 gs;
    81         __u32 fs;
    82         __u32 es;
    83         __u32 ds;
     80        uint32_t gs;
     81        uint32_t fs;
     82        uint32_t es;
     83        uint32_t ds;
    8484
    85         __u32 error_word;
    86         __u32 eip;
    87         __u32 cs;
    88         __u32 eflags;
    89         __u32 stack[];
     85        uint32_t error_word;
     86        uint32_t eip;
     87        uint32_t cs;
     88        uint32_t eflags;
     89        uint32_t stack[];
    9090};
    9191
     
    9696}
    9797
    98 static inline void istate_set_retaddr(istate_t *istate, __address retaddr)
     98static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr)
    9999{
    100100        istate->eip = retaddr;
    101101}
    102102
    103 static inline __native istate_get_pc(istate_t *istate)
     103static inline unative_t istate_get_pc(istate_t *istate)
    104104{
    105105        return istate->eip;
    106106}
    107107
    108 extern void (* disable_irqs_function)(__u16 irqmask);
    109 extern void (* enable_irqs_function)(__u16 irqmask);
     108extern void (* disable_irqs_function)(uint16_t irqmask);
     109extern void (* enable_irqs_function)(uint16_t irqmask);
    110110extern void (* eoi_function)(void);
    111111
     
    119119extern void tlb_shootdown_ipi(int n, istate_t *istate);
    120120
    121 extern void trap_virtual_enable_irqs(__u16 irqmask);
    122 extern void trap_virtual_disable_irqs(__u16 irqmask);
     121extern void trap_virtual_enable_irqs(uint16_t irqmask);
     122extern void trap_virtual_disable_irqs(uint16_t irqmask);
    123123extern void trap_virtual_eoi(void);
    124124
  • arch/ia32/include/memstr.h

    r991779c5 r7f1c620  
    5050static inline void * memcpy(void * dst, const void * src, size_t cnt)
    5151{
    52         __native d0, d1, d2;
     52        unative_t d0, d1, d2;
    5353
    5454        __asm__ __volatile__(
     
    6666                "1:\n"
    6767                : "=&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)
    6969                : "memory");
    7070
     
    8686static inline int memcmp(const void * src, const void * dst, size_t cnt)
    8787{
    88         __u32 d0, d1, d2;
     88        uint32_t d0, d1, d2;
    8989        int ret;
    9090       
     
    9696                "1:\n"
    9797                : "=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)
    9999        );
    100100       
     
    111111 * @param x Value to fill
    112112 */
    113 static inline void memsetw(__address dst, size_t cnt, __u16 x)
     113static inline void memsetw(uintptr_t dst, size_t cnt, uint16_t x)
    114114{
    115         __u32 d0, d1;
     115        uint32_t d0, d1;
    116116       
    117117        __asm__ __volatile__ (
     
    133133 * @param x Value to fill
    134134 */
    135 static inline void memsetb(__address dst, size_t cnt, __u8 x)
     135static inline void memsetb(uintptr_t dst, size_t cnt, uint8_t x)
    136136{
    137         __u32 d0, d1;
     137        uint32_t d0, d1;
    138138       
    139139        __asm__ __volatile__ (
  • arch/ia32/include/mm/frame.h

    r991779c5 r7f1c620  
    4545#include <arch/types.h>
    4646
    47 extern __address last_frame;
     47extern uintptr_t last_frame;
    4848
    4949extern void frame_arch_init(void);
  • arch/ia32/include/mm/page.h

    r991779c5 r7f1c620  
    4444
    4545#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)
    4848#else
    4949#       define KA2PA(x) ((x) - 0x80000000)
     
    6868#define GET_PTL2_ADDRESS_ARCH(ptl1, i)          (ptl1)
    6969#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))
    7171
    72 #define SET_PTL0_ADDRESS_ARCH(ptl0)             (write_cr3((__address) (ptl0)))
     72#define SET_PTL0_ADDRESS_ARCH(ptl0)             (write_cr3((uintptr_t) (ptl0)))
    7373#define SET_PTL1_ADDRESS_ARCH(ptl0, i, a)       (((pte_t *)(ptl0))[(i)].frame_address = (a)>>12)
    7474#define SET_PTL2_ADDRESS_ARCH(ptl1, i, a)
     
    8686#define SET_FRAME_FLAGS_ARCH(ptl3, i, x)        set_pt_flags((pte_t *)(ptl3), (index_t)(i), (x))
    8787
    88 #define PTE_VALID_ARCH(p)                       (*((__u32 *) (p)) != 0)
     88#define PTE_VALID_ARCH(p)                       (*((uint32_t *) (p)) != 0)
    8989#define PTE_PRESENT_ARCH(p)                     ((p)->present != 0)
    9090#define PTE_GET_FRAME_ARCH(p)                   ((p)->frame_address<<FRAME_WIDTH)
  • arch/ia32/include/pm.h

    r991779c5 r7f1c620  
    8686
    8787struct ptr_16_32 {
    88         __u16 limit;
    89         __u32 base;
     88        uint16_t limit;
     89        uint32_t base;
    9090} __attribute__ ((packed));
    9191typedef struct ptr_16_32 ptr_16_32_t;
     
    115115
    116116struct tss {
    117         __u16 link;
     117        uint16_t link;
    118118        unsigned : 16;
    119         __u32 esp0;
    120         __u16 ss0;
     119        uint32_t esp0;
     120        uint16_t ss0;
    121121        unsigned : 16;
    122         __u32 esp1;
    123         __u16 ss1;
     122        uint32_t esp1;
     123        uint16_t ss1;
    124124        unsigned : 16;
    125         __u32 esp2;
    126         __u16 ss2;
     125        uint32_t esp2;
     126        uint16_t ss2;
    127127        unsigned : 16;
    128         __u32 cr3;
    129         __u32 eip;
    130         __u32 eflags;
    131         __u32 eax;
    132         __u32 ecx;
    133         __u32 edx;
    134         __u32 ebx;
    135         __u32 esp;
    136         __u32 ebp;
    137         __u32 esi;
    138         __u32 edi;
    139         __u16 es;
     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;
    140140        unsigned : 16;
    141         __u16 cs;
     141        uint16_t cs;
    142142        unsigned : 16;
    143         __u16 ss;
     143        uint16_t ss;
    144144        unsigned : 16;
    145         __u16 ds;
     145        uint16_t ds;
    146146        unsigned : 16;
    147         __u16 fs;
     147        uint16_t fs;
    148148        unsigned : 16;
    149         __u16 gs;
     149        uint16_t gs;
    150150        unsigned : 16;
    151         __u16 ldtr;
     151        uint16_t ldtr;
    152152        unsigned : 16;
    153153        unsigned : 16;
    154         __u16 iomap_base;
    155         __u8 iomap[TSS_IOMAP_SIZE];
     154        uint16_t iomap_base;
     155        uint8_t iomap[TSS_IOMAP_SIZE];
    156156} __attribute__ ((packed));
    157157typedef struct tss tss_t;
     
    166166extern void pm_init(void);
    167167
    168 extern void gdt_setbase(descriptor_t *d, __address base);
    169 extern void gdt_setlimit(descriptor_t *d, __u32 limit);
     168extern void gdt_setbase(descriptor_t *d, uintptr_t base);
     169extern void gdt_setlimit(descriptor_t *d, uint32_t limit);
    170170
    171171extern void idt_init(void);
    172 extern void idt_setoffset(idescriptor_t *d, __address offset);
     172extern void idt_setoffset(idescriptor_t *d, uintptr_t offset);
    173173
    174174extern void tss_initialize(tss_t *t);
    175 extern void set_tls_desc(__address tls);
     175extern void set_tls_desc(uintptr_t tls);
    176176
    177177#endif /* __ASM__ */
  • arch/ia32/include/proc/thread.h

    r991779c5 r7f1c620  
    3939
    4040typedef struct {
    41         __native tls;
     41        unative_t tls;
    4242} thread_arch_t;
    4343
  • arch/ia32/include/smp/apic.h

    r991779c5 r7f1c620  
    106106
    107107/** 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))
    110110struct icr {
    111111        union {
    112                 __u32 lo;
     112                uint32_t lo;
    113113                struct {
    114                         __u8 vector;                    /**< Interrupt Vector. */
     114                        uint8_t vector;                 /**< Interrupt Vector. */
    115115                        unsigned delmod : 3;            /**< Delivery Mode. */
    116116                        unsigned destmod : 1;           /**< Destination Mode. */
     
    125125        };
    126126        union {
    127                 __u32 hi;
     127                uint32_t hi;
    128128                struct {
    129129                        unsigned : 24;                  /**< Reserved. */
    130                         __u8 dest;                      /**< Destination field. */
     130                        uint8_t dest;                   /**< Destination field. */
    131131                } __attribute__ ((packed));
    132132        };
     
    135135
    136136/* End Of Interrupt. */
    137 #define EOI             (0x0b0/sizeof(__u32))
     137#define EOI             (0x0b0/sizeof(uint32_t))
    138138
    139139/** Error Status Register. */
    140 #define ESR             (0x280/sizeof(__u32))
     140#define ESR             (0x280/sizeof(uint32_t))
    141141union esr {
    142         __u32 value;
    143         __u8 err_bitmap;
     142        uint32_t value;
     143        uint8_t err_bitmap;
    144144        struct {
    145145                unsigned send_checksum_error : 1;
     
    157157
    158158/* Task Priority Register */
    159 #define TPR             (0x080/sizeof(__u32))
     159#define TPR             (0x080/sizeof(uint32_t))
    160160union tpr {
    161         __u32 value;
     161        uint32_t value;
    162162        struct {
    163163                unsigned pri_sc : 4;            /**< Task Priority Sub-Class. */
     
    168168
    169169/** Spurious-Interrupt Vector Register. */
    170 #define SVR             (0x0f0/sizeof(__u32))
     170#define SVR             (0x0f0/sizeof(uint32_t))
    171171union svr {
    172         __u32 value;
    173         struct {
    174                 __u8 vector;                    /**< Spurious Vector. */
     172        uint32_t value;
     173        struct {
     174                uint8_t vector;                 /**< Spurious Vector. */
    175175                unsigned lapic_enabled : 1;     /**< APIC Software Enable/Disable. */
    176176                unsigned focus_checking : 1;    /**< Focus Processor Checking. */
     
    181181
    182182/** Time Divide Configuration Register. */
    183 #define TDCR            (0x3e0/sizeof(__u32))
     183#define TDCR            (0x3e0/sizeof(uint32_t))
    184184union tdcr {
    185         __u32 value;
     185        uint32_t value;
    186186        struct {
    187187                unsigned div_value : 4;         /**< Divide Value, bit 2 is always 0. */
     
    192192
    193193/* Initial Count Register for Timer */
    194 #define ICRT            (0x380/sizeof(__u32))
     194#define ICRT            (0x380/sizeof(uint32_t))
    195195
    196196/* Current Count Register for Timer */
    197 #define CCRT            (0x390/sizeof(__u32))
     197#define CCRT            (0x390/sizeof(uint32_t))
    198198
    199199/** LVT Timer register. */
    200 #define LVT_Tm          (0x320/sizeof(__u32))
     200#define LVT_Tm          (0x320/sizeof(uint32_t))
    201201union lvt_tm {
    202         __u32 value;
    203         struct {
    204                 __u8 vector;            /**< Local Timer Interrupt vector. */
     202        uint32_t value;
     203        struct {
     204                uint8_t vector;         /**< Local Timer Interrupt vector. */
    205205                unsigned : 4;           /**< Reserved. */
    206206                unsigned delivs : 1;    /**< Delivery status (RO). */
     
    214214
    215215/** 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))
    218218union lvt_lint {
    219         __u32 value;
    220         struct {
    221                 __u8 vector;                    /**< LINT Interrupt vector. */
     219        uint32_t value;
     220        struct {
     221                uint8_t vector;                 /**< LINT Interrupt vector. */
    222222                unsigned delmod : 3;            /**< Delivery Mode. */
    223223                unsigned : 1;                   /**< Reserved. */
     
    233233
    234234/** LVT Error register. */
    235 #define LVT_Err         (0x370/sizeof(__u32))
     235#define LVT_Err         (0x370/sizeof(uint32_t))
    236236union lvt_error {
    237         __u32 value;
    238         struct {
    239                 __u8 vector;            /**< Local Timer Interrupt vector. */
     237        uint32_t value;
     238        struct {
     239                uint8_t vector;         /**< Local Timer Interrupt vector. */
    240240                unsigned : 4;           /**< Reserved. */
    241241                unsigned delivs : 1;    /**< Delivery status (RO). */
     
    248248
    249249/** Local APIC ID Register. */
    250 #define L_APIC_ID       (0x020/sizeof(__u32))
     250#define L_APIC_ID       (0x020/sizeof(uint32_t))
    251251union l_apic_id {
    252         __u32 value;
     252        uint32_t value;
    253253        struct {
    254254                unsigned : 24;          /**< Reserved. */
    255                 __u8 apic_id;           /**< Local APIC ID. */
     255                uint8_t apic_id;                /**< Local APIC ID. */
    256256        } __attribute__ ((packed));
    257257};
     
    259259
    260260/** Local APIC Version Register */
    261 #define LAVR            (0x030/sizeof(__u32))
     261#define LAVR            (0x030/sizeof(uint32_t))
    262262#define LAVR_Mask       0xff
    263263#define is_local_apic(x)        (((x)&LAVR_Mask&0xf0)==0x1)
     
    266266
    267267/** Logical Destination Register. */
    268 #define  LDR            (0x0d0/sizeof(__u32))
     268#define  LDR            (0x0d0/sizeof(uint32_t))
    269269union ldr {
    270         __u32 value;
     270        uint32_t value;
    271271        struct {
    272272                unsigned : 24;          /**< Reserved. */
    273                 __u8 id;                /**< Logical APIC ID. */
     273                uint8_t id;             /**< Logical APIC ID. */
    274274        } __attribute__ ((packed));
    275275};
     
    277277
    278278/** Destination Format Register. */
    279 #define DFR             (0x0e0/sizeof(__u32))
     279#define DFR             (0x0e0/sizeof(uint32_t))
    280280union dfr {
    281         __u32 value;
     281        uint32_t value;
    282282        struct {
    283283                unsigned : 28;          /**< Reserved, all ones. */
     
    288288
    289289/* 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))
    292292
    293293#define IOAPICID        0x00
     
    298298/** I/O Register Select Register. */
    299299union io_regsel {
    300         __u32 value;
    301         struct {
    302                 __u8 reg_addr;          /**< APIC Register Address. */
     300        uint32_t value;
     301        struct {
     302                uint8_t reg_addr;               /**< APIC Register Address. */
    303303                unsigned : 24;          /**< Reserved. */
    304304        } __attribute__ ((packed));
     
    309309struct io_redirection_reg {
    310310        union {
    311                 __u32 lo;
     311                uint32_t lo;
    312312                struct {
    313                         __u8 intvec;                    /**< Interrupt Vector. */
     313                        uint8_t intvec;                 /**< Interrupt Vector. */
    314314                        unsigned delmod : 3;            /**< Delivery Mode. */
    315315                        unsigned destmod : 1;           /**< Destination mode. */
     
    323323        };
    324324        union {
    325                 __u32 hi;
     325                uint32_t hi;
    326326                struct {
    327327                        unsigned : 24;                  /**< Reserved. */
    328                         __u8 dest : 8;                  /**< Destination Field. */
     328                        uint8_t dest : 8;                       /**< Destination Field. */
    329329                } __attribute__ ((packed));
    330330        };
     
    336336/** IO APIC Identification Register. */
    337337union io_apic_id {
    338         __u32 value;
     338        uint32_t value;
    339339        struct {
    340340                unsigned : 24;          /**< Reserved. */
     
    345345typedef union io_apic_id io_apic_id_t;
    346346
    347 extern volatile __u32 *l_apic;
    348 extern volatile __u32 *io_apic;
    349 
    350 extern __u32 apic_id_mask;
     347extern volatile uint32_t *l_apic;
     348extern volatile uint32_t *io_apic;
     349
     350extern uint32_t apic_id_mask;
    351351
    352352extern void apic_init(void);
     
    354354extern void l_apic_init(void);
    355355extern void l_apic_eoi(void);
    356 extern int l_apic_broadcast_custom_ipi(__u8 vector);
    357 extern int l_apic_send_init_ipi(__u8 apicid);
     356extern int l_apic_broadcast_custom_ipi(uint8_t vector);
     357extern int l_apic_send_init_ipi(uint8_t apicid);
    358358extern void l_apic_debug(void);
    359 extern __u8 l_apic_id(void);
    360 
    361 extern __u32 io_apic_read(__u8 address);
    362 extern void io_apic_write(__u8 address , __u32 x);
    363 extern void io_apic_change_ioredtbl(int pin, int dest, __u8 v, int flags);
    364 extern void io_apic_disable_irqs(__u16 irqmask);
    365 extern void io_apic_enable_irqs(__u16 irqmask);
     359extern uint8_t l_apic_id(void);
     360
     361extern uint32_t io_apic_read(uint8_t address);
     362extern void io_apic_write(uint8_t address , uint32_t x);
     363extern void io_apic_change_ioredtbl(int pin, int dest, uint8_t v, int flags);
     364extern void io_apic_disable_irqs(uint16_t irqmask);
     365extern void io_apic_enable_irqs(uint16_t irqmask);
    366366
    367367#endif
  • arch/ia32/include/smp/mps.h

    r991779c5 r7f1c620  
    4646
    4747struct mps_fs {
    48         __u32 signature;
    49         __u32 configuration_table;
    50         __u8 length;
    51         __u8 revision;
    52         __u8 checksum;
    53         __u8 config_type;
    54         __u8 mpfib2;
    55         __u8 mpfib3;
    56         __u8 mpfib4;
    57         __u8 mpfib5;
     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;
    5858} __attribute__ ((packed));
    5959
    6060struct mps_ct {
    61         __u32 signature;
    62         __u16 base_table_length;
    63         __u8 revision;
    64         __u8 checksum;
    65         __u8 oem_id[8];
    66         __u8 product_id[12];
    67         __u32 oem_table;
    68         __u16 oem_table_size;
    69         __u16 entry_count;
    70         __u32 l_apic;
    71         __u16 ext_table_length;
    72         __u8 ext_table_checksum;
    73         __u8 xxx;
    74         __u8 base_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];
    7575} __attribute__ ((packed));
    7676
    7777struct __processor_entry {
    78         __u8 type;
    79         __u8 l_apic_id;
    80         __u8 l_apic_version;
    81         __u8 cpu_flags;
    82         __u8 cpu_signature[4];
    83         __u32 feature_flags;
    84         __u32 xxx[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];
    8585} __attribute__ ((packed));
    8686
    8787struct __bus_entry {
    88         __u8 type;
    89         __u8 bus_id;
    90         __u8 bus_type[6];
     88        uint8_t type;
     89        uint8_t bus_id;
     90        uint8_t bus_type[6];
    9191} __attribute__ ((packed));
    9292
    9393struct __io_apic_entry {
    94         __u8 type;
    95         __u8 io_apic_id;
    96         __u8 io_apic_version;
    97         __u8 io_apic_flags;
    98         __u32 io_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;
    9999} __attribute__ ((packed));
    100100
    101101struct __io_intr_entry {
    102         __u8 type;
    103         __u8 intr_type;
    104         __u8 poel;
    105         __u8 xxx;
    106         __u8 src_bus_id;
    107         __u8 src_bus_irq;
    108         __u8 dst_io_apic_id;
    109         __u8 dst_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;
    110110} __attribute__ ((packed));
    111111
    112112struct __l_intr_entry {
    113         __u8 type;
    114         __u8 intr_type;
    115         __u8 poel;
    116         __u8 xxx;
    117         __u8 src_bus_id;
    118         __u8 src_bus_irq;
    119         __u8 dst_l_apic_id;
    120         __u8 dst_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;
    121121} __attribute__ ((packed));
    122122
  • arch/ia32/include/smp/smp.h

    r991779c5 r7f1c620  
    4444        bool (* cpu_enabled)(index_t i);        /**< Check whether the processor of index i is enabled. */
    4545        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. */
    4747        int (*irq_to_pin)(int irq);             /**< Return mapping between irq and APIC pin. */
    4848};
  • arch/ia32/include/types.h

    r991779c5 r7f1c620  
    2727 */
    2828
    29  /** @addtogroup ia32   
     29/** @addtogroup ia32   
    3030 * @{
    3131 */
     
    3838#define NULL 0
    3939
    40 typedef signed char __s8;
    41 typedef signed short __s16;
    42 typedef signed long __s32;
    43 typedef signed long long __s64;
     40typedef signed char int8_t;
     41typedef signed short int16_t;
     42typedef signed long int32_t;
     43typedef signed long long int64_t;
    4444
    45 typedef unsigned char __u8;
    46 typedef unsigned short __u16;
    47 typedef unsigned long __u32;
    48 typedef unsigned long long __u64;
     45typedef unsigned char uint8_t;
     46typedef unsigned short uint16_t;
     47typedef unsigned long uint32_t;
     48typedef unsigned long long uint64_t;
    4949
    50 typedef __u32 __address;
    51 typedef __u32 pfn_t;
     50typedef uint32_t uintptr_t;
     51typedef uint32_t pfn_t;
    5252
    53 typedef __u32 ipl_t;
     53typedef uint32_t ipl_t;
    5454
    55 typedef __u32 __native;
    56 typedef __s32 __snative;
     55typedef uint32_t unative_t;
     56typedef int32_t native_t;
    5757
    5858typedef struct page_specifier pte_t;
     
    6060#endif
    6161
    62  /** @}
     62/** @}
    6363 */
    6464
Note: See TracChangeset for help on using the changeset viewer.