aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2010-08-02 12:05:17 -0400
committerJesper Nilsson <jesper.nilsson@axis.com>2010-08-04 06:59:43 -0400
commita80a635f3d60e4aa61f96d22a122071cb061be93 (patch)
tree93dc8e4b0f345448b20ecc461767369b4eea46b2 /arch
parentb4973ae9dac3397499f5576c591d5c5bf51c68c6 (diff)
CRIS: Add debug for assembler functions
Signed-off-by: Edgar Iglesias <Edgar.Iglesias@axis.com> Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/cris/arch-v32/kernel/cacheflush.S5
-rw-r--r--arch/cris/arch-v32/kernel/entry.S25
2 files changed, 29 insertions, 1 deletions
diff --git a/arch/cris/arch-v32/kernel/cacheflush.S b/arch/cris/arch-v32/kernel/cacheflush.S
index 956e8fb82f01..6fc3d95d7029 100644
--- a/arch/cris/arch-v32/kernel/cacheflush.S
+++ b/arch/cris/arch-v32/kernel/cacheflush.S
@@ -1,4 +1,5 @@
1 .global cris_flush_cache_range 1 .global cris_flush_cache_range
2 .type cris_flush_cache_range, @function
2cris_flush_cache_range: 3cris_flush_cache_range:
3 move.d 1024, $r12 4 move.d 1024, $r12
4 cmp.d $r11, $r12 5 cmp.d $r11, $r12
@@ -80,8 +81,10 @@ cris_flush_1KB:
80 addq 32, $r10 81 addq 32, $r10
81 ba cris_flush_cache_range 82 ba cris_flush_cache_range
82 sub.d $r12, $r11 83 sub.d $r12, $r11
84 .size cris_flush_cache_range, . - cris_flush_cache_range
83 85
84 .global cris_flush_cache 86 .global cris_flush_cache
87 .type cris_flush_cache, @function
85cris_flush_cache: 88cris_flush_cache:
86 moveq 0, $r10 89 moveq 0, $r10
87cris_flush_line: 90cris_flush_line:
@@ -92,3 +95,5 @@ cris_flush_line:
92 fidxd [$r10] 95 fidxd [$r10]
93 ret 96 ret
94 nop 97 nop
98 .size cris_flush_cache, . - cris_flush_cache
99
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S
index 1f39861eac8c..7c14acb754a1 100644
--- a/arch/cris/arch-v32/kernel/entry.S
+++ b/arch/cris/arch-v32/kernel/entry.S
@@ -76,12 +76,15 @@ _need_resched:
76 76
77 ; Called at exit from fork. schedule_tail must be called to drop 77 ; Called at exit from fork. schedule_tail must be called to drop
78 ; spinlock if CONFIG_PREEMPT. 78 ; spinlock if CONFIG_PREEMPT.
79 .type ret_from_fork,@function
79ret_from_fork: 80ret_from_fork:
80 jsr schedule_tail 81 jsr schedule_tail
81 nop 82 nop
82 ba ret_from_sys_call 83 ba ret_from_sys_call
83 nop 84 nop
85 .size ret_from_fork, . - ret_from_fork
84 86
87 .type ret_from_intr,@function
85ret_from_intr: 88ret_from_intr:
86 ;; Check for resched if preemptive kernel, or if we're going back to 89 ;; Check for resched if preemptive kernel, or if we're going back to
87 ;; user-mode. This test matches the user_regs(regs) macro. Don't simply 90 ;; user-mode. This test matches the user_regs(regs) macro. Don't simply
@@ -91,9 +94,10 @@ ret_from_intr:
91 move.d [$acr], $r0 94 move.d [$acr], $r0
92 btstq 16, $r0 ; User-mode flag. 95 btstq 16, $r0 ; User-mode flag.
93 bpl _resume_kernel 96 bpl _resume_kernel
97 .size ret_from_intr, . - ret_from_intr + 2 ; +2 includes the dslot.
94 98
95 ; Note that di below is in delay slot. 99 ; Note that di below is in delay slot.
96 100 .type _resume_userspace,@function
97_resume_userspace: 101_resume_userspace:
98 di ; So need_resched and sigpending don't change. 102 di ; So need_resched and sigpending don't change.
99 103
@@ -107,6 +111,7 @@ _resume_userspace:
107 nop 111 nop
108 ba _Rexit 112 ba _Rexit
109 nop 113 nop
114 .size _resume_userspace, . - _resume_userspace
110 115
111 ;; The system_call is called by a BREAK instruction, which looks pretty 116 ;; The system_call is called by a BREAK instruction, which looks pretty
112 ;; much like any other exception. 117 ;; much like any other exception.
@@ -122,6 +127,7 @@ _resume_userspace:
122 ;; non-used instructions. Only the non-common cases cause the outlined code 127 ;; non-used instructions. Only the non-common cases cause the outlined code
123 ;; to run.. 128 ;; to run..
124 129
130 .type system_call,@function
125system_call: 131system_call:
126 ;; Stack-frame similar to the irq heads, which is reversed in 132 ;; Stack-frame similar to the irq heads, which is reversed in
127 ;; ret_from_sys_call. 133 ;; ret_from_sys_call.
@@ -217,7 +223,9 @@ ret_from_sys_call:
217 and.d _TIF_ALLWORK_MASK, $r1 223 and.d _TIF_ALLWORK_MASK, $r1
218 bne _syscall_exit_work 224 bne _syscall_exit_work
219 nop 225 nop
226 .size system_call, . - system_call
220 227
228 .type _Rexit,@function
221_Rexit: 229_Rexit:
222 ;; This epilogue MUST match the prologues in multiple_interrupt, irq.h 230 ;; This epilogue MUST match the prologues in multiple_interrupt, irq.h
223 ;; and ptregs.h. 231 ;; and ptregs.h.
@@ -234,10 +242,12 @@ _Rexit:
234 addq 8, $sp ; Skip EXS, EDA. 242 addq 8, $sp ; Skip EXS, EDA.
235 jump $erp 243 jump $erp
236 rfe ; Restore condition code stack in delay-slot. 244 rfe ; Restore condition code stack in delay-slot.
245 .size _Rexit, . - _Rexit
237 246
238 ;; We get here after doing a syscall if extra work might need to be done 247 ;; We get here after doing a syscall if extra work might need to be done
239 ;; perform syscall exit tracing if needed. 248 ;; perform syscall exit tracing if needed.
240 249
250 .type _syscall_exit_work,@function
241_syscall_exit_work: 251_syscall_exit_work:
242 ;; R0 contains current at this point and irq's are disabled. 252 ;; R0 contains current at this point and irq's are disabled.
243 253
@@ -253,14 +263,18 @@ _syscall_exit_work:
253 move.d $r1, $r9 263 move.d $r1, $r9
254 ba _resume_userspace 264 ba _resume_userspace
255 nop 265 nop
266 .size _syscall_exit_work, . - _syscall_exit_work
256 267
268 .type _work_pending,@function
257_work_pending: 269_work_pending:
258 addoq +TI_flags, $r0, $acr 270 addoq +TI_flags, $r0, $acr
259 move.d [$acr], $r10 271 move.d [$acr], $r10
260 btstq TIF_NEED_RESCHED, $r10 ; Need resched? 272 btstq TIF_NEED_RESCHED, $r10 ; Need resched?
261 bpl _work_notifysig ; No, must be signal/notify. 273 bpl _work_notifysig ; No, must be signal/notify.
262 nop 274 nop
275 .size _work_pending, . - _work_pending
263 276
277 .type _work_resched,@function
264_work_resched: 278_work_resched:
265 move.d $r9, $r1 ; Preserve R9. 279 move.d $r9, $r1 ; Preserve R9.
266 jsr schedule 280 jsr schedule
@@ -276,7 +290,9 @@ _work_resched:
276 btstq TIF_NEED_RESCHED, $r1 290 btstq TIF_NEED_RESCHED, $r1
277 bmi _work_resched ; current->work.need_resched. 291 bmi _work_resched ; current->work.need_resched.
278 nop 292 nop
293 .size _work_resched, . - _work_resched
279 294
295 .type _work_notifysig,@function
280_work_notifysig: 296_work_notifysig:
281 ;; Deal with pending signals and notify-resume requests. 297 ;; Deal with pending signals and notify-resume requests.
282 298
@@ -288,6 +304,7 @@ _work_notifysig:
288 304
289 ba _Rexit 305 ba _Rexit
290 nop 306 nop
307 .size _work_notifysig, . - _work_notifysig
291 308
292 ;; We get here as a sidetrack when we've entered a syscall with the 309 ;; We get here as a sidetrack when we've entered a syscall with the
293 ;; trace-bit set. We need to call do_syscall_trace and then continue 310 ;; trace-bit set. We need to call do_syscall_trace and then continue
@@ -329,6 +346,7 @@ _syscall_trace_entry:
329 ;; 346 ;;
330 ;; Returns old current in R10. 347 ;; Returns old current in R10.
331 348
349 .type resume,@function
332resume: 350resume:
333 subq 4, $sp 351 subq 4, $sp
334 move $srp, [$sp] ; Keep old/new PC on the stack. 352 move $srp, [$sp] ; Keep old/new PC on the stack.
@@ -364,6 +382,7 @@ resume:
364 move.d [$sp+], $acr 382 move.d [$sp+], $acr
365 jump $acr ; Restore PC. 383 jump $acr ; Restore PC.
366 nop 384 nop
385 .size resume, . - resume
367 386
368nmi_interrupt: 387nmi_interrupt:
369 388
@@ -426,6 +445,7 @@ spurious_interrupt:
426 ;; time. Jump to the first set interrupt bit in a priotiry fashion. The 445 ;; time. Jump to the first set interrupt bit in a priotiry fashion. The
427 ;; hardware will call the unserved interrupts after the handler 446 ;; hardware will call the unserved interrupts after the handler
428 ;; finishes. 447 ;; finishes.
448 .type multiple_interrupt, @function
429multiple_interrupt: 449multiple_interrupt:
430 ;; This prologue MUST match the one in irq.h and the struct in ptregs.h! 450 ;; This prologue MUST match the one in irq.h and the struct in ptregs.h!
431 subq 12, $sp ; Skip EXS, EDA. 451 subq 12, $sp ; Skip EXS, EDA.
@@ -458,6 +478,7 @@ multiple_interrupt:
458 move.d $sp, $r10 478 move.d $sp, $r10
459 jump ret_from_intr 479 jump ret_from_intr
460 nop 480 nop
481 .size multiple_interrupt, . - multiple_interrupt
461 482
462do_sigtrap: 483do_sigtrap:
463 ;; Sigtraps the process that executed the BREAK instruction. Creates a 484 ;; Sigtraps the process that executed the BREAK instruction. Creates a
@@ -514,11 +535,13 @@ _ugdb_handle_exception:
514 move.d [$sp+], $r0 ; Restore R0 in delay slot. 535 move.d [$sp+], $r0 ; Restore R0 in delay slot.
515 536
516 .global kernel_execve 537 .global kernel_execve
538 .type kernel_execve,@function
517kernel_execve: 539kernel_execve:
518 move.d __NR_execve, $r9 540 move.d __NR_execve, $r9
519 break 13 541 break 13
520 ret 542 ret
521 nop 543 nop
544 .size kernel_execve, . - kernel_execve
522 545
523 .data 546 .data
524 547