Subversion Repositories HelenOS

Rev

Rev 3022 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3022 Rev 4537
Line 84... Line 84...
84
unsigned int l_intr_entry_cnt = 0;
84
unsigned int l_intr_entry_cnt = 0;
85
 
85
 
86
/*
86
/*
87
 * Implementation of IA-32 SMP configuration interface.
87
 * Implementation of IA-32 SMP configuration interface.
88
 */
88
 */
89
static count_t get_cpu_count(void);
89
static size_t get_cpu_count(void);
90
static bool is_cpu_enabled(index_t i);
90
static bool is_cpu_enabled(size_t i);
91
static bool is_bsp(index_t i);
91
static bool is_bsp(size_t i);
92
static uint8_t get_cpu_apic_id(index_t i);
92
static uint8_t get_cpu_apic_id(size_t i);
93
static int mps_irq_to_pin(unsigned int irq);
93
static int mps_irq_to_pin(unsigned int irq);
94
 
94
 
95
struct smp_config_operations mps_config_operations = {
95
struct smp_config_operations mps_config_operations = {
96
    .cpu_count = get_cpu_count,
96
    .cpu_count = get_cpu_count,
97
    .cpu_enabled = is_cpu_enabled,
97
    .cpu_enabled = is_cpu_enabled,
98
    .cpu_bootstrap = is_bsp,
98
    .cpu_bootstrap = is_bsp,
99
    .cpu_apic_id = get_cpu_apic_id,
99
    .cpu_apic_id = get_cpu_apic_id,
100
    .irq_to_pin = mps_irq_to_pin
100
    .irq_to_pin = mps_irq_to_pin
101
};
101
};
102
 
102
 
103
count_t get_cpu_count(void)
103
size_t get_cpu_count(void)
104
{
104
{
105
    return processor_entry_cnt;
105
    return processor_entry_cnt;
106
}
106
}
107
 
107
 
108
bool is_cpu_enabled(index_t i)
108
bool is_cpu_enabled(size_t i)
109
{
109
{
110
    ASSERT(i < processor_entry_cnt);
110
    ASSERT(i < processor_entry_cnt);
111
    return (bool) ((processor_entries[i].cpu_flags & 0x01) == 0x01);
111
    return (bool) ((processor_entries[i].cpu_flags & 0x01) == 0x01);
112
}
112
}
113
 
113
 
114
bool is_bsp(index_t i)
114
bool is_bsp(size_t i)
115
{
115
{
116
    ASSERT(i < processor_entry_cnt);
116
    ASSERT(i < processor_entry_cnt);
117
    return (bool) ((processor_entries[i].cpu_flags & 0x02) == 0x02);
117
    return (bool) ((processor_entries[i].cpu_flags & 0x02) == 0x02);
118
}
118
}
119
 
119
 
120
uint8_t get_cpu_apic_id(index_t i)
120
uint8_t get_cpu_apic_id(size_t i)
121
{
121
{
122
    ASSERT(i < processor_entry_cnt);
122
    ASSERT(i < processor_entry_cnt);
123
    return processor_entries[i].l_apic_id;
123
    return processor_entries[i].l_apic_id;
124
}
124
}
125
 
125