Rev 1 | Rev 13 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 11 | ||
---|---|---|---|
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 __MP_H__ |
30 | #define __MP_H__ |
30 | #define __MP_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 | struct __mpfs { |
37 | struct __mpfs { |
38 | __u32 signature; |
38 | __u32 signature; |
39 | struct __mpct *configuration_table; |
39 | struct __mpct *configuration_table; |
40 | __u8 length; |
40 | __u8 length; |
41 | __u8 revision; |
41 | __u8 revision; |
42 | __u8 checksum; |
42 | __u8 checksum; |
43 | __u8 config_type; |
43 | __u8 config_type; |
44 | __u8 mpfib2; |
44 | __u8 mpfib2; |
45 | __u8 mpfib3; |
45 | __u8 mpfib3; |
46 | __u8 mpfib4; |
46 | __u8 mpfib4; |
47 | __u8 mpfib5; |
47 | __u8 mpfib5; |
48 | } __attribute__ ((packed)); |
48 | } __attribute__ ((packed)); |
49 | 49 | ||
50 | struct __mpct { |
50 | struct __mpct { |
51 | __u32 signature; |
51 | __u32 signature; |
52 | __u16 base_table_length; |
52 | __u16 base_table_length; |
53 | __u8 revision; |
53 | __u8 revision; |
54 | __u8 checksum; |
54 | __u8 checksum; |
55 | __u8 oem_id[8]; |
55 | __u8 oem_id[8]; |
56 | __u8 product_id[12]; |
56 | __u8 product_id[12]; |
57 | __u8 *oem_table; |
57 | __u8 *oem_table; |
58 | __u16 oem_table_size; |
58 | __u16 oem_table_size; |
59 | __u16 entry_count; |
59 | __u16 entry_count; |
60 | __u32 *l_apic; |
60 | __u32 *l_apic; |
61 | __u16 ext_table_length; |
61 | __u16 ext_table_length; |
62 | __u8 ext_table_checksum; |
62 | __u8 ext_table_checksum; |
63 | __u8 xxx; |
63 | __u8 xxx; |
64 | __u8 base_table[0]; |
64 | __u8 base_table[0]; |
65 | } __attribute__ ((packed)); |
65 | } __attribute__ ((packed)); |
66 | 66 | ||
67 | struct __processor_entry { |
67 | struct __processor_entry { |
68 | __u8 type; |
68 | __u8 type; |
69 | __u8 l_apic_id; |
69 | __u8 l_apic_id; |
70 | __u8 l_apic_version; |
70 | __u8 l_apic_version; |
71 | __u8 cpu_flags; |
71 | __u8 cpu_flags; |
72 | __u8 cpu_signature[4]; |
72 | __u8 cpu_signature[4]; |
73 | __u32 feature_flags; |
73 | __u32 feature_flags; |
74 | __u32 xxx[2]; |
74 | __u32 xxx[2]; |
75 | } __attribute__ ((packed)); |
75 | } __attribute__ ((packed)); |
76 | 76 | ||
77 | struct __bus_entry { |
77 | struct __bus_entry { |
78 | __u8 type; |
78 | __u8 type; |
79 | __u8 bus_id; |
79 | __u8 bus_id; |
80 | __u8 bus_type[6]; |
80 | __u8 bus_type[6]; |
81 | } __attribute__ ((packed)); |
81 | } __attribute__ ((packed)); |
82 | 82 | ||
83 | struct __io_apic_entry { |
83 | struct __io_apic_entry { |
84 | __u8 type; |
84 | __u8 type; |
85 | __u8 io_apic_id; |
85 | __u8 io_apic_id; |
86 | __u8 io_apic_version; |
86 | __u8 io_apic_version; |
87 | __u8 io_apic_flags; |
87 | __u8 io_apic_flags; |
88 | __u32 *io_apic; |
88 | __u32 *io_apic; |
89 | } __attribute__ ((packed)); |
89 | } __attribute__ ((packed)); |
90 | 90 | ||
91 | struct __io_intr_entry { |
91 | struct __io_intr_entry { |
92 | __u8 type; |
92 | __u8 type; |
93 | __u8 intr_type; |
93 | __u8 intr_type; |
94 | __u8 poel; |
94 | __u8 poel; |
95 | __u8 xxx; |
95 | __u8 xxx; |
96 | __u8 src_bus_id; |
96 | __u8 src_bus_id; |
97 | __u8 src_bus_irq; |
97 | __u8 src_bus_irq; |
98 | __u8 dst_io_apic_id; |
98 | __u8 dst_io_apic_id; |
99 | __u8 dst_io_apic_pin; |
99 | __u8 dst_io_apic_pin; |
100 | } __attribute__ ((packed)); |
100 | } __attribute__ ((packed)); |
101 | 101 | ||
102 | struct __l_intr_entry { |
102 | struct __l_intr_entry { |
103 | __u8 type; |
103 | __u8 type; |
104 | __u8 intr_type; |
104 | __u8 intr_type; |
105 | __u8 poel; |
105 | __u8 poel; |
106 | __u8 xxx; |
106 | __u8 xxx; |
107 | __u8 src_bus_id; |
107 | __u8 src_bus_id; |
108 | __u8 src_bus_irq; |
108 | __u8 src_bus_irq; |
109 | __u8 dst_l_apic_id; |
109 | __u8 dst_l_apic_id; |
110 | __u8 dst_l_apic_pin; |
110 | __u8 dst_l_apic_pin; |
111 | } __attribute__ ((packed)); |
111 | } __attribute__ ((packed)); |
112 | 112 | ||
113 | 113 | ||
114 | extern waitq_t ap_completion_wq; |
114 | extern waitq_t ap_completion_wq; |
115 | extern waitq_t kmp_completion_wq; |
115 | extern waitq_t kmp_completion_wq; |
116 | 116 | ||
117 | extern int mp_irq_to_pin(int irq); |
117 | extern int mp_irq_to_pin(int irq); |
118 | 118 | ||
119 | extern void mp_init(void); |
119 | extern void mp_init(void); |
120 | extern void kmp(void *arg); |
120 | extern void kmp(void *arg); |
121 | 121 | ||
122 | #endif |
122 | #endif |
123 | 123 |