summaryrefslogtreecommitdiff
path: root/arch/x86/machine
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/machine')
-rw-r--r--arch/x86/machine/boot.c13
-rw-r--r--arch/x86/machine/config.h26
-rw-r--r--arch/x86/machine/param.h6
-rw-r--r--arch/x86/machine/pmap.c20
-rw-r--r--arch/x86/machine/pmap.h18
-rw-r--r--arch/x86/machine/types.h6
6 files changed, 63 insertions, 26 deletions
diff --git a/arch/x86/machine/boot.c b/arch/x86/machine/boot.c
index 27b07b29..de0700a1 100644
--- a/arch/x86/machine/boot.c
+++ b/arch/x86/machine/boot.c
@@ -47,6 +47,7 @@
#include <kern/kernel.h>
#include <kern/panic.h>
#include <kern/param.h>
+#include <kern/printk.h>
#include <lib/stddef.h>
#include <lib/stdint.h>
#include <lib/string.h>
@@ -135,6 +136,16 @@ boot_setup_paging(const struct multiboot_raw_info *mbi, unsigned long eax)
return pmap_setup_paging();
}
+static void __init
+boot_show_version(void)
+{
+ printk(KERNEL_NAME "/" QUOTE(X86_MACHINE) " " KERNEL_VERSION
+#ifdef X86_PAE
+ " PAE"
+#endif /* X86_PAE */
+ "\n");
+}
+
static void * __init
boot_save_memory(uint32_t addr, size_t size)
{
@@ -255,7 +266,7 @@ boot_main(void)
cpu_setup();
pmap_bootstrap();
vga_setup();
- kernel_show_banner();
+ boot_show_version();
cpu_check(cpu_current());
cpu_info(cpu_current());
biosmem_setup();
diff --git a/arch/x86/machine/config.h b/arch/x86/machine/config.h
new file mode 100644
index 00000000..4dd788ee
--- /dev/null
+++ b/arch/x86/machine/config.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2012 Richard Braun.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ * Architecture specific additions to the build system config.h header.
+ */
+
+/*
+ * Avoid obscure bugs due to this historical built-in macro.
+ */
+#ifdef i386
+#undef i386
+#endif
diff --git a/arch/x86/machine/param.h b/arch/x86/machine/param.h
index 814e71b8..e7241fd6 100644
--- a/arch/x86/machine/param.h
+++ b/arch/x86/machine/param.h
@@ -94,14 +94,14 @@
#define VM_PHYS_NORMAL_LIMIT DECL_CONST(0x100000000, UL)
#define VM_PHYS_HIGHMEM_LIMIT DECL_CONST(0x10000000000000, UL)
#else /* __LP64__ */
-#ifdef PAE
+#ifdef X86_PAE
#define VM_MAX_PHYS_SEG 2
#define VM_PHYS_NORMAL_LIMIT DECL_CONST(0x100000000, ULL)
#define VM_PHYS_HIGHMEM_LIMIT DECL_CONST(0x10000000000000, ULL)
-#else /* PAE */
+#else /* X86_PAE */
#define VM_MAX_PHYS_SEG 1
#define VM_PHYS_NORMAL_LIMIT DECL_CONST(0xfffff000, UL)
-#endif /* PAE */
+#endif /* X86_PAE */
#endif /* __LP64__ */
/*
diff --git a/arch/x86/machine/pmap.c b/arch/x86/machine/pmap.c
index dafa6b70..8365b8a8 100644
--- a/arch/x86/machine/pmap.c
+++ b/arch/x86/machine/pmap.c
@@ -77,13 +77,13 @@ struct pmap *kernel_pmap = &kernel_pmap_store;
unsigned long pmap_klimit;
-#ifdef PAE
+#ifdef X86_PAE
/*
* "Hidden" root page table for PAE mode.
*/
static pmap_pte_t pmap_boot_pdpt[PMAP_NR_RPTPS] __aligned(32) __initdata;
static pmap_pte_t pmap_pdpt[PMAP_NR_RPTPS] __aligned(32);
-#endif /* PAE */
+#endif /* X86_PAE */
/*
* Physical address of the page table root, used during bootstrap.
@@ -239,16 +239,16 @@ pmap_setup_paging(void)
pmap_setup_recursive_mapping(root_pt);
-#ifdef PAE
+#ifdef X86_PAE
for (i = 0; i < PMAP_NR_RPTPS; i++)
pmap_boot_pdpt[i] = ((unsigned long)root_pt + (i * PAGE_SIZE))
| PMAP_PTE_P;
pmap_boot_root_pt = pmap_boot_pdpt;
cpu_enable_pae();
-#else /* PAE */
+#else /* X86_PAE */
pmap_boot_root_pt = root_pt;
-#endif /* PAE */
+#endif /* X86_PAE */
return pmap_boot_root_pt;
}
@@ -256,9 +256,9 @@ pmap_setup_paging(void)
pmap_pte_t * __init
pmap_ap_setup_paging(void)
{
-#ifdef PAE
+#ifdef X86_PAE
cpu_enable_pae();
-#endif /* PAE */
+#endif /* X86_PAE */
return pmap_boot_root_pt;
}
@@ -308,14 +308,14 @@ pmap_bootstrap(void)
{
memcpy(pmap_pt_levels, pmap_boot_pt_levels, sizeof(pmap_pt_levels));
-#ifdef PAE
+#ifdef X86_PAE
memcpy(pmap_pdpt, pmap_boot_pdpt, sizeof(pmap_pdpt));
pmap_boot_root_pt = (void *)BOOT_VTOP((unsigned long)pmap_pdpt);
kernel_pmap->root_pt = (unsigned long)pmap_boot_root_pt;
cpu_set_cr3(kernel_pmap->root_pt);
-#else /* PAE */
+#else /* X86_PAE */
kernel_pmap->root_pt = (unsigned long)pmap_boot_root_pt;
-#endif /* PAE */
+#endif /* X86_PAE */
pmap_prot_table[VM_PROT_NONE] = 0;
pmap_prot_table[VM_PROT_READ] = 0;
diff --git a/arch/x86/machine/pmap.h b/arch/x86/machine/pmap.h
index fcd8b617..b42a0ec2 100644
--- a/arch/x86/machine/pmap.h
+++ b/arch/x86/machine/pmap.h
@@ -58,21 +58,21 @@
#define PMAP_L3_MASK PMAP_L2_MASK
#define PMAP_L4_MASK PMAP_L2_MASK
#else /* __LP64__ */
-#ifdef PAE
+#ifdef X86_PAE
#define PMAP_NR_RPTPS 4 /* Assume two levels with a 4-page root table */
#define PMAP_NR_LEVELS 2
#define PMAP_L1_BITS 9
#define PMAP_L2_BITS 11
#define PMAP_VA_MASK DECL_CONST(0xffffffff, UL)
#define PMAP_PA_MASK DECL_CONST(0x000ffffffffff000, ULL)
-#else /* PAE */
+#else /* X86_PAE */
#define PMAP_NR_RPTPS 1
#define PMAP_NR_LEVELS 2
#define PMAP_L1_BITS 10
#define PMAP_L2_BITS 10
#define PMAP_VA_MASK DECL_CONST(0xffffffff, UL)
#define PMAP_PA_MASK DECL_CONST(0xfffff000, UL)
-#endif /* PAE */
+#endif /* X86_PAE */
#endif /* __LP64__ */
#define PMAP_L1_SHIFT 12
@@ -91,11 +91,11 @@
#ifdef __LP64__
#define PMAP_PTEMAP_SIZE DECL_CONST(0x8000000000, UL)
#else /* __LP64__ */
-#ifdef PAE
+#ifdef X86_PAE
#define PMAP_PTEMAP_SIZE DECL_CONST(0x800000, UL)
-#else /* PAE */
+#else /* X86_PAE */
#define PMAP_PTEMAP_SIZE DECL_CONST(0x400000, UL)
-#endif /* PAE */
+#endif /* X86_PAE */
#endif /* __LP64__ */
#ifndef __ASSEMBLY__
@@ -103,11 +103,11 @@
#include <kern/types.h>
#include <lib/stdint.h>
-#ifdef PAE
+#ifdef X86_PAE
typedef uint64_t pmap_pte_t;
-#else /* PAE */
+#else /* X86_PAE */
typedef unsigned long pmap_pte_t;
-#endif /* PAE */
+#endif /* X86_PAE */
/*
* Physical address map.
diff --git a/arch/x86/machine/types.h b/arch/x86/machine/types.h
index 03c9723b..91e31095 100644
--- a/arch/x86/machine/types.h
+++ b/arch/x86/machine/types.h
@@ -18,10 +18,10 @@
#ifndef _X86_TYPES_H
#define _X86_TYPES_H
-#ifdef PAE
+#ifdef X86_PAE
typedef unsigned long long phys_addr_t;
-#else /* PAE */
+#else /* X86_PAE */
typedef unsigned long phys_addr_t;
-#endif /* PAE */
+#endif /* X86_PAE */
#endif /* _X86_TYPES_H */