Changeset b3f8fb7 in mainline for kernel/arch/ia32/include/smp/apic.h


Ignore:
Timestamp:
2007-01-28T13:25:49Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8e8c1a5
Parents:
1ba41c5
Message:

huge type system cleanup
remove cyclical type dependencies across multiple header files
many minor coding style fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/include/smp/apic.h

    r1ba41c5 rb3f8fb7  
    108108#define ICRlo           (0x300/sizeof(uint32_t))
    109109#define ICRhi           (0x310/sizeof(uint32_t))
    110 struct icr {
     110typedef struct {
    111111        union {
    112112                uint32_t lo;
     
    131131                } __attribute__ ((packed));
    132132        };
    133 } __attribute__ ((packed));
    134 typedef struct icr icr_t;
     133} __attribute__ ((packed)) icr_t;
    135134
    136135/* End Of Interrupt. */
     
    139138/** Error Status Register. */
    140139#define ESR             (0x280/sizeof(uint32_t))
    141 union esr {
     140typedef union {
    142141        uint32_t value;
    143142        uint8_t err_bitmap;
     
    153152                unsigned : 24;
    154153        } __attribute__ ((packed));
    155 };
    156 typedef union esr esr_t;
     154} esr_t;
    157155
    158156/* Task Priority Register */
    159157#define TPR             (0x080/sizeof(uint32_t))
    160 union tpr {
     158typedef union {
    161159        uint32_t value;
    162160        struct {
     
    164162                unsigned pri : 4;               /**< Task Priority. */
    165163        } __attribute__ ((packed));
    166 };
    167 typedef union tpr tpr_t;
     164} tpr_t;
    168165
    169166/** Spurious-Interrupt Vector Register. */
    170167#define SVR             (0x0f0/sizeof(uint32_t))
    171 union svr {
     168typedef union {
    172169        uint32_t value;
    173170        struct {
     
    177174                unsigned : 22;                  /**< Reserved. */
    178175        } __attribute__ ((packed));
    179 };
    180 typedef union svr svr_t;
     176} svr_t;
    181177
    182178/** Time Divide Configuration Register. */
    183179#define TDCR            (0x3e0/sizeof(uint32_t))
    184 union tdcr {
     180typedef union {
    185181        uint32_t value;
    186182        struct {
     
    188184                unsigned : 28;                  /**< Reserved. */
    189185        } __attribute__ ((packed));
    190 };
    191 typedef union tdcr tdcr_t;
     186} tdcr_t;
    192187
    193188/* Initial Count Register for Timer */
     
    199194/** LVT Timer register. */
    200195#define LVT_Tm          (0x320/sizeof(uint32_t))
    201 union lvt_tm {
     196typedef union {
    202197        uint32_t value;
    203198        struct {
     
    210205                unsigned : 14;          /**< Reserved. */
    211206        } __attribute__ ((packed));
    212 };
    213 typedef union lvt_tm lvt_tm_t;
     207} lvt_tm_t;
    214208
    215209/** LVT LINT registers. */
    216210#define LVT_LINT0       (0x350/sizeof(uint32_t))
    217211#define LVT_LINT1       (0x360/sizeof(uint32_t))
    218 union lvt_lint {
     212typedef union {
    219213        uint32_t value;
    220214        struct {
     
    229223                unsigned : 15;                  /**< Reserved. */
    230224        } __attribute__ ((packed));
    231 };
    232 typedef union lvt_lint lvt_lint_t;
     225} lvt_lint_t;
    233226
    234227/** LVT Error register. */
    235228#define LVT_Err         (0x370/sizeof(uint32_t))
    236 union lvt_error {
     229typedef union {
    237230        uint32_t value;
    238231        struct {
     
    244237                unsigned : 15;          /**< Reserved. */
    245238        } __attribute__ ((packed));
    246 };
    247 typedef union lvt_error lvt_error_t;
     239} lvt_error_t;
    248240
    249241/** Local APIC ID Register. */
    250242#define L_APIC_ID       (0x020/sizeof(uint32_t))
    251 union l_apic_id {
     243typedef union {
    252244        uint32_t value;
    253245        struct {
     
    255247                uint8_t apic_id;                /**< Local APIC ID. */
    256248        } __attribute__ ((packed));
    257 };
    258 typedef union l_apic_id l_apic_id_t;
     249} l_apic_id_t;
    259250
    260251/** Local APIC Version Register */
     
    267258/** Logical Destination Register. */
    268259#define  LDR            (0x0d0/sizeof(uint32_t))
    269 union ldr {
     260typedef union {
    270261        uint32_t value;
    271262        struct {
     
    273264                uint8_t id;             /**< Logical APIC ID. */
    274265        } __attribute__ ((packed));
    275 };
    276 typedef union ldr ldr_t;
     266} ldr_t;
    277267
    278268/** Destination Format Register. */
    279269#define DFR             (0x0e0/sizeof(uint32_t))
    280 union dfr {
     270typedef union {
    281271        uint32_t value;
    282272        struct {
     
    284274                unsigned model : 4;     /**< Model. */
    285275        } __attribute__ ((packed));
    286 };
    287 typedef union dfr dfr_t;
     276} dfr_t;
    288277
    289278/* IO APIC */
     
    297286
    298287/** I/O Register Select Register. */
    299 union io_regsel {
     288typedef union {
    300289        uint32_t value;
    301290        struct {
     
    303292                unsigned : 24;          /**< Reserved. */
    304293        } __attribute__ ((packed));
    305 };
    306 typedef union io_regsel io_regsel_t;
     294} io_regsel_t;
    307295
    308296/** I/O Redirection Register. */
    309 struct io_redirection_reg {
     297typedef struct io_redirection_reg {
    310298        union {
    311299                uint32_t lo;
     
    330318        };
    331319       
    332 } __attribute__ ((packed));
    333 typedef struct io_redirection_reg io_redirection_reg_t;
     320} __attribute__ ((packed)) io_redirection_reg_t;
    334321
    335322
    336323/** IO APIC Identification Register. */
    337 union io_apic_id {
     324typedef union {
    338325        uint32_t value;
    339326        struct {
     
    342329                unsigned : 4;           /**< Reserved. */
    343330        } __attribute__ ((packed));
    344 };
    345 typedef union io_apic_id io_apic_id_t;
     331} io_apic_id_t;
    346332
    347333extern volatile uint32_t *l_apic;
Note: See TracChangeset for help on using the changeset viewer.