1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#include <linux/sys.h>
19#include <linux/linkage.h>
20
21#include <asm/entry.h>
22#include <asm/current.h>
23#include <asm/processor.h>
24#include <asm/exceptions.h>
25#include <asm/asm-offsets.h>
26#include <asm/thread_info.h>
27
28#include <asm/page.h>
29#include <asm/unistd.h>
30
31#include <linux/errno.h>
32#include <asm/signal.h>
33
34#undef DEBUG
35
36#ifdef DEBUG
37
38.section .data
39.global syscall_debug_table
40.align 4
41syscall_debug_table:
42 .space (__NR_syscalls * 4)
43#endif
44
45#define C_ENTRY(name) .globl name; .align 4; name
46
47
48
49
50
51
52
53 .macro clear_bip
54 msrclr r0, MSR_BIP
55 .endm
56
57 .macro set_bip
58 msrset r0, MSR_BIP
59 .endm
60
61 .macro clear_eip
62 msrclr r0, MSR_EIP
63 .endm
64
65 .macro set_ee
66 msrset r0, MSR_EE
67 .endm
68
69 .macro disable_irq
70 msrclr r0, MSR_IE
71 .endm
72
73 .macro enable_irq
74 msrset r0, MSR_IE
75 .endm
76
77 .macro set_ums
78 msrset r0, MSR_UMS
79 msrclr r0, MSR_VMS
80 .endm
81
82 .macro set_vms
83 msrclr r0, MSR_UMS
84 msrset r0, MSR_VMS
85 .endm
86
87 .macro clear_ums
88 msrclr r0, MSR_UMS
89 .endm
90
91 .macro clear_vms_ums
92 msrclr r0, MSR_VMS | MSR_UMS
93 .endm
94#else
95 .macro clear_bip
96 mfs r11, rmsr
97 andi r11, r11, ~MSR_BIP
98 mts rmsr, r11
99 .endm
100
101 .macro set_bip
102 mfs r11, rmsr
103 ori r11, r11, MSR_BIP
104 mts rmsr, r11
105 .endm
106
107 .macro clear_eip
108 mfs r11, rmsr
109 andi r11, r11, ~MSR_EIP
110 mts rmsr, r11
111 .endm
112
113 .macro set_ee
114 mfs r11, rmsr
115 ori r11, r11, MSR_EE
116 mts rmsr, r11
117 .endm
118
119 .macro disable_irq
120 mfs r11, rmsr
121 andi r11, r11, ~MSR_IE
122 mts rmsr, r11
123 .endm
124
125 .macro enable_irq
126 mfs r11, rmsr
127 ori r11, r11, MSR_IE
128 mts rmsr, r11
129 .endm
130
131 .macro set_ums
132 mfs r11, rmsr
133 ori r11, r11, MSR_VMS
134 andni r11, r11, MSR_UMS
135 mts rmsr, r11
136 .endm
137
138 .macro set_vms
139 mfs r11, rmsr
140 ori r11, r11, MSR_VMS
141 andni r11, r11, MSR_UMS
142 mts rmsr, r11
143 .endm
144
145 .macro clear_ums
146 mfs r11, rmsr
147 andni r11, r11, MSR_UMS
148 mts rmsr,r11
149 .endm
150
151 .macro clear_vms_ums
152 mfs r11, rmsr
153 andni r11, r11, (MSR_VMS|MSR_UMS)
154 mts rmsr,r11
155 .endm
156#endif
157
158
159
160
161
162
163
164#define VM_ON \
165 set_ums; \
166 rted r0, 2f; \
167 nop; \
1682:
169
170
171#define VM_OFF \
172 clear_vms_ums; \
173 rted r0, TOPHYS(1f); \
174 nop; \
1751:
176
177#define SAVE_REGS \
178 swi r2, r1, PT_R2; \
179 swi r3, r1, PT_R3; \
180 swi r4, r1, PT_R4; \
181 swi r5, r1, PT_R5; \
182 swi r6, r1, PT_R6; \
183 swi r7, r1, PT_R7; \
184 swi r8, r1, PT_R8; \
185 swi r9, r1, PT_R9; \
186 swi r10, r1, PT_R10; \
187 swi r11, r1, PT_R11; \
188 swi r12, r1, PT_R12; \
189 swi r13, r1, PT_R13; \
190 swi r14, r1, PT_PC; \
191 swi r15, r1, PT_R15; \
192 swi r16, r1, PT_R16; \
193 swi r17, r1, PT_R17; \
194 swi r18, r1, PT_R18; \
195 swi r19, r1, PT_R19; \
196 swi r20, r1, PT_R20; \
197 swi r21, r1, PT_R21; \
198 swi r22, r1, PT_R22; \
199 swi r23, r1, PT_R23; \
200 swi r24, r1, PT_R24; \
201 swi r25, r1, PT_R25; \
202 swi r26, r1, PT_R26; \
203 swi r27, r1, PT_R27; \
204 swi r28, r1, PT_R28; \
205 swi r29, r1, PT_R29; \
206 swi r30, r1, PT_R30; \
207 swi r31, r1, PT_R31; \
208 mfs r11, rmsr; \
209 swi r11, r1, PT_MSR;
210
211#define RESTORE_REGS \
212 lwi r11, r1, PT_MSR; \
213 mts rmsr , r11; \
214 lwi r2, r1, PT_R2; \
215 lwi r3, r1, PT_R3; \
216 lwi r4, r1, PT_R4; \
217 lwi r5, r1, PT_R5; \
218 lwi r6, r1, PT_R6; \
219 lwi r7, r1, PT_R7; \
220 lwi r8, r1, PT_R8; \
221 lwi r9, r1, PT_R9; \
222 lwi r10, r1, PT_R10; \
223 lwi r11, r1, PT_R11; \
224 lwi r12, r1, PT_R12; \
225 lwi r13, r1, PT_R13; \
226 lwi r14, r1, PT_PC; \
227 lwi r15, r1, PT_R15; \
228 lwi r16, r1, PT_R16; \
229 lwi r17, r1, PT_R17; \
230 lwi r18, r1, PT_R18; \
231 lwi r19, r1, PT_R19; \
232 lwi r20, r1, PT_R20; \
233 lwi r21, r1, PT_R21; \
234 lwi r22, r1, PT_R22; \
235 lwi r23, r1, PT_R23; \
236 lwi r24, r1, PT_R24; \
237 lwi r25, r1, PT_R25; \
238 lwi r26, r1, PT_R26; \
239 lwi r27, r1, PT_R27; \
240 lwi r28, r1, PT_R28; \
241 lwi r29, r1, PT_R29; \
242 lwi r30, r1, PT_R30; \
243 lwi r31, r1, PT_R31;
244
245#define SAVE_STATE \
246 swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)); \
247 \
248 mfs r1, rmsr; \
249 andi r1, r1, MSR_UMS; \
250 bnei r1, 1f; \
251 \
252 \
253 lwi r1, r0, TOPHYS(PER_CPU(ENTRY_SP)); \
254 \
255 \
256 \
257 addik r1, r1, CONFIG_KERNEL_BASE_ADDR - CONFIG_KERNEL_START - PT_SIZE; \
258 SAVE_REGS \
259 brid 2f; \
260 swi r1, r1, PT_MODE; \
2611: \
262 lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE)); \
263 tophys(r1,r1); \
264 lwi r1, r1, TS_THREAD_INFO; \
265 \
266 \
267 \
268 \
269 addik r1, r1, THREAD_SIZE + CONFIG_KERNEL_BASE_ADDR - CONFIG_KERNEL_START - PT_SIZE; \
270 SAVE_REGS \
271 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP)); \
272 swi r11, r1, PT_R1; \
273 swi r0, r1, PT_MODE; \
274 \
275 clear_ums; \
2762: lwi CURRENT_TASK, r0, TOPHYS(PER_CPU(CURRENT_SAVE));
277
278.text
279
280
281
282
283
284
285
286
287
288
289
290
291
292C_ENTRY(_user_exception):
293 swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP))
294 addi r14, r14, 4
295
296 lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE));
297 tophys(r1,r1);
298 lwi r1, r1, TS_THREAD_INFO;
299
300 addik r1, r1, THREAD_SIZE;
301 tophys(r1,r1);
302
303 addik r1, r1, -PT_SIZE;
304 SAVE_REGS
305 swi r0, r1, PT_R3
306 swi r0, r1, PT_R4
307
308 swi r0, r1, PT_MODE;
309 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP));
310 swi r11, r1, PT_R1;
311 clear_ums;
3122: lwi CURRENT_TASK, r0, TOPHYS(PER_CPU(CURRENT_SAVE));
313
314 swi r12, r1, PT_R0;
315 tovirt(r1,r1)
316
317
318
319
320
321
322
323
324 rtbd r0, 3f
325 nop
3263:
327 lwi r11, CURRENT_TASK, TS_THREAD_INFO
328 lwi r11, r11, TI_FLAGS
329 andi r11, r11, _TIF_WORK_SYSCALL_MASK
330 beqi r11, 4f
331
332 addik r3, r0, -ENOSYS
333 swi r3, r1, PT_R3
334 brlid r15, do_syscall_trace_enter
335 addik r5, r1, PT_R0
336
337
338 addk r12, r0, r3
339 lwi r5, r1, PT_R5;
340 lwi r6, r1, PT_R6;
341 lwi r7, r1, PT_R7;
342 lwi r8, r1, PT_R8;
343 lwi r9, r1, PT_R9;
344 lwi r10, r1, PT_R10;
3454:
346
347
348
349
350
351 blti r12, 5f
352 addi r11, r12, -__NR_syscalls;
353 bgei r11, 5f;
354
355
356 add r12, r12, r12;
357 add r12, r12, r12;
358 addi r30, r0, 1
359
360#ifdef DEBUG
361
362
363 lwi r3, r0, syscall_debug_table
364 addi r3, r3, 1
365 swi r3, r0, syscall_debug_table
366 lwi r3, r12, syscall_debug_table
367 addi r3, r3, 1
368 swi r3, r12, syscall_debug_table
369#endif
370
371
372 lwi r12, r12, sys_call_table
373
374 addi r15, r0, ret_from_trap-8
375 bra r12
376
377
3785:
379 braid ret_from_trap
380 addi r3, r0, -ENOSYS;
381
382
383
384C_ENTRY(ret_from_trap):
385 swi r3, r1, PT_R3
386 swi r4, r1, PT_R4
387
388 lwi r11, r1, PT_MODE;
389
390 bnei r11, 2f;
391
392
393
394 lwi r11, CURRENT_TASK, TS_THREAD_INFO;
395 lwi r11, r11, TI_FLAGS;
396 andi r11, r11, _TIF_WORK_SYSCALL_MASK
397 beqi r11, 1f
398
399 brlid r15, do_syscall_trace_leave
400 addik r5, r1, PT_R0
4011:
402
403
404
405 lwi r11, CURRENT_TASK, TS_THREAD_INFO;
406 lwi r19, r11, TI_FLAGS;
407 andi r11, r19, _TIF_NEED_RESCHED;
408 beqi r11, 5f;
409
410 bralid r15, schedule;
411 nop;
412 bri 1b
413
414
4155:
416 andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
417 beqi r11, 4f;
418
419 addik r5, r1, 0;
420 bralid r15, do_notify_resume;
421 add r6, r30, r0;
422 add r30, r0, r0
423 bri 1b
424
425
4264: set_bip;
427 swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE);
428 VM_OFF;
429 tophys(r1,r1);
430 RESTORE_REGS;
431 addik r1, r1, PT_SIZE
432 lwi r1, r1, PT_R1 - PT_SIZE;
433 bri 6f;
434
435
4362: set_bip;
437 VM_OFF;
438 tophys(r1,r1);
439 RESTORE_REGS;
440 addik r1, r1, PT_SIZE
441 tovirt(r1,r1);
4426:
443TRAP_return:
444 rtbd r14, 0;
445 nop;
446
447
448
449
450
451
452
453C_ENTRY(ret_from_fork):
454 bralid r15, schedule_tail;
455 add r5, r3, r0;
456
457 brid ret_from_trap;
458 add r3, r0, r0;
459
460C_ENTRY(ret_from_kernel_thread):
461 bralid r15, schedule_tail;
462 add r5, r3, r0;
463
464 brald r15, r20
465 addk r5, r0, r19
466 brid ret_from_trap
467 add r3, r0, r0
468
469C_ENTRY(sys_rt_sigreturn_wrapper):
470 addik r30, r0, 0
471 brid sys_rt_sigreturn
472 addik r5, r1, 0;
473
474
475
476
477C_ENTRY(full_exception_trap):
478
479
480 addik r17, r17, -4
481 SAVE_STATE
482
483 swi r17, r1, PT_PC;
484 tovirt(r1,r1)
485
486
487
488 addik r15, r0, ret_from_exc - 8
489 mfs r6, resr
490 mfs r7, rfsr;
491 mts rfsr, r0;
492 rted r0, full_exception
493 addik r5, r1, 0
494
495
496
497
498
499
500
501
502
503
504
505C_ENTRY(unaligned_data_trap):
506
507
508
509
510
511
512 swi r11, r0, TOPHYS(PER_CPU(ENTRY_SP));
513 set_bip;
514 clear_eip;
515 set_ee;
516 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP));
517 SAVE_STATE
518
519 swi r17, r1, PT_PC;
520 tovirt(r1,r1)
521
522 addik r15, r0, ret_from_exc-8
523 mfs r3, resr
524 mfs r4, rear
525 rtbd r0, _unaligned_data_exception
526 addik r7, r1, 0
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546C_ENTRY(page_fault_data_trap):
547 SAVE_STATE
548
549 swi r17, r1, PT_PC;
550 tovirt(r1,r1)
551
552 addik r15, r0, ret_from_exc-8
553 mfs r6, rear
554 mfs r7, resr
555 rted r0, do_page_fault
556 addik r5, r1, 0
557
558C_ENTRY(page_fault_instr_trap):
559 SAVE_STATE
560
561 swi r17, r1, PT_PC;
562 tovirt(r1,r1)
563
564 addik r15, r0, ret_from_exc-8
565 mfs r6, rear
566 ori r7, r0, 0
567 rted r0, do_page_fault
568 addik r5, r1, 0
569
570
571C_ENTRY(ret_from_exc):
572 lwi r11, r1, PT_MODE;
573 bnei r11, 2f;
574
575
576
577
5781:
579 lwi r11, CURRENT_TASK, TS_THREAD_INFO;
580 lwi r19, r11, TI_FLAGS;
581 andi r11, r19, _TIF_NEED_RESCHED;
582 beqi r11, 5f;
583
584
585 bralid r15, schedule;
586 nop;
587 bri 1b
588
589
5905: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
591 beqi r11, 4f;
592
593
594
595
596
597
598
599
600
601
602
603
604 addik r5, r1, 0;
605 bralid r15, do_notify_resume;
606 addi r6, r0, 0;
607 bri 1b
608
609
6104: set_bip;
611 swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE);
612 VM_OFF;
613 tophys(r1,r1);
614
615 RESTORE_REGS;
616 addik r1, r1, PT_SIZE
617
618 lwi r1, r1, PT_R1 - PT_SIZE;
619 bri 6f;
620
6212: set_bip;
622 VM_OFF;
623 tophys(r1,r1);
624 RESTORE_REGS;
625 addik r1, r1, PT_SIZE
626
627 tovirt(r1,r1);
6286:
629EXC_return:
630 rtbd r14, 0;
631 nop;
632
633
634
635
636
637
638
639
640
641
642
643C_ENTRY(_interrupt):
644
645
646 swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP))
647
648 mfs r1, rmsr
649 nop
650 andi r1, r1, MSR_UMS
651 bnei r1, 1f
652
653
654 lwi r1, r0, TOPHYS(PER_CPU(ENTRY_SP))
655 tophys(r1,r1);
656
657
658 addik r1, r1, -PT_SIZE;
659 SAVE_REGS
660 brid 2f;
661 swi r1, r1, PT_MODE;
6621:
663
664
665 lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE));
666 tophys(r1,r1);
667 lwi r1, r1, TS_THREAD_INFO;
668 addik r1, r1, THREAD_SIZE;
669 tophys(r1,r1);
670
671 addik r1, r1, -PT_SIZE;
672 SAVE_REGS
673
674 swi r0, r1, PT_MODE;
675 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP));
676 swi r11, r1, PT_R1;
677 clear_ums;
6782:
679 lwi CURRENT_TASK, r0, TOPHYS(PER_CPU(CURRENT_SAVE));
680 tovirt(r1,r1)
681 addik r15, r0, irq_call;
682irq_call:rtbd r0, do_IRQ;
683 addik r5, r1, 0;
684
685
686ret_from_irq:
687 lwi r11, r1, PT_MODE;
688 bnei r11, 2f;
689
6901:
691 lwi r11, CURRENT_TASK, TS_THREAD_INFO;
692 lwi r19, r11, TI_FLAGS;
693 andi r11, r19, _TIF_NEED_RESCHED;
694 beqi r11, 5f
695 bralid r15, schedule;
696 nop;
697 bri 1b
698
699
7005: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
701 beqid r11, no_intr_resched
702
703 addik r5, r1, 0;
704 bralid r15, do_notify_resume;
705 addi r6, r0, 0;
706 bri 1b
707
708
709no_intr_resched:
710
711 disable_irq
712 swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE);
713 VM_OFF;
714 tophys(r1,r1);
715 RESTORE_REGS
716 addik r1, r1, PT_SIZE
717 lwi r1, r1, PT_R1 - PT_SIZE;
718 bri 6f;
719
7202:
721#ifdef CONFIG_PREEMPT
722 lwi r11, CURRENT_TASK, TS_THREAD_INFO;
723
724 lwi r5, r11, TI_PREEMPT_COUNT;
725 bgti r5, restore;
726
727 lwi r5, r11, TI_FLAGS;
728 andi r5, r5, _TIF_NEED_RESCHED;
729 beqi r5, restore
730
731preempt:
732
733 bralid r15, preempt_schedule_irq
734 nop
735 lwi r11, CURRENT_TASK, TS_THREAD_INFO;
736 lwi r5, r11, TI_FLAGS;
737 andi r5, r5, _TIF_NEED_RESCHED;
738 bnei r5, preempt
739restore:
740#endif
741 VM_OFF
742 tophys(r1,r1)
743 RESTORE_REGS
744 addik r1, r1, PT_SIZE
745 tovirt(r1,r1);
7466:
747IRQ_return:
748 rtid r14, 0
749 nop
750
751
752
753
754
755C_ENTRY(_debug_exception):
756
757 swi r1, r0, TOPHYS(PER_CPU(ENTRY_SP))
758
759 mfs r1, rmsr
760 nop
761 andi r1, r1, MSR_UMS
762 bnei r1, 1f
763
764 lwi r1, r0, TOPHYS(PER_CPU(ENTRY_SP));
765
766
767 addik r1, r1, CONFIG_KERNEL_BASE_ADDR - CONFIG_KERNEL_START - PT_SIZE;
768 SAVE_REGS;
769
770 swi r0, r1, PT_R0;
771 swi r14, r1, PT_R14
772 swi r16, r1, PT_PC;
773
774 mfs r11, rear;
775 swi r11, r1, PT_EAR;
776 mfs r11, resr;
777 swi r11, r1, PT_ESR;
778 mfs r11, rfsr;
779 swi r11, r1, PT_FSR;
780
781
782
783 addik r11, r1, CONFIG_KERNEL_START - CONFIG_KERNEL_BASE_ADDR + PT_SIZE;
784 swi r11, r1, PT_R1
785
786 tovirt(r1,r1)
787#ifdef CONFIG_KGDB
788 addi r5, r1, 0
789 addik r15, r0, dbtrap_call;
790 rtbd r0, microblaze_kgdb_break
791 nop;
792#endif
793
794
795 bri 0
796
797
7981: lwi r1, r0, TOPHYS(PER_CPU(CURRENT_SAVE));
799 tophys(r1,r1);
800 lwi r1, r1, TS_THREAD_INFO;
801 addik r1, r1, THREAD_SIZE;
802 tophys(r1,r1);
803
804 addik r1, r1, -PT_SIZE;
805 SAVE_REGS;
806 swi r16, r1, PT_PC;
807 swi r0, r1, PT_MODE;
808 lwi r11, r0, TOPHYS(PER_CPU(ENTRY_SP));
809 swi r11, r1, PT_R1;
810 lwi CURRENT_TASK, r0, TOPHYS(PER_CPU(CURRENT_SAVE));
811 tovirt(r1,r1)
812 set_vms;
813 addik r5, r1, 0;
814 addik r15, r0, dbtrap_call;
815dbtrap_call:
816 rtbd r0, sw_exception
817 nop
818
819
820 set_bip;
821 lwi r11, r1, PT_MODE;
822 bnei r11, 2f;
823
8241:
825
826 lwi r11, CURRENT_TASK, TS_THREAD_INFO;
827 lwi r19, r11, TI_FLAGS;
828 andi r11, r19, _TIF_NEED_RESCHED;
829 beqi r11, 5f;
830
831
832 bralid r15, schedule;
833 nop;
834 bri 1b
835
836
8375: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME;
838 beqi r11, 4f;
839
840 addik r5, r1, 0;
841 bralid r15, do_notify_resume;
842 addi r6, r0, 0;
843 bri 1b
844
845
8464: swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE);
847 VM_OFF;
848 tophys(r1,r1);
849
850 RESTORE_REGS
851 addik r1, r1, PT_SIZE
852 lwi r1, r1, PT_R1 - PT_SIZE;
853DBTRAP_return_user:
854 rtbd r16, 0;
855 nop;
856
857
8582: VM_OFF;
859 tophys(r1,r1);
860
861 RESTORE_REGS
862 lwi r14, r1, PT_R14;
863 lwi r16, r1, PT_PC;
864 addik r1, r1, PT_SIZE;
865 tovirt(r1,r1);
866DBTRAP_return_kernel:
867 rtbd r16, 0;
868 nop;
869
870
871ENTRY(_switch_to)
872
873 addk r3, r0, CURRENT_TASK
874
875
876
877
878 addik r11, r5, TI_CPU_CONTEXT
879 swi r1, r11, CC_R1
880 swi r2, r11, CC_R2
881
882
883
884 swi r13, r11, CC_R13
885 swi r14, r11, CC_R14
886 swi r15, r11, CC_R15
887 swi r16, r11, CC_R16
888 swi r17, r11, CC_R17
889 swi r18, r11, CC_R18
890
891 swi r19, r11, CC_R19
892 swi r20, r11, CC_R20
893 swi r21, r11, CC_R21
894 swi r22, r11, CC_R22
895 swi r23, r11, CC_R23
896 swi r24, r11, CC_R24
897 swi r25, r11, CC_R25
898 swi r26, r11, CC_R26
899 swi r27, r11, CC_R27
900 swi r28, r11, CC_R28
901 swi r29, r11, CC_R29
902 swi r30, r11, CC_R30
903
904 mfs r12, rmsr
905 swi r12, r11, CC_MSR
906 mfs r12, rear
907 swi r12, r11, CC_EAR
908 mfs r12, resr
909 swi r12, r11, CC_ESR
910 mfs r12, rfsr
911 swi r12, r11, CC_FSR
912
913
914 lwi CURRENT_TASK, r6, TI_TASK
915
916 swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE)
917
918
919
920 addik r11, r6, TI_CPU_CONTEXT
921
922
923 lwi r30, r11, CC_R30
924 lwi r29, r11, CC_R29
925 lwi r28, r11, CC_R28
926 lwi r27, r11, CC_R27
927 lwi r26, r11, CC_R26
928 lwi r25, r11, CC_R25
929 lwi r24, r11, CC_R24
930 lwi r23, r11, CC_R23
931 lwi r22, r11, CC_R22
932 lwi r21, r11, CC_R21
933 lwi r20, r11, CC_R20
934 lwi r19, r11, CC_R19
935
936 lwi r18, r11, CC_R18
937 lwi r17, r11, CC_R17
938 lwi r16, r11, CC_R16
939 lwi r15, r11, CC_R15
940 lwi r14, r11, CC_R14
941 lwi r13, r11, CC_R13
942
943 lwi r2, r11, CC_R2
944 lwi r1, r11, CC_R1
945
946
947 lwi r12, r11, CC_FSR
948 mts rfsr, r12
949 lwi r12, r11, CC_MSR
950 mts rmsr, r12
951
952 rtsd r15, 8
953 nop
954
955ENTRY(_reset)
956 brai 0;
957
958
959
960 .section .init.ivt, "ax"
961
962 .org 0x0
963 brai CONFIG_MANUAL_RESET_VECTOR
964#endif
965 .org 0x8
966 brai TOPHYS(_user_exception);
967 .org 0x10
968 brai TOPHYS(_interrupt);
969 .org 0x18
970 brai TOPHYS(_debug_exception);
971 .org 0x20
972 brai TOPHYS(_hw_exception_handler);
973
974.section .rodata,"a"
975#include "syscall_table.S"
976
977syscall_table_size=(.-sys_call_table)
978
979type_SYSCALL:
980 .ascii "SYSCALL\0"
981type_IRQ:
982 .ascii "IRQ\0"
983type_IRQ_PREEMPT:
984 .ascii "IRQ (PREEMPTED)\0"
985type_SYSCALL_PREEMPT:
986 .ascii " SYSCALL (PREEMPTED)\0"
987
988
989
990
991
992
993
994
995 .align 4
996.global microblaze_trap_handlers
997microblaze_trap_handlers:
998
999 .word ret_from_trap; .word ret_from_trap ; .word type_SYSCALL
1000 .word ret_from_irq ; .word ret_from_irq ; .word type_IRQ
1001
1002 .word ret_from_irq ; .word no_intr_resched ; .word type_IRQ_PREEMPT
1003 .word ret_from_trap; .word TRAP_return ; .word type_SYSCALL_PREEMPT
1004
1005 .word 0 ; .word 0 ; .word 0
1006