From 2ce28a4047787059f1b33f7d825d44b1a17bf4f4 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Tue, 6 Jan 2015 16:09:34 +0000 Subject: [PATCH] kernel: total globalization git-svn-id: svn://kolibrios.org@5359 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/apic.inc | 4 ++-- kernel/trunk/core/heap.inc | 4 ++-- kernel/trunk/core/memory.inc | 6 +++--- kernel/trunk/kernel.asm | 6 ++++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/kernel/trunk/core/apic.inc b/kernel/trunk/core/apic.inc index 41f9eb8364..9c996cd193 100644 --- a/kernel/trunk/core/apic.inc +++ b/kernel/trunk/core/apic.inc @@ -63,7 +63,7 @@ APIC_init: call IRQ_mask_all ; IOAPIC init - stdcall map_io_mem, [acpi_ioapic_base], 0x20, PG_SWR+PG_NOCACHE + stdcall map_io_mem, [acpi_ioapic_base], 0x20, PG_GLOBAL+PG_NOCACHE+PG_SWR mov [IOAPIC_base], eax mov eax, IOAPIC_VER @@ -127,7 +127,7 @@ LAPIC_init: cmp [LAPIC_BASE], 0 jne .done - stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_SWR+PG_NOCACHE + stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_GLOBAL+PG_NOCACHE+PG_SWR mov [LAPIC_BASE], eax mov esi, eax diff --git a/kernel/trunk/core/heap.inc b/kernel/trunk/core/heap.inc index 45b8333b1b..d6ce4afca4 100644 --- a/kernel/trunk/core/heap.inc +++ b/kernel/trunk/core/heap.inc @@ -492,7 +492,7 @@ proc kernel_alloc stdcall, size:dword jz .err mov ecx, ebx - or eax, PG_SWR + or eax, PG_GLOBAL+PG_SWR mov ebx, [lin_addr] call commit_pages @@ -506,7 +506,7 @@ proc kernel_alloc stdcall, size:dword test eax, eax jz .err - stdcall map_page, edx, eax, dword PG_SWR + stdcall map_page, edx, eax, dword (PG_GLOBAL+PG_SWR) add edx, 0x1000 dec ebx jnz @B diff --git a/kernel/trunk/core/memory.inc b/kernel/trunk/core/memory.inc index 7937600923..c8193475a2 100644 --- a/kernel/trunk/core/memory.inc +++ b/kernel/trunk/core/memory.inc @@ -477,14 +477,14 @@ proc init_LFB mov eax, [LFBAddress] mov edi, page_tabs + (LFB_BASE shr 10) - or eax, PG_UWR + or eax, PG_GLOBAL+PG_UWR + and eax, [pte_valid_mask] mov ecx, [pg_count] cld @@: stosd add eax, 0x1000 - dec ecx - jnz @B + loop @B mov dword [LFBAddress], LFB_BASE mov eax, cr3 ;flush TLB diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 03b7518252..ef88e5396c 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -351,10 +351,12 @@ high_code: mov fs, cx mov gs, bx + mov eax, PG_GLOBAL bt [cpu_caps], CAPS_PGE jnc @F - or dword [sys_proc+PROC.pdt_0+(OS_BASE shr 20)], PG_GLOBAL + or [sys_proc+PROC.pdt_0+(OS_BASE shr 20)], eax + or [pte_valid_mask], eax mov ebx, cr4 or ebx, CR4_PGE @@ -754,7 +756,7 @@ endg mov edi, OS_BASE + 8000h mov ecx, (ap_init16_size + 3) / 4 rep movsd - stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_SWR+PG_NOCACHE + stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_GLOBAL+PG_NOCACHE+PG_SWR mov [LAPIC_BASE], eax lea edi, [eax+300h] mov esi, smpt+4