Rev 13 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 13 | Rev 34 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (C) 2001-2004 Jakub Jermar |
2 | * Copyright (C) 2001-2004 Jakub Jermar |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
7 | * are met: |
8 | * |
8 | * |
9 | * - Redistributions of source code must retain the above copyright |
9 | * - Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * - Redistributions in binary form must reproduce the above copyright |
11 | * - Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
13 | * documentation and/or other materials provided with the distribution. |
14 | * - The name of the author may not be used to endorse or promote products |
14 | * - The name of the author may not be used to endorse or promote products |
15 | * derived from this software without specific prior written permission. |
15 | * derived from this software without specific prior written permission. |
16 | * |
16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | #ifndef __MP_H__ |
29 | #ifndef __MPS_H__ |
30 | #define __MP_H__ |
30 | #define __MPS_H__ |
31 | 31 | ||
32 | #include <arch/types.h> |
32 | #include <arch/types.h> |
33 | #include <typedefs.h> |
33 | #include <typedefs.h> |
34 | #include <synch/waitq.h> |
34 | #include <synch/waitq.h> |
35 | #include <config.h> |
35 | #include <config.h> |
36 | 36 | ||
37 | #define CT_EXT_ENTRY_TYPE 0 |
37 | #define CT_EXT_ENTRY_TYPE 0 |
38 | #define CT_EXT_ENTRY_LEN 1 |
38 | #define CT_EXT_ENTRY_LEN 1 |
39 | 39 | ||
40 | struct __mpfs { |
40 | struct mps_fs { |
41 | __u32 signature; |
41 | __u32 signature; |
42 | struct __mpct *configuration_table; |
42 | struct mps_ct *configuration_table; |
43 | __u8 length; |
43 | __u8 length; |
44 | __u8 revision; |
44 | __u8 revision; |
45 | __u8 checksum; |
45 | __u8 checksum; |
46 | __u8 config_type; |
46 | __u8 config_type; |
47 | __u8 mpfib2; |
47 | __u8 mpfib2; |
48 | __u8 mpfib3; |
48 | __u8 mpfib3; |
49 | __u8 mpfib4; |
49 | __u8 mpfib4; |
50 | __u8 mpfib5; |
50 | __u8 mpfib5; |
51 | } __attribute__ ((packed)); |
51 | } __attribute__ ((packed)); |
52 | 52 | ||
53 | struct __mpct { |
53 | struct mps_ct { |
54 | __u32 signature; |
54 | __u32 signature; |
55 | __u16 base_table_length; |
55 | __u16 base_table_length; |
56 | __u8 revision; |
56 | __u8 revision; |
57 | __u8 checksum; |
57 | __u8 checksum; |
58 | __u8 oem_id[8]; |
58 | __u8 oem_id[8]; |
59 | __u8 product_id[12]; |
59 | __u8 product_id[12]; |
60 | __u8 *oem_table; |
60 | __u8 *oem_table; |
61 | __u16 oem_table_size; |
61 | __u16 oem_table_size; |
62 | __u16 entry_count; |
62 | __u16 entry_count; |
63 | __u32 *l_apic; |
63 | __u32 *l_apic; |
64 | __u16 ext_table_length; |
64 | __u16 ext_table_length; |
65 | __u8 ext_table_checksum; |
65 | __u8 ext_table_checksum; |
66 | __u8 xxx; |
66 | __u8 xxx; |
67 | __u8 base_table[0]; |
67 | __u8 base_table[0]; |
68 | } __attribute__ ((packed)); |
68 | } __attribute__ ((packed)); |
69 | 69 | ||
70 | struct __processor_entry { |
70 | struct __processor_entry { |
71 | __u8 type; |
71 | __u8 type; |
72 | __u8 l_apic_id; |
72 | __u8 l_apic_id; |
73 | __u8 l_apic_version; |
73 | __u8 l_apic_version; |
74 | __u8 cpu_flags; |
74 | __u8 cpu_flags; |
75 | __u8 cpu_signature[4]; |
75 | __u8 cpu_signature[4]; |
76 | __u32 feature_flags; |
76 | __u32 feature_flags; |
77 | __u32 xxx[2]; |
77 | __u32 xxx[2]; |
78 | } __attribute__ ((packed)); |
78 | } __attribute__ ((packed)); |
79 | 79 | ||
80 | struct __bus_entry { |
80 | struct __bus_entry { |
81 | __u8 type; |
81 | __u8 type; |
82 | __u8 bus_id; |
82 | __u8 bus_id; |
83 | __u8 bus_type[6]; |
83 | __u8 bus_type[6]; |
84 | } __attribute__ ((packed)); |
84 | } __attribute__ ((packed)); |
85 | 85 | ||
86 | struct __io_apic_entry { |
86 | struct __io_apic_entry { |
87 | __u8 type; |
87 | __u8 type; |
88 | __u8 io_apic_id; |
88 | __u8 io_apic_id; |
89 | __u8 io_apic_version; |
89 | __u8 io_apic_version; |
90 | __u8 io_apic_flags; |
90 | __u8 io_apic_flags; |
91 | __u32 *io_apic; |
91 | __u32 *io_apic; |
92 | } __attribute__ ((packed)); |
92 | } __attribute__ ((packed)); |
93 | 93 | ||
94 | struct __io_intr_entry { |
94 | struct __io_intr_entry { |
95 | __u8 type; |
95 | __u8 type; |
96 | __u8 intr_type; |
96 | __u8 intr_type; |
97 | __u8 poel; |
97 | __u8 poel; |
98 | __u8 xxx; |
98 | __u8 xxx; |
99 | __u8 src_bus_id; |
99 | __u8 src_bus_id; |
100 | __u8 src_bus_irq; |
100 | __u8 src_bus_irq; |
101 | __u8 dst_io_apic_id; |
101 | __u8 dst_io_apic_id; |
102 | __u8 dst_io_apic_pin; |
102 | __u8 dst_io_apic_pin; |
103 | } __attribute__ ((packed)); |
103 | } __attribute__ ((packed)); |
104 | 104 | ||
105 | struct __l_intr_entry { |
105 | struct __l_intr_entry { |
106 | __u8 type; |
106 | __u8 type; |
107 | __u8 intr_type; |
107 | __u8 intr_type; |
108 | __u8 poel; |
108 | __u8 poel; |
109 | __u8 xxx; |
109 | __u8 xxx; |
110 | __u8 src_bus_id; |
110 | __u8 src_bus_id; |
111 | __u8 src_bus_irq; |
111 | __u8 src_bus_irq; |
112 | __u8 dst_l_apic_id; |
112 | __u8 dst_l_apic_id; |
113 | __u8 dst_l_apic_pin; |
113 | __u8 dst_l_apic_pin; |
114 | } __attribute__ ((packed)); |
114 | } __attribute__ ((packed)); |
115 | 115 | ||
116 | 116 | ||
117 | extern waitq_t ap_completion_wq; |
117 | extern waitq_t ap_completion_wq; |
118 | extern waitq_t kmp_completion_wq; |
118 | extern waitq_t kmp_completion_wq; |
119 | 119 | ||
120 | extern int mp_irq_to_pin(int irq); |
120 | extern int mps_irq_to_pin(int irq); |
121 | 121 | ||
122 | extern void mp_init(void); |
122 | extern void mps_init(void); |
123 | extern void kmp(void *arg); |
123 | extern void kmp(void *arg); |
124 | 124 | ||
125 | #endif |
125 | #endif |
126 | 126 |