Subversion Repositories HelenOS

Rev

Rev 2071 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2071 Rev 2089
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
/** @addtogroup ia32   
29
/** @addtogroup ia32   
30
 * @{
30
 * @{
31
 */
31
 */
32
/** @file
32
/** @file
33
 */
33
 */
34
 
34
 
35
#ifndef KERN_ia32_MPS_H_
35
#ifndef KERN_ia32_MPS_H_
36
#define KERN_ia32_MPS_H_
36
#define KERN_ia32_MPS_H_
37
 
37
 
38
#include <arch/types.h>
38
#include <arch/types.h>
39
#include <typedefs.h>
-
 
40
#include <synch/waitq.h>
39
#include <synch/waitq.h>
41
#include <config.h>
40
#include <config.h>
42
#include <arch/smp/smp.h>
41
#include <arch/smp/smp.h>
43
 
42
 
44
#define CT_EXT_ENTRY_TYPE       0
43
#define CT_EXT_ENTRY_TYPE       0
45
#define CT_EXT_ENTRY_LEN        1
44
#define CT_EXT_ENTRY_LEN        1
46
 
45
 
47
struct mps_fs {
46
struct mps_fs {
48
    uint32_t signature;
47
    uint32_t signature;
49
    uint32_t configuration_table;
48
    uint32_t configuration_table;
50
    uint8_t length;
49
    uint8_t length;
51
    uint8_t revision;
50
    uint8_t revision;
52
    uint8_t checksum;
51
    uint8_t checksum;
53
    uint8_t config_type;
52
    uint8_t config_type;
54
    uint8_t mpfib2;
53
    uint8_t mpfib2;
55
    uint8_t mpfib3;
54
    uint8_t mpfib3;
56
    uint8_t mpfib4;
55
    uint8_t mpfib4;
57
    uint8_t mpfib5;
56
    uint8_t mpfib5;
58
} __attribute__ ((packed));
57
} __attribute__ ((packed));
59
 
58
 
60
struct mps_ct {
59
struct mps_ct {
61
    uint32_t signature;
60
    uint32_t signature;
62
    uint16_t base_table_length;
61
    uint16_t base_table_length;
63
    uint8_t revision;
62
    uint8_t revision;
64
    uint8_t checksum;
63
    uint8_t checksum;
65
    uint8_t oem_id[8];
64
    uint8_t oem_id[8];
66
    uint8_t product_id[12];
65
    uint8_t product_id[12];
67
    uint32_t oem_table;
66
    uint32_t oem_table;
68
    uint16_t oem_table_size;
67
    uint16_t oem_table_size;
69
    uint16_t entry_count;
68
    uint16_t entry_count;
70
    uint32_t l_apic;
69
    uint32_t l_apic;
71
    uint16_t ext_table_length;
70
    uint16_t ext_table_length;
72
    uint8_t ext_table_checksum;
71
    uint8_t ext_table_checksum;
73
    uint8_t xxx;
72
    uint8_t xxx;
74
    uint8_t base_table[0];
73
    uint8_t base_table[0];
75
} __attribute__ ((packed));
74
} __attribute__ ((packed));
76
 
75
 
77
struct __processor_entry {
76
struct __processor_entry {
78
    uint8_t type;
77
    uint8_t type;
79
    uint8_t l_apic_id;
78
    uint8_t l_apic_id;
80
    uint8_t l_apic_version;
79
    uint8_t l_apic_version;
81
    uint8_t cpu_flags;
80
    uint8_t cpu_flags;
82
    uint8_t cpu_signature[4];
81
    uint8_t cpu_signature[4];
83
    uint32_t feature_flags;
82
    uint32_t feature_flags;
84
    uint32_t xxx[2];
83
    uint32_t xxx[2];
85
} __attribute__ ((packed));
84
} __attribute__ ((packed));
86
 
85
 
87
struct __bus_entry {
86
struct __bus_entry {
88
    uint8_t type;
87
    uint8_t type;
89
    uint8_t bus_id;
88
    uint8_t bus_id;
90
    uint8_t bus_type[6];
89
    uint8_t bus_type[6];
91
} __attribute__ ((packed));
90
} __attribute__ ((packed));
92
 
91
 
93
struct __io_apic_entry {
92
struct __io_apic_entry {
94
    uint8_t type;
93
    uint8_t type;
95
    uint8_t io_apic_id;
94
    uint8_t io_apic_id;
96
    uint8_t io_apic_version;
95
    uint8_t io_apic_version;
97
    uint8_t io_apic_flags;
96
    uint8_t io_apic_flags;
98
    uint32_t io_apic;
97
    uint32_t io_apic;
99
} __attribute__ ((packed));
98
} __attribute__ ((packed));
100
 
99
 
101
struct __io_intr_entry {
100
struct __io_intr_entry {
102
    uint8_t type;
101
    uint8_t type;
103
    uint8_t intr_type;
102
    uint8_t intr_type;
104
    uint8_t poel;
103
    uint8_t poel;
105
    uint8_t xxx;
104
    uint8_t xxx;
106
    uint8_t src_bus_id;
105
    uint8_t src_bus_id;
107
    uint8_t src_bus_irq;
106
    uint8_t src_bus_irq;
108
    uint8_t dst_io_apic_id;
107
    uint8_t dst_io_apic_id;
109
    uint8_t dst_io_apic_pin;
108
    uint8_t dst_io_apic_pin;
110
} __attribute__ ((packed));
109
} __attribute__ ((packed));
111
 
110
 
112
struct __l_intr_entry {
111
struct __l_intr_entry {
113
    uint8_t type;
112
    uint8_t type;
114
    uint8_t intr_type;
113
    uint8_t intr_type;
115
    uint8_t poel;
114
    uint8_t poel;
116
    uint8_t xxx;
115
    uint8_t xxx;
117
    uint8_t src_bus_id;
116
    uint8_t src_bus_id;
118
    uint8_t src_bus_irq;
117
    uint8_t src_bus_irq;
119
    uint8_t dst_l_apic_id;
118
    uint8_t dst_l_apic_id;
120
    uint8_t dst_l_apic_pin;
119
    uint8_t dst_l_apic_pin;
121
} __attribute__ ((packed));
120
} __attribute__ ((packed));
122
 
121
 
123
extern struct smp_config_operations mps_config_operations;
122
extern struct smp_config_operations mps_config_operations;
124
 
123
 
125
extern void mps_init(void);
124
extern void mps_init(void);
126
 
125
 
127
#endif
126
#endif
128
 
127
 
129
/** @}
128
/** @}
130
 */
129
 */
131
 
130