diff options
-rw-r--r-- | arch/x86/machine/cga.c | 4 | ||||
-rw-r--r-- | arch/x86/machine/cpu.c | 6 | ||||
-rw-r--r-- | arch/x86/machine/lapic.c | 6 | ||||
-rw-r--r-- | arch/x86/machine/pmap.c | 8 | ||||
-rw-r--r-- | arch/x86/machine/strace.c | 9 | ||||
-rw-r--r-- | arch/x86/machine/trap.c | 5 | ||||
-rw-r--r-- | kern/kmem.c | 4 | ||||
-rw-r--r-- | kern/task.c | 5 | ||||
-rw-r--r-- | kern/thread.c | 8 | ||||
-rw-r--r-- | kern/work.c | 5 | ||||
-rw-r--r-- | vm/vm_kmem.c | 4 | ||||
-rw-r--r-- | vm/vm_map.c | 8 | ||||
-rw-r--r-- | vm/vm_page.c | 9 |
13 files changed, 44 insertions, 37 deletions
diff --git a/arch/x86/machine/cga.c b/arch/x86/machine/cga.c index 4dac1af2..72fec7f9 100644 --- a/arch/x86/machine/cga.c +++ b/arch/x86/machine/cga.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012 Richard Braun. + * Copyright (c) 2010-2014 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 @@ -66,7 +66,7 @@ */ #define CGA_TABULATION_SPACES 8 -static uint8_t *cga_memory; +static uint8_t *cga_memory __read_mostly; static uint16_t cga_cursor; static uint16_t diff --git a/arch/x86/machine/cpu.c b/arch/x86/machine/cpu.c index 4767789a..5cdd85ff 100644 --- a/arch/x86/machine/cpu.c +++ b/arch/x86/machine/cpu.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012, 2013 Richard Braun. + * Copyright (c) 2010-2014 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 @@ -77,7 +77,7 @@ static struct cpu cpu_array[MAX_CPUS]; * processors are present. */ static unsigned int cpu_boot_array_size __initdata; -unsigned int cpu_array_size; +unsigned int cpu_array_size __read_mostly; /* * Barrier for processor synchronization on kernel entry. @@ -87,7 +87,7 @@ static unsigned int cpu_mp_synced __initdata; /* * Interrupt descriptor table. */ -static struct cpu_gate_desc cpu_idt[CPU_IDT_SIZE] __aligned(8); +static struct cpu_gate_desc cpu_idt[CPU_IDT_SIZE] __aligned(8) __read_mostly; /* * Double fault handler, and stack for the main processor. diff --git a/arch/x86/machine/lapic.c b/arch/x86/machine/lapic.c index 10d6b40e..2e879a9c 100644 --- a/arch/x86/machine/lapic.c +++ b/arch/x86/machine/lapic.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012 Richard Braun. + * Copyright (c) 2011-2014 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 @@ -181,12 +181,12 @@ struct lapic_map { /* * Address where local APIC registers are mapped. */ -static volatile struct lapic_map *lapic_map; +static volatile struct lapic_map *lapic_map __read_mostly; /* * Base frequency of the local APIC timer. */ -static uint32_t lapic_bus_freq; +static uint32_t lapic_bus_freq __read_mostly; static uint32_t lapic_read(const volatile struct lapic_register *r) diff --git a/arch/x86/machine/pmap.c b/arch/x86/machine/pmap.c index 1790b00e..843db7e2 100644 --- a/arch/x86/machine/pmap.c +++ b/arch/x86/machine/pmap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012, 2013 Richard Braun. + * Copyright (c) 2010-2014 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 @@ -71,7 +71,7 @@ struct pmap_pt_level { /* * Table of page translation properties. */ -static struct pmap_pt_level pmap_pt_levels[] = { +static struct pmap_pt_level pmap_pt_levels[] __read_mostly = { { PMAP_L0_BITS, PMAP_L0_SHIFT, PMAP_L0_PTEMAP_BASE, PMAP_L0_PTES_PER_PTP, PMAP_L0_MASK }, { PMAP_L1_BITS, PMAP_L1_SHIFT, PMAP_L1_PTEMAP_BASE, PMAP_L1_PTES_PER_PTP, @@ -111,7 +111,7 @@ static struct pmap_tmp_mapping pmap_zero_mappings[MAX_CPUS]; static struct pmap_tmp_mapping pmap_root_ptp_mappings[MAX_CPUS]; static struct pmap kernel_pmap_store; -struct pmap *kernel_pmap = &kernel_pmap_store; +struct pmap *kernel_pmap __read_mostly = &kernel_pmap_store; /* * Reserved pages of virtual memory available for early allocation. @@ -140,7 +140,7 @@ static pmap_pte_t pmap_kpdpt[PMAP_NR_RPTPS] __aligned(PMAP_PDPT_ALIGN); * Table used to convert machine independent protection flags to architecture * specific PTE bits. */ -static pmap_pte_t pmap_prot_table[VM_PROT_ALL + 1]; +static pmap_pte_t pmap_prot_table[VM_PROT_ALL + 1] __read_mostly; /* * Maximum number of mappings for which individual TLB invalidations can be diff --git a/arch/x86/machine/strace.c b/arch/x86/machine/strace.c index 63550201..a3a8f1f2 100644 --- a/arch/x86/machine/strace.c +++ b/arch/x86/machine/strace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013 Richard Braun. + * Copyright (c) 2012-2014 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 @@ -17,6 +17,7 @@ #include <kern/init.h> #include <kern/kmem.h> +#include <kern/param.h> #include <kern/printk.h> #include <kern/stddef.h> #include <kern/string.h> @@ -33,9 +34,9 @@ #define STRACE_ADDR_FORMAT "%#010lx" #endif /* __LP64__ */ -static struct elf_sym *strace_symtab; -static struct elf_sym *strace_symtab_end; -static char *strace_strtab; +static struct elf_sym *strace_symtab __read_mostly; +static struct elf_sym *strace_symtab_end __read_mostly; +static char *strace_strtab __read_mostly; static const char * strace_lookup(unsigned long addr, unsigned long *offset, unsigned long *size) diff --git a/arch/x86/machine/trap.c b/arch/x86/machine/trap.c index 36585c25..78a62d87 100644 --- a/arch/x86/machine/trap.c +++ b/arch/x86/machine/trap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013 Richard Braun. + * Copyright (c) 2012-2014 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 @@ -23,6 +23,7 @@ #include <kern/init.h> #include <kern/macros.h> #include <kern/panic.h> +#include <kern/param.h> #include <kern/printk.h> #include <kern/thread.h> #include <machine/cpu.h> @@ -88,7 +89,7 @@ void trap_isr_lapic_spurious(void); * * The additional entry is the default entry used for unhandled traps. */ -static struct trap_handler trap_handlers[CPU_IDT_SIZE + 1]; +static struct trap_handler trap_handlers[CPU_IDT_SIZE + 1] __read_mostly; static void __init trap_handler_init(struct trap_handler *handler, int flags, trap_handler_fn_t fn) diff --git a/kern/kmem.c b/kern/kmem.c index 0a5562a1..b5293335 100644 --- a/kern/kmem.c +++ b/kern/kmem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012, 2013 Richard Braun. + * Copyright (c) 2010-2014 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 @@ -124,7 +124,7 @@ * * See struct kmem_cpu_pool_type for a description of the values. */ -static struct kmem_cpu_pool_type kmem_cpu_pool_types[] = { +static struct kmem_cpu_pool_type kmem_cpu_pool_types[] __read_mostly = { { 32768, 1, 0, NULL }, { 4096, 8, CPU_L1_SIZE, NULL }, { 256, 64, CPU_L1_SIZE, NULL }, diff --git a/kern/task.c b/kern/task.c index 6909cb32..4cc87ca7 100644 --- a/kern/task.c +++ b/kern/task.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Richard Braun. + * Copyright (c) 2012-2014 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 @@ -19,6 +19,7 @@ #include <kern/init.h> #include <kern/kmem.h> #include <kern/list.h> +#include <kern/param.h> #include <kern/spinlock.h> #include <kern/stddef.h> #include <kern/string.h> @@ -31,7 +32,7 @@ * Kernel task and storage. */ static struct task kernel_task_store; -struct task *kernel_task = &kernel_task_store; +struct task *kernel_task __read_mostly = &kernel_task_store; /* * Cache for allocated tasks. diff --git a/kern/thread.c b/kern/thread.c index 3ee8da93..c0b18cde 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013 Richard Braun. + * Copyright (c) 2012-2014 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 @@ -234,12 +234,14 @@ static struct kmem_cache thread_stack_cache; /* * Table used to quickly map policies to classes. */ -static unsigned char thread_policy_table[THREAD_NR_SCHED_POLICIES]; +static unsigned char thread_policy_table[THREAD_NR_SCHED_POLICIES] + __read_mostly; /* * Scheduling class operations. */ -static struct thread_sched_ops thread_sched_ops[THREAD_NR_SCHED_CLASSES]; +static struct thread_sched_ops thread_sched_ops[THREAD_NR_SCHED_CLASSES] + __read_mostly; /* * Map of run queues for which a processor is running. diff --git a/kern/work.c b/kern/work.c index 433f6383..2a08cee0 100644 --- a/kern/work.c +++ b/kern/work.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Richard Braun. + * Copyright (c) 2013-2014 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 @@ -23,6 +23,7 @@ #include <kern/list.h> #include <kern/mutex.h> #include <kern/panic.h> +#include <kern/param.h> #include <kern/printk.h> #include <kern/rdxtree.h> #include <kern/spinlock.h> @@ -97,7 +98,7 @@ static struct work_pool work_pool_highprio; static struct kmem_cache work_thread_cache; -static unsigned int work_max_threads; +static unsigned int work_max_threads __read_mostly; static int work_pool_alloc_id(struct work_pool *pool, struct work_thread *worker, diff --git a/vm/vm_kmem.c b/vm/vm_kmem.c index 229854ee..d967e5a7 100644 --- a/vm/vm_kmem.c +++ b/vm/vm_kmem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, 2013 Richard Braun. + * Copyright (c) 2011-2014 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 @@ -33,7 +33,7 @@ * Kernel map and storage. */ static struct vm_map kernel_map_store; -struct vm_map *kernel_map = &kernel_map_store; +struct vm_map *kernel_map __read_mostly = &kernel_map_store; /* * Heap boundaries during bootstrap. diff --git a/vm/vm_map.c b/vm/vm_map.c index 1fa7e30b..d8b67440 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, 2013 Richard Braun. + * Copyright (c) 2011-2014 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 @@ -96,12 +96,12 @@ static int vm_map_insert(struct vm_map *map, struct vm_map_entry *entry, /* * Statically allocated map entry for the first kernel map entry. */ -static struct vm_map_entry vm_map_kernel_entry; +static struct vm_map_entry vm_map_kernel_entry __read_mostly; /* * Statically allocated map entry for the kentry area. */ -static struct vm_map_entry vm_map_kentry_entry; +static struct vm_map_entry vm_map_kentry_entry __read_mostly; /* * Kentry slab free list. @@ -112,7 +112,7 @@ static struct vm_map_kentry_slab *vm_map_kentry_free_slabs; #ifdef NDEBUG #define vm_map_kentry_slab_size 0 #else /* NDEBUG */ -static size_t vm_map_kentry_slab_size; +static size_t vm_map_kentry_slab_size __read_mostly; #endif /* NDEBUG */ /* diff --git a/vm/vm_page.c b/vm/vm_page.c index ca0b8e9a..fb688c38 100644 --- a/vm/vm_page.c +++ b/vm/vm_page.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012, 2013 Richard Braun. + * Copyright (c) 2010-2014 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 @@ -124,12 +124,13 @@ struct vm_page_boot_seg { phys_addr_t avail_end; }; -int vm_page_ready; +/* TODO Accessor */ +int vm_page_ready __read_mostly; /* * Segment lists, ordered by priority. */ -static struct list vm_page_seg_lists[VM_PAGE_NR_SEGLISTS]; +static struct list vm_page_seg_lists[VM_PAGE_NR_SEGLISTS] __read_mostly; /* * Segment table. @@ -144,7 +145,7 @@ static struct vm_page_boot_seg vm_page_boot_segs[VM_PAGE_MAX_SEGS] __initdata; /* * Number of loaded segments. */ -static unsigned int vm_page_segs_size; +static unsigned int vm_page_segs_size __read_mostly; static int vm_page_load_initialized __initdata = 0; |