Subversion Repositories HelenOS-historic

Rev

Rev 514 | Rev 532 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 514 Rev 515
Line 33... Line 33...
33
#include <cpu.h>
33
#include <cpu.h>
34
 
34
 
35
#define FIXED       (0<<0)
35
#define FIXED       (0<<0)
36
#define LOPRI       (1<<0)
36
#define LOPRI       (1<<0)
37
 
37
 
-
 
38
#define APIC_ID_COUNT   16
-
 
39
 
38
/* local APIC macros */
40
/* local APIC macros */
39
#define IPI_INIT    0
41
#define IPI_INIT    0
40
#define IPI_STARTUP 0
42
#define IPI_STARTUP 0
41
 
43
 
42
/** Delivery modes. */
44
/** Delivery modes. */
Line 83... Line 85...
83
 
85
 
84
/** Timer Modes. */
86
/** Timer Modes. */
85
#define TIMER_ONESHOT   0x0
87
#define TIMER_ONESHOT   0x0
86
#define TIMER_PERIODIC  0x1
88
#define TIMER_PERIODIC  0x1
87
 
89
 
-
 
90
/** Delivery status. */
-
 
91
#define DELIVS_IDLE 0x0
88
#define SEND_PENDING    (1<<12)
92
#define DELIVS_PENDING  0x1
-
 
93
 
-
 
94
/** Destination masks. */
-
 
95
#define DEST_ALL    0xff
89
 
96
 
90
/** Interrupt Command Register. */
97
/** Interrupt Command Register. */
91
#define ICRlo       (0x300/sizeof(__u32))
98
#define ICRlo       (0x300/sizeof(__u32))
92
#define ICRhi       (0x310/sizeof(__u32))
99
#define ICRhi       (0x310/sizeof(__u32))
93
struct icr {
100
struct icr {
Line 222... Line 229...
222
};
229
};
223
typedef union lvt_error lvt_error_t;
230
typedef union lvt_error lvt_error_t;
224
 
231
 
225
/** Local APIC ID Register. */
232
/** Local APIC ID Register. */
226
#define L_APIC_ID   (0x020/sizeof(__u32))
233
#define L_APIC_ID   (0x020/sizeof(__u32))
227
union lapic_id {
234
union l_apic_id {
228
    __u32 value;
235
    __u32 value;
229
    struct {
236
    struct {
230
        unsigned : 24;      /**< Reserved. */
237
        unsigned : 24;      /**< Reserved. */
231
        __u8 apic_id;       /**< Local APIC ID. */
238
        __u8 apic_id;       /**< Local APIC ID. */
232
    } __attribute__ ((packed));
239
    } __attribute__ ((packed));
233
};
240
};
234
typedef union lapic_id lapic_id_t;
241
typedef union l_apic_id l_apic_id_t;
235
 
242
 
236
/* Local APIC Version Register */
243
/* Local APIC Version Register */
237
#define LAVR        (0x030/sizeof(__u32))
244
#define LAVR        (0x030/sizeof(__u32))
238
#define LAVR_Mask   0xff
245
#define LAVR_Mask   0xff
239
#define is_local_apic(x)    (((x)&LAVR_Mask&0xf0)==0x1)
246
#define is_local_apic(x)    (((x)&LAVR_Mask&0xf0)==0x1)
Line 282... Line 289...
282
            __u8 dest : 8;      /**< Destination Field. */
289
            __u8 dest : 8;      /**< Destination Field. */
283
        } __attribute__ ((packed));
290
        } __attribute__ ((packed));
284
    };
291
    };
285
   
292
   
286
} __attribute__ ((packed));
293
} __attribute__ ((packed));
287
 
-
 
288
typedef struct io_redirection_reg io_redirection_reg_t;
294
typedef struct io_redirection_reg io_redirection_reg_t;
289
 
295
 
-
 
296
 
-
 
297
/** IO APIC Identification Register. */
-
 
298
union io_apic_id {
-
 
299
    __u32 value;
-
 
300
    struct {
-
 
301
        unsigned : 24;      /**< Reserved. */
-
 
302
        unsigned apic_id : 4;   /**< IO APIC ID. */
-
 
303
        unsigned : 4;       /**< Reserved. */
-
 
304
    } __attribute__ ((packed));
-
 
305
};
-
 
306
typedef union io_apic_id io_apic_id_t;
-
 
307
 
290
extern volatile __u32 *l_apic;
308
extern volatile __u32 *l_apic;
291
extern volatile __u32 *io_apic;
309
extern volatile __u32 *io_apic;
292
 
310
 
293
extern __u32 apic_id_mask;
311
extern __u32 apic_id_mask;
294
 
312