Subversion Repositories HelenOS

Rev

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

Rev 3972 Rev 4126
Line 24... Line 24...
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
 
Line 129... Line 129...
129
    apic_init();
129
    apic_init();
130
   
130
   
131
    uint8_t apic = l_apic_id();
131
    uint8_t apic = l_apic_id();
132
 
132
 
133
    for (i = 0; i < ops->cpu_count(); i++) {
133
    for (i = 0; i < ops->cpu_count(); i++) {
134
        struct descriptor *gdt_new;
134
        descriptor_t *gdt_new;
135
   
135
       
136
        /*
136
        /*
137
         * Skip processors marked unusable.
137
         * Skip processors marked unusable.
138
         */
138
         */
139
        if (!ops->cpu_enabled(i))
139
        if (!ops->cpu_enabled(i))
140
            continue;
140
            continue;
Line 157... Line 157...
157
       
157
       
158
        /* XXX Flag FRAME_LOW_4_GiB was removed temporarily,
158
        /* XXX Flag FRAME_LOW_4_GiB was removed temporarily,
159
         * it needs to be replaced by a generic fuctionality of
159
         * it needs to be replaced by a generic fuctionality of
160
         * the memory subsystem
160
         * the memory subsystem
161
         */
161
         */
162
        gdt_new = (struct descriptor *) malloc(GDT_ITEMS *
162
        gdt_new = (descriptor_t *) malloc(GDT_ITEMS *
163
            sizeof(struct descriptor), FRAME_ATOMIC);
163
            sizeof(descriptor_t), FRAME_ATOMIC);
164
        if (!gdt_new)
164
        if (!gdt_new)
165
            panic("Cannot allocate memory for GDT.");
165
            panic("Cannot allocate memory for GDT.");
166
 
166
 
167
        memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(struct descriptor));
167
        memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(descriptor_t));
168
        memsetb(&gdt_new[TSS_DES], sizeof(struct descriptor), 0);
168
        memsetb(&gdt_new[TSS_DES], sizeof(descriptor_t), 0);
169
        protected_ap_gdtr.limit = GDT_ITEMS * sizeof(struct descriptor);
169
        protected_ap_gdtr.limit = GDT_ITEMS * sizeof(descriptor_t);
170
        protected_ap_gdtr.base = KA2PA((uintptr_t) gdt_new);
170
        protected_ap_gdtr.base = KA2PA((uintptr_t) gdt_new);
171
        gdtr.base = (uintptr_t) gdt_new;
171
        gdtr.base = (uintptr_t) gdt_new;
172
 
172
 
173
        if (l_apic_send_init_ipi(ops->cpu_apic_id(i))) {
173
        if (l_apic_send_init_ipi(ops->cpu_apic_id(i))) {
174
            /*
174
            /*