aboutsummaryrefslogtreecommitdiffstats
path: root/arch/frv
diff options
context:
space:
mode:
Diffstat (limited to 'arch/frv')
-rw-r--r--arch/frv/Kconfig1
-rw-r--r--arch/frv/Kconfig.debug4
-rw-r--r--arch/frv/include/asm/pgtable.h3
-rw-r--r--arch/frv/include/asm/uaccess.h4
-rw-r--r--arch/frv/kernel/head.S5
-rw-r--r--arch/frv/kernel/setup.c15
-rw-r--r--arch/frv/kernel/traps.c2
-rw-r--r--arch/frv/mm/init.c57
8 files changed, 30 insertions, 61 deletions
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index 2ce731f9aa4d..4b6628ea381e 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -14,6 +14,7 @@ config FRV
14 select ARCH_WANT_IPC_PARSE_VERSION 14 select ARCH_WANT_IPC_PARSE_VERSION
15 select OLD_SIGSUSPEND3 15 select OLD_SIGSUSPEND3
16 select OLD_SIGACTION 16 select OLD_SIGACTION
17 select HAVE_DEBUG_STACKOVERFLOW
17 18
18config ZONE_DMA 19config ZONE_DMA
19 bool 20 bool
diff --git a/arch/frv/Kconfig.debug b/arch/frv/Kconfig.debug
index 211f01bc4caa..98c99a3ed2be 100644
--- a/arch/frv/Kconfig.debug
+++ b/arch/frv/Kconfig.debug
@@ -2,10 +2,6 @@ menu "Kernel hacking"
2 2
3source "lib/Kconfig.debug" 3source "lib/Kconfig.debug"
4 4
5config DEBUG_STACKOVERFLOW
6 bool "Check for stack overflows"
7 depends on DEBUG_KERNEL
8
9config GDBSTUB 5config GDBSTUB
10 bool "Remote GDB kernel debugging" 6 bool "Remote GDB kernel debugging"
11 depends on DEBUG_KERNEL 7 depends on DEBUG_KERNEL
diff --git a/arch/frv/include/asm/pgtable.h b/arch/frv/include/asm/pgtable.h
index 6bc241e4b4f8..eb0110acd19b 100644
--- a/arch/frv/include/asm/pgtable.h
+++ b/arch/frv/include/asm/pgtable.h
@@ -488,9 +488,6 @@ static inline int pte_file(pte_t pte)
488#define PageSkip(page) (0) 488#define PageSkip(page) (0)
489#define kern_addr_valid(addr) (1) 489#define kern_addr_valid(addr) (1)
490 490
491#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
492 remap_pfn_range(vma, vaddr, pfn, size, prot)
493
494#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 491#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
495#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 492#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
496#define __HAVE_ARCH_PTEP_SET_WRPROTECT 493#define __HAVE_ARCH_PTEP_SET_WRPROTECT
diff --git a/arch/frv/include/asm/uaccess.h b/arch/frv/include/asm/uaccess.h
index 0b67ec5b4414..3ac9a59d65d4 100644
--- a/arch/frv/include/asm/uaccess.h
+++ b/arch/frv/include/asm/uaccess.h
@@ -280,14 +280,14 @@ extern long __memcpy_user(void *dst, const void *src, unsigned long count);
280static inline unsigned long __must_check 280static inline unsigned long __must_check
281__copy_to_user(void __user *to, const void *from, unsigned long n) 281__copy_to_user(void __user *to, const void *from, unsigned long n)
282{ 282{
283 might_sleep(); 283 might_fault();
284 return __copy_to_user_inatomic(to, from, n); 284 return __copy_to_user_inatomic(to, from, n);
285} 285}
286 286
287static inline unsigned long 287static inline unsigned long
288__copy_from_user(void *to, const void __user *from, unsigned long n) 288__copy_from_user(void *to, const void __user *from, unsigned long n)
289{ 289{
290 might_sleep(); 290 might_fault();
291 return __copy_from_user_inatomic(to, from, n); 291 return __copy_from_user_inatomic(to, from, n);
292} 292}
293 293
diff --git a/arch/frv/kernel/head.S b/arch/frv/kernel/head.S
index e9a8cc63ac94..a7d0bea9c036 100644
--- a/arch/frv/kernel/head.S
+++ b/arch/frv/kernel/head.S
@@ -479,11 +479,6 @@ __head_mmu_enabled:
479 479
480 LEDS 0x000c 480 LEDS 0x000c
481 481
482 # initialise the processor and the peripherals
483 #call SYMBOL_NAME(processor_init)
484 #call SYMBOL_NAME(unit_init)
485 #LEDS 0x0aff
486
487 sethi.p #0xe5e5,gr3 482 sethi.p #0xe5e5,gr3
488 setlo #0xe5e5,gr3 483 setlo #0xe5e5,gr3
489 or.p gr3,gr0,gr4 484 or.p gr3,gr0,gr4
diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c
index a5136474c6fd..ae3a6706419b 100644
--- a/arch/frv/kernel/setup.c
+++ b/arch/frv/kernel/setup.c
@@ -735,7 +735,7 @@ static void __init parse_cmdline_early(char *cmdline)
735 /* "mem=XXX[kKmM]" sets SDRAM size to <mem>, overriding the value we worked 735 /* "mem=XXX[kKmM]" sets SDRAM size to <mem>, overriding the value we worked
736 * out from the SDRAM controller mask register 736 * out from the SDRAM controller mask register
737 */ 737 */
738 if (!memcmp(cmdline, "mem=", 4)) { 738 if (!strncmp(cmdline, "mem=", 4)) {
739 unsigned long long mem_size; 739 unsigned long long mem_size;
740 740
741 mem_size = memparse(cmdline + 4, &cmdline); 741 mem_size = memparse(cmdline + 4, &cmdline);
@@ -876,6 +876,7 @@ late_initcall(setup_arch_serial);
876static void __init setup_linux_memory(void) 876static void __init setup_linux_memory(void)
877{ 877{
878 unsigned long bootmap_size, low_top_pfn, kstart, kend, high_mem; 878 unsigned long bootmap_size, low_top_pfn, kstart, kend, high_mem;
879 unsigned long physpages;
879 880
880 kstart = (unsigned long) &__kernel_image_start - PAGE_OFFSET; 881 kstart = (unsigned long) &__kernel_image_start - PAGE_OFFSET;
881 kend = (unsigned long) &__kernel_image_end - PAGE_OFFSET; 882 kend = (unsigned long) &__kernel_image_end - PAGE_OFFSET;
@@ -893,19 +894,19 @@ static void __init setup_linux_memory(void)
893 ); 894 );
894 895
895 /* pass the memory that the kernel can immediately use over to the bootmem allocator */ 896 /* pass the memory that the kernel can immediately use over to the bootmem allocator */
896 max_mapnr = num_physpages = (memory_end - memory_start) >> PAGE_SHIFT; 897 max_mapnr = physpages = (memory_end - memory_start) >> PAGE_SHIFT;
897 low_top_pfn = (KERNEL_LOWMEM_END - KERNEL_LOWMEM_START) >> PAGE_SHIFT; 898 low_top_pfn = (KERNEL_LOWMEM_END - KERNEL_LOWMEM_START) >> PAGE_SHIFT;
898 high_mem = 0; 899 high_mem = 0;
899 900
900 if (num_physpages > low_top_pfn) { 901 if (physpages > low_top_pfn) {
901#ifdef CONFIG_HIGHMEM 902#ifdef CONFIG_HIGHMEM
902 high_mem = num_physpages - low_top_pfn; 903 high_mem = physpages - low_top_pfn;
903#else 904#else
904 max_mapnr = num_physpages = low_top_pfn; 905 max_mapnr = physpages = low_top_pfn;
905#endif 906#endif
906 } 907 }
907 else { 908 else {
908 low_top_pfn = num_physpages; 909 low_top_pfn = physpages;
909 } 910 }
910 911
911 min_low_pfn = memory_start >> PAGE_SHIFT; 912 min_low_pfn = memory_start >> PAGE_SHIFT;
@@ -979,7 +980,7 @@ static void __init setup_uclinux_memory(void)
979 free_bootmem(memory_start, memory_end - memory_start); 980 free_bootmem(memory_start, memory_end - memory_start);
980 981
981 high_memory = (void *) (memory_end & PAGE_MASK); 982 high_memory = (void *) (memory_end & PAGE_MASK);
982 max_mapnr = num_physpages = ((unsigned long) high_memory - PAGE_OFFSET) >> PAGE_SHIFT; 983 max_mapnr = ((unsigned long) high_memory - PAGE_OFFSET) >> PAGE_SHIFT;
983 984
984 min_low_pfn = memory_start >> PAGE_SHIFT; 985 min_low_pfn = memory_start >> PAGE_SHIFT;
985 max_low_pfn = memory_end >> PAGE_SHIFT; 986 max_low_pfn = memory_end >> PAGE_SHIFT;
diff --git a/arch/frv/kernel/traps.c b/arch/frv/kernel/traps.c
index 4bff48c19d29..a6d105d61b26 100644
--- a/arch/frv/kernel/traps.c
+++ b/arch/frv/kernel/traps.c
@@ -523,7 +523,7 @@ void die_if_kernel(const char *str, ...)
523 return; 523 return;
524 524
525 va_start(va, str); 525 va_start(va, str);
526 vsprintf(buffer, str, va); 526 vsnprintf(buffer, sizeof(buffer), str, va);
527 va_end(va); 527 va_end(va);
528 528
529 console_verbose(); 529 console_verbose();
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c
index dee354fa6b64..88a159743528 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -78,7 +78,7 @@ void __init paging_init(void)
78 memset((void *) empty_zero_page, 0, PAGE_SIZE); 78 memset((void *) empty_zero_page, 0, PAGE_SIZE);
79 79
80#ifdef CONFIG_HIGHMEM 80#ifdef CONFIG_HIGHMEM
81 if (num_physpages - num_mappedpages) { 81 if (get_num_physpages() - num_mappedpages) {
82 pgd_t *pge; 82 pgd_t *pge;
83 pud_t *pue; 83 pud_t *pue;
84 pmd_t *pme; 84 pmd_t *pme;
@@ -96,7 +96,7 @@ void __init paging_init(void)
96 */ 96 */
97 zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn; 97 zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn;
98#ifdef CONFIG_HIGHMEM 98#ifdef CONFIG_HIGHMEM
99 zones_size[ZONE_HIGHMEM] = num_physpages - num_mappedpages; 99 zones_size[ZONE_HIGHMEM] = get_num_physpages() - num_mappedpages;
100#endif 100#endif
101 101
102 free_area_init(zones_size); 102 free_area_init(zones_size);
@@ -114,45 +114,24 @@ void __init paging_init(void)
114 */ 114 */
115void __init mem_init(void) 115void __init mem_init(void)
116{ 116{
117 unsigned long npages = (memory_end - memory_start) >> PAGE_SHIFT; 117 unsigned long code_size = _etext - _stext;
118 unsigned long tmp;
119#ifdef CONFIG_MMU
120 unsigned long loop, pfn;
121 int datapages = 0;
122#endif
123 int codek = 0, datak = 0;
124 118
125 /* this will put all low memory onto the freelists */ 119 /* this will put all low memory onto the freelists */
126 totalram_pages = free_all_bootmem(); 120 free_all_bootmem();
127 121#if defined(CONFIG_MMU) && defined(CONFIG_HIGHMEM)
128#ifdef CONFIG_MMU 122 {
129 for (loop = 0 ; loop < npages ; loop++) 123 unsigned long pfn;
130 if (PageReserved(&mem_map[loop])) 124
131 datapages++; 125 for (pfn = get_num_physpages() - 1;
132 126 pfn >= num_mappedpages; pfn--)
133#ifdef CONFIG_HIGHMEM 127 free_highmem_page(&mem_map[pfn]);
134 for (pfn = num_physpages - 1; pfn >= num_mappedpages; pfn--) 128 }
135 free_highmem_page(&mem_map[pfn]);
136#endif
137
138 codek = ((unsigned long) &_etext - (unsigned long) &_stext) >> 10;
139 datak = datapages << (PAGE_SHIFT - 10);
140
141#else
142 codek = (_etext - _stext) >> 10;
143 datak = 0; //(__bss_stop - _sdata) >> 10;
144#endif 129#endif
145 130
146 tmp = nr_free_pages() << PAGE_SHIFT; 131 mem_init_print_info(NULL);
147 printk("Memory available: %luKiB/%luKiB RAM, %luKiB/%luKiB ROM (%dKiB kernel code, %dKiB data)\n", 132 if (rom_length > 0 && rom_length >= code_size)
148 tmp >> 10, 133 printk("Memory available: %luKiB/%luKiB ROM\n",
149 npages << (PAGE_SHIFT - 10), 134 (rom_length - code_size) >> 10, rom_length >> 10);
150 (rom_length > 0) ? ((rom_length >> 10) - codek) : 0,
151 rom_length >> 10,
152 codek,
153 datak
154 );
155
156} /* end mem_init() */ 135} /* end mem_init() */
157 136
158/*****************************************************************************/ 137/*****************************************************************************/
@@ -162,7 +141,7 @@ void __init mem_init(void)
162void free_initmem(void) 141void free_initmem(void)
163{ 142{
164#if defined(CONFIG_RAMKERNEL) && !defined(CONFIG_PROTECT_KERNEL) 143#if defined(CONFIG_RAMKERNEL) && !defined(CONFIG_PROTECT_KERNEL)
165 free_initmem_default(0); 144 free_initmem_default(-1);
166#endif 145#endif
167} /* end free_initmem() */ 146} /* end free_initmem() */
168 147
@@ -173,6 +152,6 @@ void free_initmem(void)
173#ifdef CONFIG_BLK_DEV_INITRD 152#ifdef CONFIG_BLK_DEV_INITRD
174void __init free_initrd_mem(unsigned long start, unsigned long end) 153void __init free_initrd_mem(unsigned long start, unsigned long end)
175{ 154{
176 free_reserved_area(start, end, 0, "initrd"); 155 free_reserved_area((void *)start, (void *)end, -1, "initrd");
177} /* end free_initrd_mem() */ 156} /* end free_initrd_mem() */
178#endif 157#endif