Changeset 8f2153b in mainline


Ignore:
Timestamp:
2005-09-05T12:41:45Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b492b5
Parents:
2c55af3
Message:

Backported AMD64 linker and boot changes back to IA32.

Location:
arch/ia32
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/_link.ld

    r2c55af3 r8f2153b  
    5959        e820table_boot = e820table - _map_address;
    6060        e820counter_boot = e820counter - _map_address;
     61        real_bootstrap_gdtr = real_bootstrap_gdtr_boot + 0x80000000;
    6162}
  • arch/ia32/include/mm/page.h

    r2c55af3 r8f2153b  
    3030#define __ia32_PAGE_H__
    3131
    32 #include <mm/page.h>
    33 #include <arch/types.h>
    34 #include <arch/mm/frame.h>
    35 #include <typedefs.h>
    36 
    3732#define PAGE_SIZE       FRAME_SIZE
    3833
    39 #define KA2PA(x)        (((__address) (x)) - 0x80000000)
    40 #define PA2KA(x)        (((__address) (x)) + 0x80000000)
     34#ifndef __ASM__
     35# define KA2PA(x)       (((__address) (x)) - 0x80000000)
     36# define PA2KA(x)       (((__address) (x)) + 0x80000000)
     37#else
     38# define KA2PA(x)       ((x) - 0x80000000)
     39# define PA2KA(x)       ((x) + 0x80000000)
     40#endif
    4141
    4242/*
     
    7070#define SET_PTL3_FLAGS_ARCH(ptl2, i, x)
    7171#define SET_FRAME_FLAGS_ARCH(ptl3, i, x)        set_pt_flags((pte_t *)(ptl3), (index_t)(i), (x))
     72
     73#ifndef __ASM__
     74
     75#include <mm/page.h>
     76#include <arch/types.h>
     77#include <arch/mm/frame.h>
     78#include <typedefs.h>
    7279
    7380struct page_specifier {
     
    112119extern void page_arch_init(void);
    113120
     121#endif /* __ASM__ */
     122
    114123#endif
  • arch/ia32/include/pm.h

    r2c55af3 r8f2153b  
    3030#define __PM_H__
    3131
    32 #include <arch/types.h>
    33 #include <typedefs.h>
    34 #include <arch/context.h>
    35 
    3632#define IDT_ITEMS 64
    3733#define GDT_ITEMS 6
     
    6056
    6157#define IO_MAP_BASE     (104)
     58
     59#ifndef __ASM__
     60
     61#include <arch/types.h>
     62#include <typedefs.h>
     63#include <arch/context.h>
    6264
    6365struct ptr_16_32 {
     
    146148extern void tss_initialize(struct tss *t);
    147149
     150#endif /* __ASM__ */
     151
    148152#endif
  • arch/ia32/src/boot/boot.S

    r2c55af3 r8f2153b  
    2727#
    2828
     29#define __ASM__
     30       
    2931#include <arch/boot/boot.h>
    3032#include <arch/boot/memmapasm.h>
     33#include <arch/mm/page.h>
     34#include <arch/pm.h>
    3135
    3236.section K_TEXT_START
     
    5458        call memmap_arch_init
    5559       
    56         lgdt real_bootstrap_gdtr                                # initialize Global Descriptor Table register
     60        lgdt real_bootstrap_gdtr_boot           # initialize Global Descriptor Table register
    5761       
    5862        movl %cr0, %eax
     
    236240page_directory:
    237241        .space 4096, 0
     242
     243.global real_bootstrap_gdtr_boot
     244real_bootstrap_gdtr_boot:
     245        .word selector(GDT_ITEMS)
     246        .long KA2PA(gdt)-BOOT_OFFSET
     247       
  • arch/ia32/src/pm.c

    r2c55af3 r8f2153b  
    7070struct tss *tss_p = NULL;
    7171
     72/* TODO: Does not compile correctly if it does not exist ???? */
     73int __attribute__ ((section ("K_DATA_START"))) __fake;
     74
    7275/* gdtr is changed by kmp before next CPU is initialized */
    73 struct ptr_16_32 real_bootstrap_gdtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt - BOOT_OFFSET) };
    7476struct ptr_16_32 protected_bootstrap_gdtr = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt) };
    7577struct ptr_16_32 gdtr = { .limit = sizeof(gdt), .base = (__address) gdt };
  • arch/ia32/src/smp/ap.S

    r2c55af3 r8f2153b  
    5151        movw %ax, %ds
    5252
    53         lgdt real_bootstrap_gdtr        # initialize Global Descriptor Table register
     53        lgdt real_bootstrap_gdtr_boot   # initialize Global Descriptor Table register
    5454       
    5555        movl %cr0, %eax
  • arch/ia32/src/smp/smp.c

    r2c55af3 r8f2153b  
    144144                memcpy(gdt_new, gdt, GDT_ITEMS*sizeof(struct descriptor));
    145145                memsetb((__address)(&gdt_new[TSS_DES]), sizeof(struct descriptor), 0);
    146                 ((struct ptr_16_32 *) PA2KA((__address) &real_bootstrap_gdtr))->base = KA2PA((__address) gdt_new);
     146                real_bootstrap_gdtr.base = KA2PA((__address) gdt_new);
    147147                gdtr.base = (__address) gdt_new;
    148148
Note: See TracChangeset for help on using the changeset viewer.