aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r--arch/sparc64/kernel/hvtramp.S4
-rw-r--r--arch/sparc64/kernel/iommu.c6
-rw-r--r--arch/sparc64/kernel/kprobes.c2
-rw-r--r--arch/sparc64/kernel/pci.c21
-rw-r--r--arch/sparc64/kernel/power.c3
-rw-r--r--arch/sparc64/kernel/process.c92
-rw-r--r--arch/sparc64/kernel/prom.c1
-rw-r--r--arch/sparc64/kernel/setup.c29
-rw-r--r--arch/sparc64/kernel/smp.c2
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c3
-rw-r--r--arch/sparc64/kernel/trampoline.S4
-rw-r--r--arch/sparc64/kernel/traps.c2
-rw-r--r--arch/sparc64/kernel/unaligned.c3
13 files changed, 23 insertions, 149 deletions
diff --git a/arch/sparc64/kernel/hvtramp.S b/arch/sparc64/kernel/hvtramp.S
index b692e044a463..0236c43772fa 100644
--- a/arch/sparc64/kernel/hvtramp.S
+++ b/arch/sparc64/kernel/hvtramp.S
@@ -3,6 +3,8 @@
3 * Copyright (C) 2007 David S. Miller <davem@davemloft.net> 3 * Copyright (C) 2007 David S. Miller <davem@davemloft.net>
4 */ 4 */
5 5
6#include <linux/init.h>
7
6#include <asm/thread_info.h> 8#include <asm/thread_info.h>
7#include <asm/hypervisor.h> 9#include <asm/hypervisor.h>
8#include <asm/scratchpad.h> 10#include <asm/scratchpad.h>
@@ -13,7 +15,7 @@
13#include <asm/head.h> 15#include <asm/head.h>
14#include <asm/asi.h> 16#include <asm/asi.h>
15 17
16 .text 18 __CPUINIT
17 .align 8 19 .align 8
18 .globl hv_cpu_startup, hv_cpu_startup_end 20 .globl hv_cpu_startup, hv_cpu_startup_end
19 21
diff --git a/arch/sparc64/kernel/iommu.c b/arch/sparc64/kernel/iommu.c
index d3276ebcfb47..fbaab3497bfd 100644
--- a/arch/sparc64/kernel/iommu.c
+++ b/arch/sparc64/kernel/iommu.c
@@ -134,7 +134,8 @@ unsigned long iommu_range_alloc(struct device *dev,
134 else 134 else
135 boundary_size = ALIGN(1UL << 32, 1 << IO_PAGE_SHIFT); 135 boundary_size = ALIGN(1UL << 32, 1 << IO_PAGE_SHIFT);
136 136
137 n = iommu_area_alloc(arena->map, limit, start, npages, 0, 137 n = iommu_area_alloc(arena->map, limit, start, npages,
138 iommu->page_table_map_base >> IO_PAGE_SHIFT,
138 boundary_size >> IO_PAGE_SHIFT, 0); 139 boundary_size >> IO_PAGE_SHIFT, 0);
139 if (n == -1) { 140 if (n == -1) {
140 if (likely(pass < 1)) { 141 if (likely(pass < 1)) {
@@ -200,12 +201,11 @@ int iommu_table_init(struct iommu *iommu, int tsbsize,
200 /* Allocate and initialize the dummy page which we 201 /* Allocate and initialize the dummy page which we
201 * set inactive IO PTEs to point to. 202 * set inactive IO PTEs to point to.
202 */ 203 */
203 iommu->dummy_page = __get_free_pages(GFP_KERNEL, 0); 204 iommu->dummy_page = get_zeroed_page(GFP_KERNEL);
204 if (!iommu->dummy_page) { 205 if (!iommu->dummy_page) {
205 printk(KERN_ERR "IOMMU: Error, gfp(dummy_page) failed.\n"); 206 printk(KERN_ERR "IOMMU: Error, gfp(dummy_page) failed.\n");
206 goto out_free_map; 207 goto out_free_map;
207 } 208 }
208 memset((void *)iommu->dummy_page, 0, PAGE_SIZE);
209 iommu->dummy_page_pa = (unsigned long) __pa(iommu->dummy_page); 209 iommu->dummy_page_pa = (unsigned long) __pa(iommu->dummy_page);
210 210
211 /* Now allocate and setup the IOMMU page table itself. */ 211 /* Now allocate and setup the IOMMU page table itself. */
diff --git a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c
index 34fc3ddd5002..f43b5d755354 100644
--- a/arch/sparc64/kernel/kprobes.c
+++ b/arch/sparc64/kernel/kprobes.c
@@ -465,8 +465,6 @@ void __kprobes jprobe_return(void)
465 465
466extern void jprobe_return_trap_instruction(void); 466extern void jprobe_return_trap_instruction(void);
467 467
468extern void __show_regs(struct pt_regs * regs);
469
470int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) 468int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
471{ 469{
472 u32 *addr = (u32 *) regs->tpc; 470 u32 *addr = (u32 *) regs->tpc;
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index a61c38fe75ea..545356b00e2e 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -225,20 +225,6 @@ static int __init pci_controller_init(const char *model_name, int namelen, struc
225 return 0; 225 return 0;
226} 226}
227 227
228static int __init pci_is_controller(const char *model_name, int namelen, struct device_node *dp)
229{
230 int i;
231
232 for (i = 0; i < PCI_NUM_CONTROLLER_TYPES; i++) {
233 if (!strncmp(model_name,
234 pci_controller_table[i].model_name,
235 namelen)) {
236 return 1;
237 }
238 }
239 return 0;
240}
241
242static int __init pci_controller_scan(int (*handler)(const char *, int, struct device_node *)) 228static int __init pci_controller_scan(int (*handler)(const char *, int, struct device_node *))
243{ 229{
244 struct device_node *dp; 230 struct device_node *dp;
@@ -273,13 +259,6 @@ static int __init pci_controller_scan(int (*handler)(const char *, int, struct d
273 return count; 259 return count;
274} 260}
275 261
276
277/* Is there some PCI controller in the system? */
278int __init pcic_present(void)
279{
280 return pci_controller_scan(pci_is_controller);
281}
282
283/* Find each controller in the system, attach and initialize 262/* Find each controller in the system, attach and initialize
284 * software state structure for each and link into the 263 * software state structure for each and link into the
285 * pci_pbm_root. Setup the controller enough such 264 * pci_pbm_root. Setup the controller enough such
diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c
index 850cdffdd69c..eae8ca2a6ba5 100644
--- a/arch/sparc64/kernel/power.c
+++ b/arch/sparc64/kernel/power.c
@@ -20,6 +20,7 @@
20#include <asm/of_device.h> 20#include <asm/of_device.h>
21#include <asm/io.h> 21#include <asm/io.h>
22#include <asm/sstate.h> 22#include <asm/sstate.h>
23#include <asm/reboot.h>
23 24
24#include <linux/unistd.h> 25#include <linux/unistd.h>
25 26
@@ -39,8 +40,6 @@ static irqreturn_t power_handler(int irq, void *dev_id)
39 return IRQ_HANDLED; 40 return IRQ_HANDLED;
40} 41}
41 42
42extern void machine_halt(void);
43extern void machine_alt_power_off(void);
44static void (*poweroff_method)(void) = machine_alt_power_off; 43static void (*poweroff_method)(void) = machine_alt_power_off;
45 44
46void machine_power_off(void) 45void machine_power_off(void)
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 1b2379174988..2aafce7dfc0e 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -30,6 +30,7 @@
30#include <linux/tick.h> 30#include <linux/tick.h>
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/cpu.h> 32#include <linux/cpu.h>
33#include <linux/elfcore.h>
33 34
34#include <asm/oplib.h> 35#include <asm/oplib.h>
35#include <asm/uaccess.h> 36#include <asm/uaccess.h>
@@ -47,6 +48,8 @@
47#include <asm/unistd.h> 48#include <asm/unistd.h>
48#include <asm/hypervisor.h> 49#include <asm/hypervisor.h>
49#include <asm/sstate.h> 50#include <asm/sstate.h>
51#include <asm/reboot.h>
52#include <asm/syscalls.h>
50 53
51/* #define VERBOSE_SHOWREGS */ 54/* #define VERBOSE_SHOWREGS */
52 55
@@ -113,16 +116,9 @@ void cpu_idle(void)
113 116
114extern char reboot_command []; 117extern char reboot_command [];
115 118
116extern void (*prom_palette)(int);
117extern void (*prom_keyboard)(void);
118
119void machine_halt(void) 119void machine_halt(void)
120{ 120{
121 sstate_halt(); 121 sstate_halt();
122 if (prom_palette)
123 prom_palette (1);
124 if (prom_keyboard)
125 prom_keyboard();
126 prom_halt(); 122 prom_halt();
127 panic("Halt failed!"); 123 panic("Halt failed!");
128} 124}
@@ -130,10 +126,6 @@ void machine_halt(void)
130void machine_alt_power_off(void) 126void machine_alt_power_off(void)
131{ 127{
132 sstate_poweroff(); 128 sstate_poweroff();
133 if (prom_palette)
134 prom_palette(1);
135 if (prom_keyboard)
136 prom_keyboard();
137 prom_halt_power_off(); 129 prom_halt_power_off();
138 panic("Power-off failed!"); 130 panic("Power-off failed!");
139} 131}
@@ -145,10 +137,6 @@ void machine_restart(char * cmd)
145 sstate_reboot(); 137 sstate_reboot();
146 p = strchr (reboot_command, '\n'); 138 p = strchr (reboot_command, '\n');
147 if (p) *p = 0; 139 if (p) *p = 0;
148 if (prom_palette)
149 prom_palette (1);
150 if (prom_keyboard)
151 prom_keyboard();
152 if (cmd) 140 if (cmd)
153 prom_reboot(cmd); 141 prom_reboot(cmd);
154 if (*reboot_command) 142 if (*reboot_command)
@@ -226,62 +214,6 @@ static void show_regwindow(struct pt_regs *regs)
226 print_symbol("I7: <%s>\n", rwk->ins[7]); 214 print_symbol("I7: <%s>\n", rwk->ins[7]);
227} 215}
228 216
229void show_stackframe(struct sparc_stackf *sf)
230{
231 unsigned long size;
232 unsigned long *stk;
233 int i;
234
235 printk("l0: %016lx l1: %016lx l2: %016lx l3: %016lx\n"
236 "l4: %016lx l5: %016lx l6: %016lx l7: %016lx\n",
237 sf->locals[0], sf->locals[1], sf->locals[2], sf->locals[3],
238 sf->locals[4], sf->locals[5], sf->locals[6], sf->locals[7]);
239 printk("i0: %016lx i1: %016lx i2: %016lx i3: %016lx\n"
240 "i4: %016lx i5: %016lx fp: %016lx ret_pc: %016lx\n",
241 sf->ins[0], sf->ins[1], sf->ins[2], sf->ins[3],
242 sf->ins[4], sf->ins[5], (unsigned long)sf->fp, sf->callers_pc);
243 printk("sp: %016lx x0: %016lx x1: %016lx x2: %016lx\n"
244 "x3: %016lx x4: %016lx x5: %016lx xx: %016lx\n",
245 (unsigned long)sf->structptr, sf->xargs[0], sf->xargs[1],
246 sf->xargs[2], sf->xargs[3], sf->xargs[4], sf->xargs[5],
247 sf->xxargs[0]);
248 size = ((unsigned long)sf->fp) - ((unsigned long)sf);
249 size -= STACKFRAME_SZ;
250 stk = (unsigned long *)((unsigned long)sf + STACKFRAME_SZ);
251 i = 0;
252 do {
253 printk("s%d: %016lx\n", i++, *stk++);
254 } while ((size -= sizeof(unsigned long)));
255}
256
257void show_stackframe32(struct sparc_stackf32 *sf)
258{
259 unsigned long size;
260 unsigned *stk;
261 int i;
262
263 printk("l0: %08x l1: %08x l2: %08x l3: %08x\n",
264 sf->locals[0], sf->locals[1], sf->locals[2], sf->locals[3]);
265 printk("l4: %08x l5: %08x l6: %08x l7: %08x\n",
266 sf->locals[4], sf->locals[5], sf->locals[6], sf->locals[7]);
267 printk("i0: %08x i1: %08x i2: %08x i3: %08x\n",
268 sf->ins[0], sf->ins[1], sf->ins[2], sf->ins[3]);
269 printk("i4: %08x i5: %08x fp: %08x ret_pc: %08x\n",
270 sf->ins[4], sf->ins[5], sf->fp, sf->callers_pc);
271 printk("sp: %08x x0: %08x x1: %08x x2: %08x\n"
272 "x3: %08x x4: %08x x5: %08x xx: %08x\n",
273 sf->structptr, sf->xargs[0], sf->xargs[1],
274 sf->xargs[2], sf->xargs[3], sf->xargs[4], sf->xargs[5],
275 sf->xxargs[0]);
276 size = ((unsigned long)sf->fp) - ((unsigned long)sf);
277 size -= STACKFRAME32_SZ;
278 stk = (unsigned *)((unsigned long)sf + STACKFRAME32_SZ);
279 i = 0;
280 do {
281 printk("s%d: %08x\n", i++, *stk++);
282 } while ((size -= sizeof(unsigned)));
283}
284
285#ifdef CONFIG_SMP 217#ifdef CONFIG_SMP
286static DEFINE_SPINLOCK(regdump_lock); 218static DEFINE_SPINLOCK(regdump_lock);
287#endif 219#endif
@@ -369,24 +301,6 @@ void show_regs(struct pt_regs *regs)
369#endif 301#endif
370} 302}
371 303
372void show_regs32(struct pt_regs32 *regs)
373{
374 printk("PSR: %08x PC: %08x NPC: %08x Y: %08x %s\n", regs->psr,
375 regs->pc, regs->npc, regs->y, print_tainted());
376 printk("g0: %08x g1: %08x g2: %08x g3: %08x ",
377 regs->u_regs[0], regs->u_regs[1], regs->u_regs[2],
378 regs->u_regs[3]);
379 printk("g4: %08x g5: %08x g6: %08x g7: %08x\n",
380 regs->u_regs[4], regs->u_regs[5], regs->u_regs[6],
381 regs->u_regs[7]);
382 printk("o0: %08x o1: %08x o2: %08x o3: %08x ",
383 regs->u_regs[8], regs->u_regs[9], regs->u_regs[10],
384 regs->u_regs[11]);
385 printk("o4: %08x o5: %08x sp: %08x ret_pc: %08x\n",
386 regs->u_regs[12], regs->u_regs[13], regs->u_regs[14],
387 regs->u_regs[15]);
388}
389
390unsigned long thread_saved_pc(struct task_struct *tsk) 304unsigned long thread_saved_pc(struct task_struct *tsk)
391{ 305{
392 struct thread_info *ti = task_thread_info(tsk); 306 struct thread_info *ti = task_thread_info(tsk);
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index a246e962e5a7..68964ddcde1e 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -1716,7 +1716,6 @@ static void __init of_console_init(void)
1716 1716
1717 of_console_device = dp; 1717 of_console_device = dp;
1718 1718
1719 prom_printf(msg, of_console_path);
1720 printk(msg, of_console_path); 1719 printk(msg, of_console_path);
1721} 1720}
1722 1721
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index 5964d8653ade..d036dbe72864 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -68,33 +68,22 @@ struct screen_info screen_info = {
68 16 /* orig-video-points */ 68 16 /* orig-video-points */
69}; 69};
70 70
71void (*prom_palette)(int);
72void (*prom_keyboard)(void);
73
74static void 71static void
75prom_console_write(struct console *con, const char *s, unsigned n) 72prom_console_write(struct console *con, const char *s, unsigned n)
76{ 73{
77 prom_write(s, n); 74 prom_write(s, n);
78} 75}
79 76
80unsigned int boot_flags = 0;
81#define BOOTME_DEBUG 0x1
82
83/* Exported for mm/init.c:paging_init. */ 77/* Exported for mm/init.c:paging_init. */
84unsigned long cmdline_memory_size = 0; 78unsigned long cmdline_memory_size = 0;
85 79
86static struct console prom_debug_console = { 80static struct console prom_early_console = {
87 .name = "debug", 81 .name = "earlyprom",
88 .write = prom_console_write, 82 .write = prom_console_write,
89 .flags = CON_PRINTBUFFER, 83 .flags = CON_PRINTBUFFER | CON_BOOT,
90 .index = -1, 84 .index = -1,
91}; 85};
92 86
93/* XXX Implement this at some point... */
94void kernel_enter_debugger(void)
95{
96}
97
98/* 87/*
99 * Process kernel command line switches that are specific to the 88 * Process kernel command line switches that are specific to the
100 * SPARC or that require special low-level processing. 89 * SPARC or that require special low-level processing.
@@ -103,8 +92,6 @@ static void __init process_switch(char c)
103{ 92{
104 switch (c) { 93 switch (c) {
105 case 'd': 94 case 'd':
106 boot_flags |= BOOTME_DEBUG;
107 break;
108 case 's': 95 case 's':
109 break; 96 break;
110 case 'h': 97 case 'h':
@@ -112,8 +99,7 @@ static void __init process_switch(char c)
112 prom_halt(); 99 prom_halt();
113 break; 100 break;
114 case 'p': 101 case 'p':
115 /* Use PROM debug console. */ 102 /* Just ignore, this behavior is now the default. */
116 register_console(&prom_debug_console);
117 break; 103 break;
118 case 'P': 104 case 'P':
119 /* Force UltraSPARC-III P-Cache on. */ 105 /* Force UltraSPARC-III P-Cache on. */
@@ -168,8 +154,6 @@ static void __init boot_flags_init(char *commands)
168 } 154 }
169} 155}
170 156
171extern void panic_setup(char *, int *);
172
173extern unsigned short root_flags; 157extern unsigned short root_flags;
174extern unsigned short root_dev; 158extern unsigned short root_dev;
175extern unsigned short ram_flags; 159extern unsigned short ram_flags;
@@ -296,6 +280,9 @@ void __init setup_arch(char **cmdline_p)
296 *cmdline_p = prom_getbootargs(); 280 *cmdline_p = prom_getbootargs();
297 strcpy(boot_command_line, *cmdline_p); 281 strcpy(boot_command_line, *cmdline_p);
298 282
283 boot_flags_init(*cmdline_p);
284 register_console(&prom_early_console);
285
299 if (tlb_type == hypervisor) 286 if (tlb_type == hypervisor)
300 printk("ARCH: SUN4V\n"); 287 printk("ARCH: SUN4V\n");
301 else 288 else
@@ -307,8 +294,6 @@ void __init setup_arch(char **cmdline_p)
307 conswitchp = &prom_con; 294 conswitchp = &prom_con;
308#endif 295#endif
309 296
310 boot_flags_init(*cmdline_p);
311
312 idprom_init(); 297 idprom_init();
313 298
314 if (!root_flags) 299 if (!root_flags)
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index a8052b76df41..cc454731d879 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -86,7 +86,7 @@ extern void setup_sparc64_timer(void);
86 86
87static volatile unsigned long callin_flag = 0; 87static volatile unsigned long callin_flag = 0;
88 88
89void __devinit smp_callin(void) 89void __cpuinit smp_callin(void)
90{ 90{
91 int cpuid = hard_smp_processor_id(); 91 int cpuid = hard_smp_processor_id();
92 92
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index 68db08930399..51fa773f38c9 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -85,7 +85,6 @@ extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
85extern long sparc32_open(const char __user * filename, int flags, int mode); 85extern long sparc32_open(const char __user * filename, int flags, int mode);
86extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 86extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
87 unsigned long pfn, unsigned long size, pgprot_t prot); 87 unsigned long pfn, unsigned long size, pgprot_t prot);
88extern void (*prom_palette)(int);
89 88
90extern int __ashrdi3(int, int); 89extern int __ashrdi3(int, int);
91 90
@@ -355,5 +354,3 @@ EXPORT_SYMBOL(xor_niagara_2);
355EXPORT_SYMBOL(xor_niagara_3); 354EXPORT_SYMBOL(xor_niagara_3);
356EXPORT_SYMBOL(xor_niagara_4); 355EXPORT_SYMBOL(xor_niagara_4);
357EXPORT_SYMBOL(xor_niagara_5); 356EXPORT_SYMBOL(xor_niagara_5);
358
359EXPORT_SYMBOL(prom_palette);
diff --git a/arch/sparc64/kernel/trampoline.S b/arch/sparc64/kernel/trampoline.S
index 04e81dda13d0..4ae2e525d68b 100644
--- a/arch/sparc64/kernel/trampoline.S
+++ b/arch/sparc64/kernel/trampoline.S
@@ -4,6 +4,8 @@
4 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
5 */ 5 */
6 6
7#include <linux/init.h>
8
7#include <asm/head.h> 9#include <asm/head.h>
8#include <asm/asi.h> 10#include <asm/asi.h>
9#include <asm/lsu.h> 11#include <asm/lsu.h>
@@ -36,7 +38,7 @@ dtlb_load:
36tramp_stack: 38tramp_stack:
37 .skip TRAMP_STACK_SIZE 39 .skip TRAMP_STACK_SIZE
38 40
39 .text 41 __CPUINIT
40 .align 8 42 .align 8
41 .globl sparc64_cpu_startup, sparc64_cpu_startup_end 43 .globl sparc64_cpu_startup, sparc64_cpu_startup_end
42sparc64_cpu_startup: 44sparc64_cpu_startup:
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 2b6abf633343..007f5317c0de 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -1791,8 +1791,6 @@ static const char *sun4v_err_type_to_str(u32 type)
1791 }; 1791 };
1792} 1792}
1793 1793
1794extern void __show_regs(struct pt_regs * regs);
1795
1796static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, int cpu, const char *pfx, atomic_t *ocnt) 1794static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent, int cpu, const char *pfx, atomic_t *ocnt)
1797{ 1795{
1798 int cnt; 1796 int cnt;
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c
index dc7bf1b6321c..1a511e9f0d3e 100644
--- a/arch/sparc64/kernel/unaligned.c
+++ b/arch/sparc64/kernel/unaligned.c
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9 9
10#include <linux/jiffies.h>
10#include <linux/kernel.h> 11#include <linux/kernel.h>
11#include <linux/sched.h> 12#include <linux/sched.h>
12#include <linux/mm.h> 13#include <linux/mm.h>
@@ -283,7 +284,7 @@ static void log_unaligned(struct pt_regs *regs)
283{ 284{
284 static unsigned long count, last_time; 285 static unsigned long count, last_time;
285 286
286 if (jiffies - last_time > 5 * HZ) 287 if (time_after(jiffies, last_time + 5 * HZ))
287 count = 0; 288 count = 0;
288 if (count < 5) { 289 if (count < 5) {
289 last_time = jiffies; 290 last_time = jiffies;