summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-03-14 02:01:23 +0100
committerRichard Braun <rbraun@sceen.net>2017-03-14 02:01:23 +0100
commit3578ec83e47c757dc69af2f2876bba5218b38d68 (patch)
treeeaf52f6fbe99ef36a2e6c39a16e59714b3e7562c
parentf85ad668fafcfac5887cad39519ff8a34624a4a0 (diff)
Use the X15 namespace consistently for macros defined by autoconf
-rw-r--r--arch/x86/configfrag.ac4
-rw-r--r--arch/x86/machine/boot.c6
-rw-r--r--arch/x86/machine/param.h6
-rw-r--r--arch/x86/machine/pmap.c48
-rw-r--r--arch/x86/machine/pmap.h6
-rw-r--r--arch/x86/machine/types.h6
-rw-r--r--configure.ac6
-rw-r--r--kern/cpumap.h28
-rw-r--r--kern/kernel.c8
-rw-r--r--kern/kmem_i.h2
-rw-r--r--kern/percpu.c4
-rw-r--r--kern/percpu.h4
-rw-r--r--kern/thread.c2
-rw-r--r--kern/work.c2
-rw-r--r--kern/xcall.c2
-rw-r--r--vm/vm_page.c2
16 files changed, 68 insertions, 68 deletions
diff --git a/arch/x86/configfrag.ac b/arch/x86/configfrag.ac
index af731bff..d40a51ab 100644
--- a/arch/x86/configfrag.ac
+++ b/arch/x86/configfrag.ac
@@ -1,5 +1,5 @@
m4_define([x86_ENABLE_PAE],
- [AC_DEFINE([X86_PAE], [1], [use PAE page translation])
+ [AC_DEFINE([X15_X86_PAE], [1], [use PAE page translation])
AC_MSG_NOTICE([physical address extension enabled])])
m4_define([x86_SELECT_I386],
@@ -39,7 +39,7 @@ m4_define([x86_SELECT],
AS_IF([test x"$opt_i386" = xyes], [x86_SELECT_I386],
[test x"$opt_amd64" = xyes], [x86_SELECT_AMD64])
- AC_DEFINE_UNQUOTED([X86_MACHINE], [$machine], [machine])
+ AC_DEFINE_UNQUOTED([X15_X86_MACHINE], [$machine], [machine])
AC_MSG_NOTICE([machine type: $arch ($machine)])])
AS_CASE(["$host_cpu"],
diff --git a/arch/x86/machine/boot.c b/arch/x86/machine/boot.c
index 36eba21e..aaf3f1ea 100644
--- a/arch/x86/machine/boot.c
+++ b/arch/x86/machine/boot.c
@@ -288,10 +288,10 @@ boot_setup_paging(struct multiboot_raw_info *mbi, unsigned long eax)
static void __init
boot_show_version(void)
{
- printk(KERNEL_NAME "/" QUOTE(X86_MACHINE) " " KERNEL_VERSION
-#ifdef X86_PAE
+ printk(KERNEL_NAME "/" QUOTE(X15_X86_MACHINE) " " KERNEL_VERSION
+#ifdef X15_X86_PAE
" PAE"
-#endif /* X86_PAE */
+#endif /* X15_X86_PAE */
"\n");
}
diff --git a/arch/x86/machine/param.h b/arch/x86/machine/param.h
index 3d34fe7d..e5e0f0a8 100644
--- a/arch/x86/machine/param.h
+++ b/arch/x86/machine/param.h
@@ -160,13 +160,13 @@
#define VM_PAGE_HIGHMEM_LIMIT DECL_CONST(0x10000000000000, UL)
#else /* __LP64__ */
#define VM_PAGE_DIRECTMAP_LIMIT DECL_CONST(0x38000000, ULL)
-#ifdef X86_PAE
+#ifdef X15_X86_PAE
#define VM_PAGE_MAX_ZONES 3
#define VM_PAGE_HIGHMEM_LIMIT DECL_CONST(0x10000000000000, ULL)
-#else /* X86_PAE */
+#else /* X15_X86_PAE */
#define VM_PAGE_MAX_ZONES 3
#define VM_PAGE_HIGHMEM_LIMIT DECL_CONST(0xfffff000, UL)
-#endif /* X86_PAE */
+#endif /* X15_X86_PAE */
#endif /* __LP64__ */
/*
diff --git a/arch/x86/machine/pmap.c b/arch/x86/machine/pmap.c
index aee26078..f1f48f46 100644
--- a/arch/x86/machine/pmap.c
+++ b/arch/x86/machine/pmap.c
@@ -80,7 +80,7 @@ struct pmap_cpu_table {
};
struct pmap {
- struct pmap_cpu_table *cpu_tables[MAX_CPUS];
+ struct pmap_cpu_table *cpu_tables[X15_MAX_CPUS];
};
/*
@@ -99,11 +99,11 @@ struct pmap *kernel_pmap __read_mostly = &kernel_pmap_store;
* that using a percpu variable would actually become ugly. This array
* is rather small anyway.
*/
-static struct pmap_cpu_table kernel_pmap_cpu_tables[MAX_CPUS] __read_mostly;
+static struct pmap_cpu_table kernel_pmap_cpu_tables[X15_MAX_CPUS] __read_mostly;
struct pmap *pmap_current_ptr __percpu;
-#ifdef X86_PAE
+#ifdef X15_X86_PAE
/*
* Alignment required on page directory pointer tables.
@@ -113,10 +113,10 @@ struct pmap *pmap_current_ptr __percpu;
/*
* "Hidden" kernel root page tables for PAE mode.
*/
-static pmap_pte_t pmap_cpu_kpdpts[MAX_CPUS][PMAP_L2_PTES_PER_PT] __read_mostly
- __aligned(PMAP_PDPT_ALIGN);
+static pmap_pte_t pmap_cpu_kpdpts[X15_MAX_CPUS][PMAP_L2_PTES_PER_PT]
+ __read_mostly __aligned(PMAP_PDPT_ALIGN);
-#endif /* X86_PAE */
+#endif /* X15_X86_PAE */
/*
* Flags related to page protection.
@@ -261,7 +261,7 @@ struct pmap_update_request {
* on remote processors.
*/
struct pmap_update_request_array {
- struct pmap_update_request requests[MAX_CPUS];
+ struct pmap_update_request requests[X15_MAX_CPUS];
struct mutex lock;
};
@@ -271,10 +271,10 @@ static int pmap_do_remote_updates __read_mostly;
static struct kmem_cache pmap_cache;
-#ifdef X86_PAE
+#ifdef X15_X86_PAE
static char pmap_panic_no_pae[] __bootdata
= "pmap: PAE not supported";
-#endif /* X86_PAE */
+#endif /* X15_X86_PAE */
static char pmap_panic_inval_msg[] __bootdata
= "pmap: invalid physical address";
static char pmap_panic_directmap_msg[] __bootdata
@@ -370,17 +370,17 @@ out:
eax = 1;
cpu_cpuid(&eax, &ebx, &ecx, &edx);
-#ifdef X86_PAE
+#ifdef X15_X86_PAE
if (!(edx & CPU_FEATURE2_PAE)) {
boot_panic(pmap_panic_no_pae);
}
return (1 << PMAP_L1_SKIP);
-#else /* X86_PAE */
+#else /* X15_X86_PAE */
if (edx & CPU_FEATURE2_PSE) {
return (1 << PMAP_L1_SKIP);
}
-#endif /* X86_PAE */
+#endif /* X15_X86_PAE */
out:
return PAGE_SIZE;
@@ -402,11 +402,11 @@ pmap_boot_enable_pgext(unsigned long pgsize)
*
* See the boot module.
*/
-#ifdef X86_PAE
+#ifdef X15_X86_PAE
cpu_enable_pae();
-#else /* X86_PAE */
+#else /* X15_X86_PAE */
cpu_enable_pse();
-#endif /* X86_PAE */
+#endif /* X15_X86_PAE */
}
#endif /* __LP64__ */
@@ -429,11 +429,11 @@ pmap_setup_paging(void)
* direct physical mapping of physical memory.
*/
-#ifdef X86_PAE
+#ifdef X15_X86_PAE
root_ptp = (void *)BOOT_VTOP((uintptr_t)pmap_cpu_kpdpts[0]);
-#else /* X86_PAE */
+#else /* X15_X86_PAE */
root_ptp = biosmem_bootalloc(1);
-#endif /* X86_PAE */
+#endif /* X15_X86_PAE */
va = vm_page_trunc((uintptr_t)&_boot);
pa = va;
@@ -496,11 +496,11 @@ pmap_ap_setup_paging(void)
pmap = (void *)BOOT_VTOP((uintptr_t)&kernel_pmap_store);
cpu_table = (void *)BOOT_VTOP((uintptr_t)pmap->cpu_tables[boot_ap_id]);
-#ifdef X86_PAE
+#ifdef X15_X86_PAE
return (void *)(uint32_t)cpu_table->root_ptp_pa;
-#else /* X86_PAE */
+#else /* X15_X86_PAE */
return (void *)cpu_table->root_ptp_pa;
-#endif /* X86_PAE */
+#endif /* X15_X86_PAE */
}
/*
@@ -990,10 +990,10 @@ pmap_copy_cpu_table(unsigned int cpu)
level = PMAP_NR_LEVELS - 1;
sptp = pmap_ptp_from_pa(kernel_pmap->cpu_tables[cpu_id()]->root_ptp_pa);
-#ifdef X86_PAE
+#ifdef X15_X86_PAE
cpu_table->root_ptp_pa = BOOT_VTOP((uintptr_t)pmap_cpu_kpdpts[cpu]);
dptp = pmap_ptp_from_pa(cpu_table->root_ptp_pa);
-#else /* X86_PAE */
+#else /* X15_X86_PAE */
struct vm_page *page;
page = vm_page_alloc(0, VM_PAGE_SEL_DIRECTMAP, VM_PAGE_PMAP);
@@ -1004,7 +1004,7 @@ pmap_copy_cpu_table(unsigned int cpu)
cpu_table->root_ptp_pa = vm_page_to_pa(page);
dptp = vm_page_direct_ptr(page);
-#endif /* X86_PAE */
+#endif /* X15_X86_PAE */
pmap_copy_cpu_table_recursive(sptp, level, dptp, VM_MIN_ADDRESS);
}
diff --git a/arch/x86/machine/pmap.h b/arch/x86/machine/pmap.h
index 4fdda23f..9c76f5d8 100644
--- a/arch/x86/machine/pmap.h
+++ b/arch/x86/machine/pmap.h
@@ -67,7 +67,7 @@
#define PMAP_L2_MASK PMAP_L1_MASK
#define PMAP_L3_MASK PMAP_L1_MASK
#else /* __LP64__ */
-#ifdef X86_PAE
+#ifdef X15_X86_PAE
#define PMAP_NR_LEVELS 3
#define PMAP_L0_BITS 9
#define PMAP_L1_BITS 9
@@ -75,13 +75,13 @@
#define PMAP_VA_MASK DECL_CONST(0xffffffff, UL)
#define PMAP_PA_MASK DECL_CONST(0x000ffffffffff000, ULL)
#define PMAP_L2_MASK PMAP_PAE_L2_MASK
-#else /* X86_PAE */
+#else /* X15_X86_PAE */
#define PMAP_NR_LEVELS 2
#define PMAP_L0_BITS 10
#define PMAP_L1_BITS 10
#define PMAP_VA_MASK DECL_CONST(0xffffffff, UL)
#define PMAP_PA_MASK DECL_CONST(0xfffff000, UL)
-#endif /* X86_PAE */
+#endif /* X15_X86_PAE */
#endif /* __LP64__ */
#define PMAP_L0_SKIP 12
diff --git a/arch/x86/machine/types.h b/arch/x86/machine/types.h
index 91e31095..fa41e910 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 X86_PAE
+#ifdef X15_X86_PAE
typedef unsigned long long phys_addr_t;
-#else /* X86_PAE */
+#else /* X15_X86_PAE */
typedef unsigned long phys_addr_t;
-#endif /* X86_PAE */
+#endif /* X15_X86_PAE */
#endif /* _X86_TYPES_H */
diff --git a/configure.ac b/configure.ac
index 0b32388f..476331bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,7 +41,7 @@ AC_ARG_ENABLE([mutex-pi],
enabled for real-time mutexes)])])
AC_DEFINE([__KERNEL__], [1], [kernel code])
-AC_DEFINE_UNQUOTED([ARCH], [$arch], [arch])
+AC_DEFINE_UNQUOTED([X15_ARCH], [$arch], [arch])
m4_define([ENABLE_TEST_MODULE],
[AS_CASE(["$enable_test_module"],
@@ -55,7 +55,7 @@ m4_define([ENABLE_TEST_MODULE],
[x86_double_fault], [test_x86_double_fault=yes],
[xcall], [test_xcall=yes],
[AC_MSG_ERROR([invalid test module])])
- AC_DEFINE([RUN_TEST_MODULE], [1],
+ AC_DEFINE([X15_RUN_TEST_MODULE], [1],
[run test module instead of booting])
AC_MSG_NOTICE([test module enabled: $enable_test_module])])
@@ -79,7 +79,7 @@ AM_CONDITIONAL([TEST_X86_DOUBLE_FAULT],
AM_CONDITIONAL([TEST_XCALL],
[test x"$test_xcall" = xyes])
-AC_DEFINE_UNQUOTED([MAX_CPUS], [$opt_max_cpus],
+AC_DEFINE_UNQUOTED([X15_MAX_CPUS], [$opt_max_cpus],
[maximum number of supported processors])
AC_MSG_NOTICE([maximum number of supported processors: $opt_max_cpus])
diff --git a/kern/cpumap.h b/kern/cpumap.h
index 68a040ce..1843a99a 100644
--- a/kern/cpumap.h
+++ b/kern/cpumap.h
@@ -29,31 +29,31 @@
#include <kern/bitmap.h>
struct cpumap {
- BITMAP_DECLARE(cpus, MAX_CPUS);
+ BITMAP_DECLARE(cpus, X15_MAX_CPUS);
};
static inline void
cpumap_zero(struct cpumap *cpumap)
{
- bitmap_zero(cpumap->cpus, MAX_CPUS);
+ bitmap_zero(cpumap->cpus, X15_MAX_CPUS);
}
static inline void
cpumap_fill(struct cpumap *cpumap)
{
- bitmap_fill(cpumap->cpus, MAX_CPUS);
+ bitmap_fill(cpumap->cpus, X15_MAX_CPUS);
}
static inline void
cpumap_copy(struct cpumap *dest, const struct cpumap *src)
{
- bitmap_copy(dest->cpus, src->cpus, MAX_CPUS);
+ bitmap_copy(dest->cpus, src->cpus, X15_MAX_CPUS);
}
static inline int
cpumap_cmp(const struct cpumap *a, const struct cpumap *b)
{
- return bitmap_cmp(a->cpus, b->cpus, MAX_CPUS);
+ return bitmap_cmp(a->cpus, b->cpus, X15_MAX_CPUS);
}
static inline void
@@ -89,50 +89,50 @@ cpumap_test(const struct cpumap *cpumap, int index)
static inline void
cpumap_and(struct cpumap *a, const struct cpumap *b)
{
- bitmap_and(a->cpus, b->cpus, MAX_CPUS);
+ bitmap_and(a->cpus, b->cpus, X15_MAX_CPUS);
}
static inline void
cpumap_or(struct cpumap *a, const struct cpumap *b)
{
- bitmap_or(a->cpus, b->cpus, MAX_CPUS);
+ bitmap_or(a->cpus, b->cpus, X15_MAX_CPUS);
}
static inline void
cpumap_xor(struct cpumap *a, const struct cpumap *b)
{
- bitmap_xor(a->cpus, b->cpus, MAX_CPUS);
+ bitmap_xor(a->cpus, b->cpus, X15_MAX_CPUS);
}
static inline int
cpumap_find_next(const struct cpumap *cpumap, int index)
{
- return bitmap_find_next(cpumap->cpus, MAX_CPUS, index);
+ return bitmap_find_next(cpumap->cpus, X15_MAX_CPUS, index);
}
static inline int
cpumap_find_first(const struct cpumap *cpumap)
{
- return bitmap_find_first(cpumap->cpus, MAX_CPUS);
+ return bitmap_find_first(cpumap->cpus, X15_MAX_CPUS);
}
static inline int
cpumap_find_next_zero(const struct cpumap *cpumap, int index)
{
- return bitmap_find_next_zero(cpumap->cpus, MAX_CPUS, index);
+ return bitmap_find_next_zero(cpumap->cpus, X15_MAX_CPUS, index);
}
static inline int
cpumap_find_first_zero(const struct cpumap *cpumap)
{
- return bitmap_find_first_zero(cpumap->cpus, MAX_CPUS);
+ return bitmap_find_first_zero(cpumap->cpus, X15_MAX_CPUS);
}
#define cpumap_for_each(cpumap, index) \
- bitmap_for_each((cpumap)->cpus, MAX_CPUS, index)
+ bitmap_for_each((cpumap)->cpus, X15_MAX_CPUS, index)
#define cpumap_for_each_zero(cpumap, index) \
- bitmap_for_each_zero((cpumap)->cpus, MAX_CPUS, index)
+ bitmap_for_each_zero((cpumap)->cpus, X15_MAX_CPUS, index)
/*
* Initialize the cpumap module.
diff --git a/kern/kernel.c b/kern/kernel.c
index cd3d3e3b..33f3e6b0 100644
--- a/kern/kernel.c
+++ b/kern/kernel.c
@@ -30,9 +30,9 @@
#include <machine/cpu.h>
#include <vm/vm_page.h>
-#ifdef RUN_TEST_MODULE
+#ifdef X15_RUN_TEST_MODULE
#include <test/test.h>
-#endif /* RUN_TEST_MODULE */
+#endif /* X15_RUN_TEST_MODULE */
void __init
kernel_main(void)
@@ -51,9 +51,9 @@ kernel_main(void)
sref_setup();
vm_page_info();
-#ifdef RUN_TEST_MODULE
+#ifdef X15_RUN_TEST_MODULE
test_setup();
-#endif /* RUN_TEST_MODULE */
+#endif /* X15_RUN_TEST_MODULE */
/*
* Enabling application processors is done late in the boot process for
diff --git a/kern/kmem_i.h b/kern/kmem_i.h
index 01277f49..f3ad8228 100644
--- a/kern/kmem_i.h
+++ b/kern/kmem_i.h
@@ -169,7 +169,7 @@ struct kmem_slab {
*/
struct kmem_cache {
/* CPU pool layer */
- struct kmem_cpu_pool cpu_pools[MAX_CPUS];
+ struct kmem_cpu_pool cpu_pools[X15_MAX_CPUS];
struct kmem_cpu_pool_type *cpu_pool_type;
/* Slab layer */
diff --git a/kern/percpu.c b/kern/percpu.c
index b57788ed..6e0c77d0 100644
--- a/kern/percpu.c
+++ b/kern/percpu.c
@@ -31,7 +31,7 @@
#include <vm/vm_kmem.h>
#include <vm/vm_page.h>
-void *percpu_areas[MAX_CPUS] __read_mostly;
+void *percpu_areas[X15_MAX_CPUS] __read_mostly;
static void *percpu_area_content __initdata;
static size_t percpu_area_size __initdata;
@@ -50,7 +50,7 @@ percpu_setup(void)
unsigned int order;
percpu_area_size = &_epercpu - &_percpu;
- printk("percpu: max_cpus: %u, section size: %zuk\n", MAX_CPUS,
+ printk("percpu: max_cpus: %u, section size: %zuk\n", X15_MAX_CPUS,
percpu_area_size >> 10);
assert(vm_page_aligned(percpu_area_size));
diff --git a/kern/percpu.h b/kern/percpu.h
index 456131a0..73867472 100644
--- a/kern/percpu.h
+++ b/kern/percpu.h
@@ -84,10 +84,10 @@ extern char _epercpu;
static inline void *
percpu_area(unsigned int cpu)
{
- extern void *percpu_areas[MAX_CPUS];
+ extern void *percpu_areas[X15_MAX_CPUS];
void *area;
- assert(cpu < MAX_CPUS);
+ assert(cpu < X15_MAX_CPUS);
area = percpu_areas[cpu];
assert(area != NULL);
return area;
diff --git a/kern/thread.c b/kern/thread.c
index 8ccf628d..81f6594a 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -280,7 +280,7 @@ static struct thread_runq thread_runq __percpu;
* Statically allocated fake threads that provide thread context to processors
* during bootstrap.
*/
-static struct thread thread_booters[MAX_CPUS] __initdata;
+static struct thread thread_booters[X15_MAX_CPUS] __initdata;
static struct kmem_cache thread_cache;
static struct kmem_cache thread_stack_cache;
diff --git a/kern/work.c b/kern/work.c
index 3ba6d2b2..f8e8e340 100644
--- a/kern/work.c
+++ b/kern/work.c
@@ -52,7 +52,7 @@
*/
#define WORK_THREADS_RATIO 4
#define WORK_THREADS_THRESHOLD 512
-#define WORK_MAX_THREADS MAX(MAX_CPUS, WORK_THREADS_THRESHOLD)
+#define WORK_MAX_THREADS MAX(X15_MAX_CPUS, WORK_THREADS_THRESHOLD)
/*
* Work pool flags.
diff --git a/kern/xcall.c b/kern/xcall.c
index 565cd20a..c36f3c48 100644
--- a/kern/xcall.c
+++ b/kern/xcall.c
@@ -49,7 +49,7 @@ struct xcall {
* between multiple cross-calls.
*/
struct xcall_cpu_data {
- struct xcall send_calls[MAX_CPUS];
+ struct xcall send_calls[X15_MAX_CPUS];
struct xcall *recv_call;
struct spinlock lock;
diff --git a/vm/vm_page.c b/vm/vm_page.c
index df20790c..cbbfd137 100644
--- a/vm/vm_page.c
+++ b/vm/vm_page.c
@@ -107,7 +107,7 @@ struct vm_page_free_list {
* Zone of contiguous memory.
*/
struct vm_page_zone {
- struct vm_page_cpu_pool cpu_pools[MAX_CPUS];
+ struct vm_page_cpu_pool cpu_pools[X15_MAX_CPUS];
phys_addr_t start;
phys_addr_t end;