|
|
1.1 root 1: /*
2: * Copyright (c) 1994 The University of Utah and
3: * the Computer Systems Laboratory at the University of Utah (CSL).
4: * All rights reserved.
5: *
6: * Permission to use, copy, modify and distribute this software is hereby
7: * granted provided that (1) source code retains these copyright, permission,
8: * and disclaimer notices, and (2) redistributions including binaries
9: * reproduce the notices in supporting documentation, and (3) all advertising
10: * materials mentioning features or use of this software display the following
11: * acknowledgement: ``This product includes software developed by the
12: * Computer Systems Laboratory at the University of Utah.''
13: *
14: * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
15: * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
16: * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17: *
18: * CSL requests users of this software to return to [email protected] any
19: * improvements that they make and grant CSL redistribution rights.
20: *
21: * Author: Bryan Ford, University of Utah CSL
22: */
23: #ifndef _IMPS_APIC_
24: #define _IMPS_APIC_
25:
26: typedef struct ApicReg
27: {
28: unsigned r; /* the actual register */
29: unsigned p[3]; /* pad to the next 128-bit boundary */
30: } ApicReg;
31:
32: typedef struct ApicIoUnit
33: {
34: ApicReg select;
35: ApicReg window;
36: } ApicIoUnit;
37: #define APIC_IO_UNIT_ID 0x00
38: #define APIC_IO_VERSION 0x01
39: #define APIC_IO_REDIR_LOW(int_pin) (0x10+(int_pin)*2)
40: #define APIC_IO_REDIR_HIGH(int_pin) (0x11+(int_pin)*2)
41:
42: typedef struct ApicLocalUnit
43: {
44: ApicReg reserved0;
45: ApicReg reserved1;
46: ApicReg unit_id;
47: ApicReg version;
48: ApicReg reserved4;
49: ApicReg reserved5;
50: ApicReg reserved6;
51: ApicReg reserved7;
52: ApicReg task_pri;
53: ApicReg reservedb;
54: ApicReg reservedc;
55: ApicReg eoi;
56: ApicReg remote;
57: ApicReg logical_dest;
58: ApicReg dest_format;
59: ApicReg spurious_vector;
60: ApicReg isr[8];
61: ApicReg tmr[8];
62: ApicReg irr[8];
63: ApicReg reserved28[8];
64: ApicReg int_command[2];
65: ApicReg timer_vector;
66: ApicReg reserved33;
67: ApicReg reserved34;
68: ApicReg lint0_vector;
69: ApicReg lint1_vector;
70: ApicReg reserved37;
71: ApicReg init_count;
72: ApicReg cur_count;
73: ApicReg reserved3a;
74: ApicReg reserved3b;
75: ApicReg reserved3c;
76: ApicReg reserved3d;
77: ApicReg divider_config;
78: ApicReg reserved3f;
79: } ApicLocalUnit;
80:
81:
82: /* Address at which the local unit is mapped in kernel virtual memory.
83: Must be constant. */
84: #define APIC_LOCAL_VA 0xc1000000
85:
86: #define apic_local_unit (*((volatile ApicLocalUnit*)APIC_LOCAL_VA))
87:
88:
89: /* Set or clear a bit in a 255-bit APIC mask register.
90: These registers are spread through eight 32-bit registers. */
91: #define APIC_SET_MASK_BIT(reg, bit) \
92: ((reg)[(bit) >> 5].r |= 1 << ((bit) & 0x1f))
93: #define APIC_CLEAR_MASK_BIT(reg, bit) \
94: ((reg)[(bit) >> 5].r &= ~(1 << ((bit) & 0x1f)))
95:
96: #endif _IMPS_APIC_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.