Changeset 93e90c7 in mainline


Ignore:
Timestamp:
2006-01-02T22:10:11Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0132630
Parents:
95d191c
Message:

ia32 work.
Initialize LDR and DFR registers in Local APIC so that logical destination addresses work.

Location:
arch/ia32
Files:
2 edited

Legend:

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

    r95d191c r93e90c7  
    9494/** Destination masks. */
    9595#define DEST_ALL        0xff
     96
     97/** Dest format models. */
     98#define MODEL_FLAT      0xf
     99#define MODEL_CLUSTER   0x0
    96100
    97101/** Interrupt Command Register. */
     
    248252#define is_local_xapic(x)       (((x)&LAVR_Mask)==0x14)
    249253
     254/** Logical Destination Register. */
     255#define  LDR            (0x0d0/sizeof(__u32))
     256union ldr {
     257        __u32 value;
     258        struct {
     259                unsigned : 24;          /**< Reserver. */
     260                __u8 id;                /**< Logical APIC ID. */
     261        } __attribute__ ((packed));
     262};
     263typedef union ldr ldr_t;
     264
     265/** Destination Format Register. */
     266#define DFR             (0x0e0/sizeof(__u32))
     267union dfr {
     268        __u32 value;
     269        struct {
     270                unsigned : 28;          /**< Reserved, all ones. */
     271                unsigned model : 4;     /**< Model. */
     272        } __attribute__ ((packed));
     273};
     274typedef union dfr dfr_t;
     275
    250276/* IO APIC */
    251277#define IOREGSEL        (0x00/sizeof(__u32))
  • arch/ia32/src/smp/apic.c

    r95d191c r93e90c7  
    4444 * Advanced Programmable Interrupt Controller for SMP systems.
    4545 * Tested on:
    46  *      Bochs 2.0.2 - Bochs 2.2 with 2-8 CPUs
     46 *      Bochs 2.0.2 - Bochs 2.2.5 with 2-8 CPUs
    4747 *      Simics 2.0.28 - Simics 2.2.19 2-15 CPUs
    4848 *      VMware Workstation 5.5 with 2 CPUs
     
    312312        tdcr_t tdcr;
    313313        lvt_tm_t tm;
     314        ldr_t ldr;
     315        dfr_t dfr;
    314316        __u32 t1, t2;
    315317
     
    373375       
    374376        l_apic[ICRT] = t1-t2;
     377       
     378        /* Program Logical Destination Register. */
     379        ldr.value = l_apic[LDR];
     380        if (CPU->id < sizeof(CPU->id)*8)        /* size in bits */
     381                ldr.id = (1<<CPU->id);
     382        l_apic[LDR] = ldr.value;
     383       
     384        /* Program Destination Format Register for Flat mode. */
     385        dfr.value = l_apic[DFR];
     386        dfr.model = MODEL_FLAT;
     387        l_apic[DFR] = dfr.value;
    375388}
    376389
     
    471484                dlvr = DELMOD_LOWPRI;
    472485
    473        
    474486        reg.lo = io_apic_read(IOREDTBL + pin*2);
    475487        reg.hi = io_apic_read(IOREDTBL + pin*2 + 1);
    476488       
    477         reg.dest =  dest;
     489        reg.dest = dest;
    478490        reg.destmod = DESTMOD_LOGIC;
    479491        reg.trigger_mode = TRIGMOD_EDGE;
Note: See TracChangeset for help on using the changeset viewer.