diff options
author | Mikael Starvik <mikael.starvik@axis.com> | 2005-07-27 14:44:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-27 19:26:00 -0400 |
commit | 7cf32cad153d63ac4f6f2d5dd16ddd32ad72d578 (patch) | |
tree | 1072d64f49092ba87ff0d5079e37f58f646f7356 /arch/cris/arch-v10/kernel | |
parent | 2e0cea1decf7f21df0496571c218df3b3b8cce99 (diff) |
[PATCH] CRIS update: misc patches
* Start threads with IRQs enabled.
* Move symbol exports to arch specific file.
* Prepare for real command line in the future.
* Handle csum for partition that crosses flash boundary.
* Set utsname.
Signed-off-by: Mikael Starvik <starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/cris/arch-v10/kernel')
-rw-r--r-- | arch/cris/arch-v10/kernel/entry.S | 54 | ||||
-rw-r--r-- | arch/cris/arch-v10/kernel/kgdb.c | 17 | ||||
-rw-r--r-- | arch/cris/arch-v10/kernel/process.c | 3 |
3 files changed, 51 insertions, 23 deletions
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S index 1bc44f481c34..c0163bf94a50 100644 --- a/arch/cris/arch-v10/kernel/entry.S +++ b/arch/cris/arch-v10/kernel/entry.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: entry.S,v 1.23 2004/10/19 13:07:37 starvik Exp $ | 1 | /* $Id: entry.S,v 1.28 2005/06/20 05:06:30 starvik Exp $ |
2 | * | 2 | * |
3 | * linux/arch/cris/entry.S | 3 | * linux/arch/cris/entry.S |
4 | * | 4 | * |
@@ -7,6 +7,22 @@ | |||
7 | * Authors: Bjorn Wesen (bjornw@axis.com) | 7 | * Authors: Bjorn Wesen (bjornw@axis.com) |
8 | * | 8 | * |
9 | * $Log: entry.S,v $ | 9 | * $Log: entry.S,v $ |
10 | * Revision 1.28 2005/06/20 05:06:30 starvik | ||
11 | * Remove unnecessary diff to kernel.org tree | ||
12 | * | ||
13 | * Revision 1.27 2005/03/04 08:16:16 starvik | ||
14 | * Merge of Linux 2.6.11. | ||
15 | * | ||
16 | * Revision 1.26 2005/01/11 13:49:47 starvik | ||
17 | * Added NMI handler. | ||
18 | * | ||
19 | * Revision 1.25 2004/12/27 11:18:32 starvik | ||
20 | * Merge of Linux 2.6.10 (not functional yet). | ||
21 | * | ||
22 | * Revision 1.24 2004/12/22 10:41:23 starvik | ||
23 | * Updates to make v10 compile with the latest SMP aware generic code (even | ||
24 | * though v10 will never have SMP). | ||
25 | * | ||
10 | * Revision 1.23 2004/10/19 13:07:37 starvik | 26 | * Revision 1.23 2004/10/19 13:07:37 starvik |
11 | * Merge of Linux 2.6.9 | 27 | * Merge of Linux 2.6.9 |
12 | * | 28 | * |
@@ -279,6 +295,7 @@ | |||
279 | #ifdef CONFIG_PREEMPT | 295 | #ifdef CONFIG_PREEMPT |
280 | ; Check if preemptive kernel scheduling should be done | 296 | ; Check if preemptive kernel scheduling should be done |
281 | _resume_kernel: | 297 | _resume_kernel: |
298 | di | ||
282 | ; Load current task struct | 299 | ; Load current task struct |
283 | movs.w -8192, $r0 ; THREAD_SIZE = 8192 | 300 | movs.w -8192, $r0 ; THREAD_SIZE = 8192 |
284 | and.d $sp, $r0 | 301 | and.d $sp, $r0 |
@@ -291,12 +308,7 @@ _need_resched: | |||
291 | bpl _Rexit | 308 | bpl _Rexit |
292 | nop | 309 | nop |
293 | ; Ok, lets's do some preemptive kernel scheduling | 310 | ; Ok, lets's do some preemptive kernel scheduling |
294 | move.d PREEMPT_ACTIVE, $r10 | 311 | jsr preempt_schedule_irq |
295 | move.d $r10, [$r0+TI_preempt_count] ; Mark as active | ||
296 | ei | ||
297 | jsr schedule | ||
298 | clear.d [$r0+TI_preempt_count] ; Mark as inactive | ||
299 | di | ||
300 | ; Load new task struct | 312 | ; Load new task struct |
301 | movs.w -8192, $r0 ; THREAD_SIZE = 8192 | 313 | movs.w -8192, $r0 ; THREAD_SIZE = 8192 |
302 | and.d $sp, $r0 | 314 | and.d $sp, $r0 |
@@ -590,15 +602,15 @@ mmu_bus_fault: | |||
590 | move.d $r0, [$sp+16] | 602 | move.d $r0, [$sp+16] |
591 | 1: btstq 12, $r1 ; Refill? | 603 | 1: btstq 12, $r1 ; Refill? |
592 | bpl 2f | 604 | bpl 2f |
593 | lsrq PMD_SHIFT, $r1 ; Get PMD index into PGD (bit 24-31) | 605 | lsrq 24, $r1 ; Get PGD index (bit 24-31) |
594 | move.d [current_pgd], $r0 ; PGD for the current process | 606 | move.d [per_cpu__current_pgd], $r0 ; PGD for the current process |
595 | move.d [$r0+$r1.d], $r0 ; Get PMD | 607 | move.d [$r0+$r1.d], $r0 ; Get PMD |
596 | beq 2f | 608 | beq 2f |
597 | nop | 609 | nop |
598 | and.w PAGE_MASK, $r0 ; Remove PMD flags | 610 | and.w PAGE_MASK, $r0 ; Remove PMD flags |
599 | move.d [R_MMU_CAUSE], $r1 | 611 | move.d [R_MMU_CAUSE], $r1 |
600 | lsrq PAGE_SHIFT, $r1 | 612 | lsrq PAGE_SHIFT, $r1 |
601 | and.d 0x7ff, $r1 ; Get PTE index into PMD (bit 13-24) | 613 | and.d 0x7ff, $r1 ; Get PTE index into PGD (bit 13-23) |
602 | move.d [$r0+$r1.d], $r1 ; Get PTE | 614 | move.d [$r0+$r1.d], $r1 ; Get PTE |
603 | beq 2f | 615 | beq 2f |
604 | nop | 616 | nop |
@@ -656,11 +668,6 @@ hwbreakpoint: | |||
656 | nop | 668 | nop |
657 | 669 | ||
658 | IRQ1_interrupt: | 670 | IRQ1_interrupt: |
659 | |||
660 | #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) | ||
661 | ;; If we receive a watchdog interrupt while it is not expected, then set | ||
662 | ;; up a canonical frame and dump register contents before dying. | ||
663 | |||
664 | ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! | 671 | ;; this prologue MUST match the one in irq.h and the struct in ptregs.h!!! |
665 | move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame | 672 | move $brp,[$sp=$sp-16]; instruction pointer and room for a fake SBFS frame |
666 | push $srp | 673 | push $srp |
@@ -672,9 +679,16 @@ IRQ1_interrupt: | |||
672 | push $r10 ; push orig_r10 | 679 | push $r10 ; push orig_r10 |
673 | clear.d [$sp=$sp-4] ; frametype == 0, normal frame | 680 | clear.d [$sp=$sp-4] ; frametype == 0, normal frame |
674 | 681 | ||
675 | ;; We don't check that we actually were bit by the watchdog as opposed to | 682 | move.d [R_IRQ_MASK0_RD], $r1 ; External NMI or watchdog? |
676 | ;; an external NMI, since there is currently no handler for external NMI. | 683 | and.d 0x80000000, $r1 |
677 | 684 | beq wdog | |
685 | move.d $sp, $r10 | ||
686 | jsr handle_nmi | ||
687 | setf m ; Enable NMI again | ||
688 | retb ; Return from NMI | ||
689 | nop | ||
690 | wdog: | ||
691 | #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM) | ||
678 | ;; Check if we're waiting for reset to happen, as signalled by | 692 | ;; Check if we're waiting for reset to happen, as signalled by |
679 | ;; hard_reset_now setting cause_of_death to a magic value. If so, just | 693 | ;; hard_reset_now setting cause_of_death to a magic value. If so, just |
680 | ;; get stuck until reset happens. | 694 | ;; get stuck until reset happens. |
@@ -1118,6 +1132,10 @@ sys_call_table: | |||
1118 | .long sys_mq_getsetattr | 1132 | .long sys_mq_getsetattr |
1119 | .long sys_ni_syscall /* reserved for kexec */ | 1133 | .long sys_ni_syscall /* reserved for kexec */ |
1120 | .long sys_waitid | 1134 | .long sys_waitid |
1135 | .long sys_ni_syscall /* 285 */ /* available */ | ||
1136 | .long sys_add_key | ||
1137 | .long sys_request_key | ||
1138 | .long sys_keyctl | ||
1121 | 1139 | ||
1122 | /* | 1140 | /* |
1123 | * NOTE!! This doesn't have to be exact - we just have | 1141 | * NOTE!! This doesn't have to be exact - we just have |
diff --git a/arch/cris/arch-v10/kernel/kgdb.c b/arch/cris/arch-v10/kernel/kgdb.c index 7d368c877ee9..b72e6a91a639 100644 --- a/arch/cris/arch-v10/kernel/kgdb.c +++ b/arch/cris/arch-v10/kernel/kgdb.c | |||
@@ -18,6 +18,10 @@ | |||
18 | *! Jul 21 1999 Bjorn Wesen eLinux port | 18 | *! Jul 21 1999 Bjorn Wesen eLinux port |
19 | *! | 19 | *! |
20 | *! $Log: kgdb.c,v $ | 20 | *! $Log: kgdb.c,v $ |
21 | *! Revision 1.6 2005/01/14 10:12:17 starvik | ||
22 | *! KGDB on separate port. | ||
23 | *! Console fixes from 2.4. | ||
24 | *! | ||
21 | *! Revision 1.5 2004/10/07 13:59:08 starvik | 25 | *! Revision 1.5 2004/10/07 13:59:08 starvik |
22 | *! Corrected call to set_int_vector | 26 | *! Corrected call to set_int_vector |
23 | *! | 27 | *! |
@@ -71,7 +75,7 @@ | |||
71 | *! | 75 | *! |
72 | *!--------------------------------------------------------------------------- | 76 | *!--------------------------------------------------------------------------- |
73 | *! | 77 | *! |
74 | *! $Id: kgdb.c,v 1.5 2004/10/07 13:59:08 starvik Exp $ | 78 | *! $Id: kgdb.c,v 1.6 2005/01/14 10:12:17 starvik Exp $ |
75 | *! | 79 | *! |
76 | *! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN | 80 | *! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN |
77 | *! | 81 | *! |
@@ -225,6 +229,7 @@ | |||
225 | #include <linux/kernel.h> | 229 | #include <linux/kernel.h> |
226 | #include <linux/delay.h> | 230 | #include <linux/delay.h> |
227 | #include <linux/linkage.h> | 231 | #include <linux/linkage.h> |
232 | #include <linux/reboot.h> | ||
228 | 233 | ||
229 | #include <asm/setup.h> | 234 | #include <asm/setup.h> |
230 | #include <asm/ptrace.h> | 235 | #include <asm/ptrace.h> |
@@ -1344,12 +1349,11 @@ handle_exception (int sigval) | |||
1344 | } | 1349 | } |
1345 | } | 1350 | } |
1346 | 1351 | ||
1347 | /* The jump is to the address 0x00000002. Performs a complete re-start | 1352 | /* Performs a complete re-start from scratch. */ |
1348 | from scratch. */ | ||
1349 | static void | 1353 | static void |
1350 | kill_restart () | 1354 | kill_restart () |
1351 | { | 1355 | { |
1352 | __asm__ volatile ("jump 2"); | 1356 | machine_restart(""); |
1353 | } | 1357 | } |
1354 | 1358 | ||
1355 | /********************************** Breakpoint *******************************/ | 1359 | /********************************** Breakpoint *******************************/ |
@@ -1506,6 +1510,11 @@ kgdb_handle_serial: | |||
1506 | bne goback | 1510 | bne goback |
1507 | nop | 1511 | nop |
1508 | 1512 | ||
1513 | move.d [reg+0x5E], $r10 ; Get DCCR | ||
1514 | btstq 8, $r10 ; Test the U-flag. | ||
1515 | bmi goback | ||
1516 | nop | ||
1517 | |||
1509 | ;; | 1518 | ;; |
1510 | ;; Handle the communication | 1519 | ;; Handle the communication |
1511 | ;; | 1520 | ;; |
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c index 87ff37790827..69e28b4057e8 100644 --- a/arch/cris/arch-v10/kernel/process.c +++ b/arch/cris/arch-v10/kernel/process.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: process.c,v 1.9 2004/10/19 13:07:37 starvik Exp $ | 1 | /* $Id: process.c,v 1.12 2004/12/27 11:18:32 starvik Exp $ |
2 | * | 2 | * |
3 | * linux/arch/cris/kernel/process.c | 3 | * linux/arch/cris/kernel/process.c |
4 | * | 4 | * |
@@ -101,6 +101,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
101 | regs.r11 = (unsigned long)fn; | 101 | regs.r11 = (unsigned long)fn; |
102 | regs.r12 = (unsigned long)arg; | 102 | regs.r12 = (unsigned long)arg; |
103 | regs.irp = (unsigned long)kernel_thread_helper; | 103 | regs.irp = (unsigned long)kernel_thread_helper; |
104 | regs.dccr = 1 << I_DCCR_BITNR; | ||
104 | 105 | ||
105 | /* Ok, create the new process.. */ | 106 | /* Ok, create the new process.. */ |
106 | return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); | 107 | return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); |