/SPARTAN/trunk/arch/ia32/include/pm.h |
---|
29,10 → 29,6 |
#ifndef __PM_H__ |
#define __PM_H__ |
#include <arch/types.h> |
#include <typedefs.h> |
#include <arch/context.h> |
#define IDT_ITEMS 64 |
#define GDT_ITEMS 6 |
60,6 → 56,12 |
#define IO_MAP_BASE (104) |
#ifndef __ASM__ |
#include <arch/types.h> |
#include <typedefs.h> |
#include <arch/context.h> |
struct ptr_16_32 { |
__u16 limit; |
__u32 base; |
145,4 → 147,6 |
extern void tss_initialize(struct tss *t); |
#endif /* __ASM__ */ |
#endif |
/SPARTAN/trunk/arch/ia32/include/mm/page.h |
---|
29,15 → 29,15 |
#ifndef __ia32_PAGE_H__ |
#define __ia32_PAGE_H__ |
#include <mm/page.h> |
#include <arch/types.h> |
#include <arch/mm/frame.h> |
#include <typedefs.h> |
#define PAGE_SIZE FRAME_SIZE |
#define KA2PA(x) (((__address) (x)) - 0x80000000) |
#define PA2KA(x) (((__address) (x)) + 0x80000000) |
#ifndef __ASM__ |
# define KA2PA(x) (((__address) (x)) - 0x80000000) |
# define PA2KA(x) (((__address) (x)) + 0x80000000) |
#else |
# define KA2PA(x) ((x) - 0x80000000) |
# define PA2KA(x) ((x) + 0x80000000) |
#endif |
/* |
* Implementation of generic 4-level page table interface. |
70,6 → 70,13 |
#define SET_PTL3_FLAGS_ARCH(ptl2, i, x) |
#define SET_FRAME_FLAGS_ARCH(ptl3, i, x) set_pt_flags((pte_t *)(ptl3), (index_t)(i), (x)) |
#ifndef __ASM__ |
#include <mm/page.h> |
#include <arch/types.h> |
#include <arch/mm/frame.h> |
#include <typedefs.h> |
struct page_specifier { |
unsigned present : 1; |
unsigned writeable : 1; |
111,4 → 118,6 |
extern void page_arch_init(void); |
#endif /* __ASM__ */ |
#endif |
/SPARTAN/trunk/arch/ia32/src/pm.c |
---|
69,8 → 69,10 |
struct tss *tss_p = NULL; |
/* TODO: Does not compile correctly if it does not exist ???? */ |
int __attribute__ ((section ("K_DATA_START"))) __fake; |
/* gdtr is changed by kmp before next CPU is initialized */ |
struct ptr_16_32 real_bootstrap_gdtr __attribute__ ((section ("K_DATA_START"))) = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt - BOOT_OFFSET) }; |
struct ptr_16_32 protected_bootstrap_gdtr = { .limit = sizeof(gdt), .base = KA2PA((__address) gdt) }; |
struct ptr_16_32 gdtr = { .limit = sizeof(gdt), .base = (__address) gdt }; |
/SPARTAN/trunk/arch/ia32/src/smp/smp.c |
---|
143,7 → 143,7 |
memcpy(gdt_new, gdt, GDT_ITEMS*sizeof(struct descriptor)); |
memsetb((__address)(&gdt_new[TSS_DES]), sizeof(struct descriptor), 0); |
((struct ptr_16_32 *) PA2KA((__address) &real_bootstrap_gdtr))->base = KA2PA((__address) gdt_new); |
real_bootstrap_gdtr.base = KA2PA((__address) gdt_new); |
gdtr.base = (__address) gdt_new; |
if (l_apic_send_init_ipi(ops->cpu_apic_id(i))) { |
/SPARTAN/trunk/arch/ia32/src/smp/ap.S |
---|
50,7 → 50,7 |
xorw %ax, %ax |
movw %ax, %ds |
lgdt real_bootstrap_gdtr # initialize Global Descriptor Table register |
lgdt real_bootstrap_gdtr_boot # initialize Global Descriptor Table register |
movl %cr0, %eax |
orl $1, %eax |
/SPARTAN/trunk/arch/ia32/src/boot/boot.S |
---|
26,8 → 26,12 |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# |
#define __ASM__ |
#include <arch/boot/boot.h> |
#include <arch/boot/memmapasm.h> |
#include <arch/mm/page.h> |
#include <arch/pm.h> |
.section K_TEXT_START |
.global kernel_image_start |
53,7 → 57,7 |
call memmap_arch_init |
lgdt real_bootstrap_gdtr # initialize Global Descriptor Table register |
lgdt real_bootstrap_gdtr_boot # initialize Global Descriptor Table register |
movl %cr0, %eax |
orl $0x1, %eax |
235,3 → 239,9 |
.align 4096 |
page_directory: |
.space 4096, 0 |
.global real_bootstrap_gdtr_boot |
real_bootstrap_gdtr_boot: |
.word selector(GDT_ITEMS) |
.long KA2PA(gdt)-BOOT_OFFSET |
/SPARTAN/trunk/arch/ia32/_link.ld |
---|
58,4 → 58,5 |
_map_address = 0x80100000; |
e820table_boot = e820table - _map_address; |
e820counter_boot = e820counter - _map_address; |
real_bootstrap_gdtr = real_bootstrap_gdtr_boot + 0x80000000; |
} |