Commit fdd56e2b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] visws: boot changes

Patch from Andrey Panin <pazke@orbita1.ru>

This simple patch adds some additional code into head.S.

On visws bootup cpu starts in protected mode (so we don't need
setup.S), but setting up pagetables and gdt is required before
running rest of head.S.
parent 1a820802
...@@ -37,12 +37,38 @@ ...@@ -37,12 +37,38 @@
#define X86_CAPABILITY CPU_PARAMS+12 #define X86_CAPABILITY CPU_PARAMS+12
#define X86_VENDOR_ID CPU_PARAMS+28 #define X86_VENDOR_ID CPU_PARAMS+28
/*
* Initialize page tables
*/
#define INIT_PAGE_TABLES \
movl $pg0 - __PAGE_OFFSET, %edi; \
/* "007" doesn't mean with license to kill, but PRESENT+RW+USER */ \
movl $007, %eax; \
2: stosl; \
add $0x1000, %eax; \
cmp $empty_zero_page - __PAGE_OFFSET, %edi; \
jne 2b;
/* /*
* swapper_pg_dir is the main page directory, address 0x00101000 * swapper_pg_dir is the main page directory, address 0x00101000
* *
* On entry, %esi points to the real-mode code as a 32-bit pointer. * On entry, %esi points to the real-mode code as a 32-bit pointer.
*/ */
ENTRY(startup_32) ENTRY(startup_32)
#ifdef CONFIG_X86_VISWS
/*
* On SGI Visual Workstations boot CPU starts in protected mode.
*/
orw %bx, %bx
jnz 1f
INIT_PAGE_TABLES
movl $swapper_pg_dir - __PAGE_OFFSET, %eax
movl %eax, %cr3
lgdt boot_gdt
1:
#endif
/* /*
* Set segments to known values * Set segments to known values
*/ */
...@@ -79,17 +105,7 @@ ENTRY(startup_32) ...@@ -79,17 +105,7 @@ ENTRY(startup_32)
jmp 3f jmp 3f
1: 1:
#endif #endif
/* INIT_PAGE_TABLES
* Initialize page tables
*/
movl $pg0-__PAGE_OFFSET,%edi /* initialize page tables */
movl $007,%eax /* "007" doesn't mean with license to kill, but
PRESENT+RW+USER */
2: stosl
add $0x1000,%eax
cmp $empty_zero_page-__PAGE_OFFSET,%edi
jne 2b
/* /*
* Enable paging * Enable paging
*/ */
...@@ -412,7 +428,7 @@ ENTRY(_stext) ...@@ -412,7 +428,7 @@ ENTRY(_stext)
/* /*
* The Global Descriptor Table contains 28 quadwords, per-CPU. * The Global Descriptor Table contains 28 quadwords, per-CPU.
*/ */
#ifdef CONFIG_SMP #if defined(CONFIG_SMP) || defined(CONFIG_X86_VISWS)
/* /*
* The boot_gdt_table must mirror the equivalent in setup.S and is * The boot_gdt_table must mirror the equivalent in setup.S and is
* used only by the trampoline for booting other CPUs * used only by the trampoline for booting other CPUs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment