1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30#include <linux/linkage.h>
31#include <asm/thread_info.h>
32#include <asm/setup.h>
33#include <asm/segment.h>
34#include <asm/ptrace.h>
35#include <asm/errno.h>
36#include <asm/cache.h>
37#include <asm/spr-regs.h>
38
39#define nr_syscalls ((syscall_table_size)/4)
40
41 .section .text..entry
42 .balign 4
43
44.macro LEDS val
45
46
47
48
49
50
51
52
53.endm
54
55.macro LEDS32
56
57
58
59
60
61
62
63
64
65.endm
66
67
68
69
70
71
72 .globl __entry_uspace_external_interrupt
73 .type __entry_uspace_external_interrupt,@function
74__entry_uspace_external_interrupt:
75 LEDS 0x6200
76 sethi.p %hi(__kernel_frame0_ptr),gr28
77 setlo %lo(__kernel_frame0_ptr),gr28
78 ldi @(gr28,
79
80
81 sti gr0,@(gr28,
82
83 .globl __entry_uspace_external_interrupt_reentry
84__entry_uspace_external_interrupt_reentry:
85 LEDS 0x6201
86
87 setlos
88 dcpl gr28,gr30,
89
90
91 sti sp, @(gr28,
92 stdi gr2, @(gr28,
93 stdi gr4, @(gr28,
94 stdi gr6, @(gr28,
95 stdi gr8, @(gr28,
96 stdi gr10,@(gr28,
97 stdi gr12,@(gr28,
98 stdi gr14,@(gr28,
99 stdi gr16,@(gr28,
100 stdi gr18,@(gr28,
101 stdi gr20,@(gr28,
102 stdi gr22,@(gr28,
103 stdi gr24,@(gr28,
104 stdi gr26,@(gr28,
105 sti gr0, @(gr28,
106 sti gr29,@(gr28,
107 stdi.p gr30,@(gr28,
108
109
110 ori gr28,0,sp
111
112 movsg tbr ,gr20
113 movsg psr ,gr22
114 movsg pcsr,gr21
115 movsg isr ,gr23
116 movsg ccr ,gr24
117 movsg cccr,gr25
118 movsg lr ,gr26
119 movsg lcr ,gr27
120
121 setlos.p
122 andi gr22,
123 andi.p gr22,
124 slli gr5,
125 or gr6,gr5,gr5
126 andi gr5,
127
128 sti gr20,@(gr28,
129 sti gr21,@(gr28,
130 sti gr5 ,@(gr28,
131 sti gr23,@(gr28,
132 stdi gr24,@(gr28,
133 stdi gr26,@(gr28,
134 sti gr4 ,@(gr28,
135
136 movsg iacc0h,gr4
137 movsg iacc0l,gr5
138 stdi gr4,@(gr28,
139
140 movsg gner0,gr4
141 movsg gner1,gr5
142 stdi.p gr4,@(gr28,
143
144
145 subcc gr0,gr0,gr0,icc2
146
147
148 sethi.p %hi(__kernel_current_task),gr5
149 setlo %lo(__kernel_current_task),gr5
150 sethi.p %hi(_gp),gr16
151 setlo %lo(_gp),gr16
152 ldi @(gr5,
153 ldi.p @(gr29,
154
155
156 setlos
157 movgs gr5,isr
158
159
160 sethi.p %hi(__entry_kerneltrap_table),gr6
161 setlo %lo(__entry_kerneltrap_table),gr6
162 movgs gr6,tbr
163
164
165 sethi.p %hi(__entry_return_from_user_interrupt),gr4
166 setlo %lo(__entry_return_from_user_interrupt),gr4
167 movgs gr4,lr
168
169
170 movsg psr,gr4
171
172 ori gr4,
173 movgs gr4,psr
174 ori gr4,
175 movgs gr4,psr
176
177 LEDS 0x6202
178 bra do_IRQ
179
180 .size __entry_uspace_external_interrupt,.-__entry_uspace_external_interrupt
181
182
183
184
185
186
187
188
189
190
191
192
193 .globl __entry_kernel_external_interrupt
194 .type __entry_kernel_external_interrupt,@function
195__entry_kernel_external_interrupt:
196 LEDS 0x6210
197
198
199
200
201 or.p sp,gr0,gr30
202 subi sp,
203 sti gr30,@(sp,
204
205
206 sti gr0,@(sp,
207
208 .globl __entry_kernel_external_interrupt_reentry
209__entry_kernel_external_interrupt_reentry:
210 LEDS 0x6211
211
212
213 setlos
214 dcpl sp,gr30,
215
216 sti.p gr28,@(sp,
217 ori sp,0,gr28
218
219
220 stdi gr2,@(gr28,
221 stdi gr4,@(gr28,
222 stdi gr6,@(gr28,
223 stdi gr8,@(gr28,
224 stdi gr10,@(gr28,
225 stdi gr12,@(gr28,
226 stdi gr14,@(gr28,
227 stdi gr16,@(gr28,
228 stdi gr18,@(gr28,
229 stdi gr20,@(gr28,
230 stdi gr22,@(gr28,
231 stdi gr24,@(gr28,
232 stdi gr26,@(gr28,
233 sti gr29,@(gr28,
234 stdi.p gr30,@(gr28,
235
236
237 subicc gr0,
238
239 movsg tbr ,gr20
240 movsg psr ,gr22
241 movsg pcsr,gr21
242 movsg isr ,gr23
243 movsg ccr ,gr24
244 movsg cccr,gr25
245 movsg lr ,gr26
246 movsg lcr ,gr27
247
248 setlos.p
249 andi gr22,
250 andi.p gr22,
251 slli gr5,
252 or gr6,gr5,gr5
253 andi.p gr5,
254
255
256
257 andi gr25,
258
259 sti gr20,@(gr28,
260 sti gr21,@(gr28,
261 sti gr5 ,@(gr28,
262 sti gr23,@(gr28,
263 stdi gr24,@(gr28,
264 stdi gr26,@(gr28,
265 sti gr4 ,@(gr28,
266
267 movsg iacc0h,gr4
268 movsg iacc0l,gr5
269 stdi gr4,@(gr28,
270
271 movsg gner0,gr4
272 movsg gner1,gr5
273 stdi.p gr4,@(gr28,
274
275
276 subcc gr0,gr0,gr0,icc2
277
278
279 sethi.p %hi(__entry_return_from_kernel_interrupt),gr4
280 setlo %lo(__entry_return_from_kernel_interrupt),gr4
281 movgs gr4,lr
282
283
284 movsg hsr0,gr4
285 andi gr4,
286 movgs gr4,hsr0
287
288
289 movsg psr,gr4
290 ori gr4,
291 movgs gr4,psr
292 ori gr4,
293 movgs gr4,psr
294
295 LEDS 0x6212
296 bra do_IRQ
297
298 .size __entry_kernel_external_interrupt,.-__entry_kernel_external_interrupt
299
300
301
302
303
304
305
306
307 .balign L1_CACHE_BYTES
308 .globl __entry_kernel_external_interrupt_virtually_disabled
309 .type __entry_kernel_external_interrupt_virtually_disabled,@function
310__entry_kernel_external_interrupt_virtually_disabled:
311 movsg psr,gr30
312 andi gr30,
313 ori gr30,
314 movgs gr30,psr
315 subcc gr0,gr0,gr0,icc2 ; leave Z set, clear C
316 rett
317
318 .size __entry_kernel_external_interrupt_virtually_disabled,.-__entry_kernel_external_interrupt_virtually_disabled
319
320
321
322
323
324
325
326
327
328 .balign L1_CACHE_BYTES
329 .globl __entry_kernel_external_interrupt_virtual_reenable
330 .type __entry_kernel_external_interrupt_virtual_reenable,@function
331__entry_kernel_external_interrupt_virtual_reenable:
332 movsg psr,gr30
333 andi gr30,
334 movgs gr30,psr
335 subicc gr0,
336 rett
337
338 .size __entry_kernel_external_interrupt_virtual_reenable,.-__entry_kernel_external_interrupt_virtual_reenable
339
340
341
342
343
344
345 .globl __entry_uspace_softprog_interrupt
346 .type __entry_uspace_softprog_interrupt,@function
347 .globl __entry_uspace_handle_mmu_fault
348__entry_uspace_softprog_interrupt:
349 LEDS 0x6000
350#ifdef CONFIG_MMU
351 movsg ear0,gr28
352__entry_uspace_handle_mmu_fault:
353 movgs gr28,scr2
354#endif
355 sethi.p %hi(__kernel_frame0_ptr),gr28
356 setlo %lo(__kernel_frame0_ptr),gr28
357 ldi @(gr28,
358
359
360 sti gr0,@(gr28,
361
362 .globl __entry_uspace_softprog_interrupt_reentry
363__entry_uspace_softprog_interrupt_reentry:
364 LEDS 0x6001
365
366 setlos
367 dcpl gr28,gr30,
368
369
370 sti.p sp,@(gr28,
371 ori gr28,0,sp
372 sti gr0,@(gr28,
373
374 stdi gr20,@(gr28,
375 stdi gr22,@(gr28,
376
377 movsg tbr,gr20
378 movsg pcsr,gr21
379 movsg psr,gr22
380
381 sethi.p %hi(__entry_return_from_user_exception),gr23
382 setlo %lo(__entry_return_from_user_exception),gr23
383
384 bra __entry_common
385
386 .size __entry_uspace_softprog_interrupt,.-__entry_uspace_softprog_interrupt
387
388
389#ifdef CONFIG_MMU
390 .globl __entry_uspace_handle_mmu_fault_sstep
391__entry_uspace_handle_mmu_fault_sstep:
392 movgs gr28,scr2
393 sethi.p %hi(__kernel_frame0_ptr),gr28
394 setlo %lo(__kernel_frame0_ptr),gr28
395 ldi @(gr28,
396
397
398 sti gr0,@(gr28,
399 bra __entry_uspace_softprog_interrupt_reentry
400#endif
401
402
403
404
405
406
407
408 .globl __entry_kernel_softprog_interrupt
409 .type __entry_kernel_softprog_interrupt,@function
410__entry_kernel_softprog_interrupt:
411 LEDS 0x6004
412
413#ifdef CONFIG_MMU
414 movsg ear0,gr30
415 movgs gr30,scr2
416#endif
417
418 .globl __entry_kernel_handle_mmu_fault
419__entry_kernel_handle_mmu_fault:
420
421 subi sp,
422 sti sp,@(sp,
423 sti sp,@(sp,
424 andi sp,
425
426
427 sti gr0,@(sp,
428
429 .globl __entry_kernel_softprog_interrupt_reentry
430__entry_kernel_softprog_interrupt_reentry:
431 LEDS 0x6005
432
433 setlos
434 dcpl sp,gr30,
435
436
437 sti.p gr28,@(sp,
438 ori sp,0,gr28
439
440 stdi gr20,@(gr28,
441 stdi gr22,@(gr28,
442
443 ldi @(sp,
444 addi gr22,
445 sti gr22,@(sp,
446
447
448
449 movsg cccr,gr20
450 andi gr20,
451 movgs gr20,cccr
452
453 movsg tbr,gr20
454 movsg pcsr,gr21
455 movsg psr,gr22
456
457 sethi.p %hi(__entry_return_from_kernel_exception),gr23
458 setlo %lo(__entry_return_from_kernel_exception),gr23
459 bra __entry_common
460
461 .size __entry_kernel_softprog_interrupt,.-__entry_kernel_softprog_interrupt
462
463
464#ifdef CONFIG_MMU
465 .globl __entry_kernel_handle_mmu_fault_sstep
466__entry_kernel_handle_mmu_fault_sstep:
467
468 subi sp,
469 sti sp,@(sp,
470 sti sp,@(sp,
471 andi sp,
472
473
474 sethi
475 sti gr30,@(sp,
476 bra __entry_kernel_softprog_interrupt_reentry
477#endif
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496 .globl __entry_common
497 .type __entry_common,@function
498__entry_common:
499 LEDS 0x6008
500
501
502 stdi gr2,@(gr28,
503 stdi gr4,@(gr28,
504 stdi gr6,@(gr28,
505 stdi gr8,@(gr28,
506 stdi gr10,@(gr28,
507 stdi gr12,@(gr28,
508 stdi gr14,@(gr28,
509 stdi gr16,@(gr28,
510 stdi gr18,@(gr28,
511 stdi gr24,@(gr28,
512 stdi gr26,@(gr28,
513 sti gr29,@(gr28,
514 stdi gr30,@(gr28,
515
516 movsg lcr ,gr27
517 movsg lr ,gr26
518 movgs gr23,lr
519 movsg cccr,gr25
520 movsg ccr ,gr24
521 movsg isr ,gr23
522
523 setlos.p
524 andi gr22,
525 andi.p gr22,
526 slli gr5,
527 or gr6,gr5,gr5
528 andi gr5,
529
530 sti gr20,@(gr28,
531 sti gr21,@(gr28,
532 sti gr5 ,@(gr28,
533 sti gr23,@(gr28,
534 stdi gr24,@(gr28,
535 stdi gr26,@(gr28,
536 sti gr4 ,@(gr28,
537
538 movsg iacc0h,gr4
539 movsg iacc0l,gr5
540 stdi gr4,@(gr28,
541
542 movsg gner0,gr4
543 movsg gner1,gr5
544 stdi.p gr4,@(gr28,
545
546
547 subicc gr0,
548
549
550 sethi.p %hi(__kernel_current_task),gr5
551 setlo %lo(__kernel_current_task),gr5
552 sethi.p %hi(_gp),gr16
553 setlo %lo(_gp),gr16
554 ldi @(gr5,
555 ldi @(gr29,
556
557
558 sethi.p %hi(__entry_kerneltrap_table),gr6
559 setlo %lo(__entry_kerneltrap_table),gr6
560 movgs gr6,tbr
561
562
563 setlos
564 movgs gr5,isr
565
566
567 movsg hsr0,gr4
568 andi gr4,
569 movgs gr4,hsr0
570
571
572 setlos.p
573 sethi %hi(__entry_vector_table),gr6
574 and.p gr20,gr3,gr5
575 setlo %lo(__entry_vector_table),gr6
576 srli gr5,
577 ld @(gr5,gr6),gr5
578
579 LEDS 0x6009
580 jmpl @(gr5,gr0)
581
582
583 .size __entry_common,.-__entry_common
584
585
586
587
588
589
590#ifdef CONFIG_MMU
591 .globl __entry_insn_mmu_fault
592__entry_insn_mmu_fault:
593 LEDS 0x6010
594 setlos
595 movsg esr0,gr9
596 movsg scr2,gr10
597
598
599 movsg psr,gr4
600 ori gr4,
601 movgs gr4,psr
602
603 sethi.p %hi(do_page_fault),gr5
604 setlo %lo(do_page_fault),gr5
605 jmpl @(gr5,gr0) ; call do_page_fault(0,esr0,ear0)
606#endif
607
608
609
610
611
612
613
614 .globl __entry_insn_access_error
615__entry_insn_access_error:
616 LEDS 0x6011
617 sethi.p %hi(insn_access_error),gr5
618 setlo %lo(insn_access_error),gr5
619 movsg esfr1,gr8
620 movsg epcr0,gr9
621 movsg esr0,gr10
622
623
624 movsg psr,gr4
625 ori gr4,
626 movgs gr4,psr
627 jmpl @(gr5,gr0) ; call insn_access_error(esfr1,epcr0,esr0)
628
629
630
631
632
633
634 .globl __entry_unsupported_trap
635 .globl __entry_illegal_instruction
636 .globl __entry_privileged_instruction
637 .globl __entry_debug_exception
638__entry_unsupported_trap:
639 subi gr21,
640 sti gr21,@(gr28,
641__entry_illegal_instruction:
642__entry_privileged_instruction:
643__entry_debug_exception:
644 LEDS 0x6012
645 sethi.p %hi(illegal_instruction),gr5
646 setlo %lo(illegal_instruction),gr5
647 movsg esfr1,gr8
648 movsg epcr0,gr9
649 movsg esr0,gr10
650
651
652 movsg psr,gr4
653 ori gr4,
654 movgs gr4,psr
655 jmpl @(gr5,gr0) ; call ill_insn(esfr1,epcr0,esr0)
656
657
658
659
660
661
662 .globl __entry_atomic_op
663__entry_atomic_op:
664 LEDS 0x6012
665 sethi.p %hi(atomic_operation),gr5
666 setlo %lo(atomic_operation),gr5
667 movsg esfr1,gr8
668 movsg epcr0,gr9
669 movsg esr0,gr10
670
671
672 movsg psr,gr4
673 ori gr4,
674 movgs gr4,psr
675 jmpl @(gr5,gr0) ; call atomic_operation(esfr1,epcr0,esr0)
676
677
678
679
680
681
682 .globl __entry_media_exception
683__entry_media_exception:
684 LEDS 0x6013
685 sethi.p %hi(media_exception),gr5
686 setlo %lo(media_exception),gr5
687 movsg msr0,gr8
688 movsg msr1,gr9
689
690
691 movsg psr,gr4
692 ori gr4,
693 movgs gr4,psr
694 jmpl @(gr5,gr0) ; call media_excep(msr0,msr1)
695
696
697
698
699
700
701
702#ifdef CONFIG_MMU
703 .globl __entry_data_mmu_fault
704__entry_data_mmu_fault:
705 .globl __entry_data_dat_fault
706__entry_data_dat_fault:
707 LEDS 0x6014
708 setlos
709 movsg esr0,gr9
710 movsg scr2,gr10 ; saved EAR0
711
712
713 movsg psr,gr4
714 ori gr4,
715 movgs gr4,psr
716
717 sethi.p %hi(do_page_fault),gr5
718 setlo %lo(do_page_fault),gr5
719 jmpl @(gr5,gr0) ; call do_page_fault(1,esr0,ear0)
720#endif
721
722
723
724
725
726
727 .globl __entry_insn_access_exception
728 .globl __entry_data_access_exception
729__entry_insn_access_exception:
730__entry_data_access_exception:
731 LEDS 0x6016
732 sethi.p %hi(memory_access_exception),gr5
733 setlo %lo(memory_access_exception),gr5
734 movsg esr0,gr8
735 movsg scr2,gr9 ; saved EAR0
736 movsg epcr0,gr10
737
738
739 movsg psr,gr4
740 ori gr4,
741 movgs gr4,psr
742 jmpl @(gr5,gr0) ; call memory_access_error(esr0,ear0,epcr0)
743
744
745
746
747
748
749 .globl __entry_data_access_error
750__entry_data_access_error:
751 LEDS 0x6016
752 sethi.p %hi(data_access_error),gr5
753 setlo %lo(data_access_error),gr5
754 movsg esfr1,gr8
755 movsg esr15,gr9
756 movsg ear15,gr10
757
758
759 movsg psr,gr4
760 ori gr4,
761 movgs gr4,psr
762 jmpl @(gr5,gr0) ; call data_access_error(esfr1,esr15,ear15)
763
764
765
766
767
768
769 .globl __entry_data_store_error
770__entry_data_store_error:
771 LEDS 0x6017
772 sethi.p %hi(data_store_error),gr5
773 setlo %lo(data_store_error),gr5
774 movsg esfr1,gr8
775 movsg esr14,gr9
776
777
778 movsg psr,gr4
779 ori gr4,
780 movgs gr4,psr
781 jmpl @(gr5,gr0) ; call data_store_error(esfr1,esr14)
782
783
784
785
786
787
788 .globl __entry_division_exception
789__entry_division_exception:
790 LEDS 0x6018
791 sethi.p %hi(division_exception),gr5
792 setlo %lo(division_exception),gr5
793 movsg esfr1,gr8
794 movsg esr0,gr9
795 movsg isr,gr10
796
797
798 movsg psr,gr4
799 ori gr4,
800 movgs gr4,psr
801 jmpl @(gr5,gr0) ; call div_excep(esfr1,esr0,isr)
802
803
804
805
806
807
808 .globl __entry_compound_exception
809__entry_compound_exception:
810 LEDS 0x6019
811 sethi.p %hi(compound_exception),gr5
812 setlo %lo(compound_exception),gr5
813 movsg esfr1,gr8
814 movsg esr0,gr9
815 movsg esr14,gr10
816 movsg esr15,gr11
817 movsg msr0,gr12
818 movsg msr1,gr13
819
820
821 movsg psr,gr4
822 ori gr4,
823 movgs gr4,psr
824 jmpl @(gr5,gr0) ; call comp_excep(esfr1,esr0,esr14,esr15,msr0,msr1)
825
826
827
828
829
830
831 .globl __entry_do_IRQ
832__entry_do_IRQ:
833 LEDS 0x6020
834
835
836 movsg psr,gr4
837 ori gr4,
838 movgs gr4,psr
839 bra do_IRQ
840
841 .globl __entry_do_NMI
842__entry_do_NMI:
843 LEDS 0x6021
844
845
846 movsg psr,gr4
847 ori gr4,
848 movgs gr4,psr
849 bra do_NMI
850
851
852
853
854
855
856
857 .globl ret_from_fork
858ret_from_fork:
859 LEDS 0x6100
860 call schedule_tail
861
862
863 setlos.p
864 bra __syscall_exit
865
866 .globl ret_from_kernel_thread
867ret_from_kernel_thread:
868 lddi.p @(gr28,
869 call schedule_tail
870 calll.p @(gr21,gr0)
871 or gr20,gr20,gr8
872 bra __syscall_exit
873
874
875
876
877
878
879
880
881
882 .balign L1_CACHE_BYTES
883 .globl system_call
884system_call:
885 LEDS 0x6101
886 movsg psr,gr4 ; enable exceptions
887 ori gr4,
888 movgs gr4,psr
889
890 sti gr7,@(gr28,
891 sti.p gr8,@(gr28,
892
893 subicc gr7,
894 bnc icc0,
895
896 ldi @(gr15,
897 andicc gr4,
898 bne icc0,
899
900__syscall_call:
901 slli.p gr7,
902 sethi %hi(sys_call_table),gr5
903 setlo %lo(sys_call_table),gr5
904 ld @(gr5,gr7),gr4
905 calll @(gr4,gr0)
906
907
908
909
910
911
912
913__syscall_exit:
914 LEDS 0x6300
915
916
917 movsg psr,gr23
918
919 ldi @(gr28,
920
921 sti.p gr8,@(gr28,
922
923
924 srli gr22,
925 andi.p gr22,
926 andi gr5,
927 or gr5,gr22,gr22
928 ori.p gr22,
929
930
931
932 ori gr23,
933 movgs gr23,psr
934
935 ldi @(gr15,
936 andicc gr4,
937 bne icc0,
938
939
940__entry_return_direct:
941 LEDS 0x6301
942
943 andi gr22,
944 movgs gr22,psr
945
946 ldi @(gr28,
947 lddi @(gr28,
948 lddi @(gr28,
949 ldi @(gr28,
950 ldi @(gr28,
951
952 movgs gr20,tbr
953 movgs gr21,pcsr
954 movgs gr23,isr
955 movgs gr24,ccr
956 movgs gr25,cccr
957 movgs gr26,lr
958 movgs gr27,lcr
959
960 lddi @(gr28,
961 movgs gr4,gner0
962 movgs gr5,gner1
963
964 lddi @(gr28,
965 movgs gr4,iacc0h
966 movgs gr5,iacc0l
967
968 lddi @(gr28,
969 lddi @(gr28,
970 lddi @(gr28,
971 lddi @(gr28,
972 lddi @(gr28,
973 lddi @(gr28,
974 lddi @(gr28,
975 lddi @(gr28,
976 lddi @(gr28,
977 lddi @(gr28,
978 lddi @(gr28,
979 lddi @(gr28,
980 ldi @(gr28,
981 lddi @(gr28,
982
983
984 LEDS 0x67f0
985 movsg ccr,gr2
986 ldi @(gr28,
987 andicc gr3,
988 bne icc0,
989 movgs gr2,ccr
990
991 ldi @(gr28,
992 lddi @(gr28,
993 ldi @(gr28,
994
995 LEDS 0x67fe
996
997
998
999
1000
1001 movgs gr28,scr2
1002 sethi.p %hi(0xfe800000),gr28
1003 setlo %lo(0xfe800000),gr28
1004
1005 stdi gr2,@(gr28,
1006 stdi gr4,@(gr28,
1007 stdi gr6,@(gr28,
1008 stdi gr8,@(gr28,
1009 stdi gr10,@(gr28,
1010 stdi gr12,@(gr28,
1011 stdi gr14,@(gr28,
1012 stdi gr16,@(gr28,
1013 stdi gr18,@(gr28,
1014 stdi gr24,@(gr28,
1015 stdi gr26,@(gr28,
1016 sti gr29,@(gr28,
1017 stdi gr30,@(gr28,
1018
1019 movsg tbr ,gr30
1020 sti gr30,@(gr28,
1021 movsg pcsr,gr30
1022 sti gr30,@(gr28,
1023 movsg psr ,gr30
1024 sti gr30,@(gr28,
1025 movsg isr ,gr30
1026 sti gr30,@(gr28,
1027 movsg ccr ,gr30
1028 movsg cccr,gr31
1029 stdi gr30,@(gr28,
1030 movsg lr ,gr30
1031 movsg lcr ,gr31
1032 stdi gr30,@(gr28,
1033 sti gr0 ,@(gr28,
1034 movsg scr2,gr28
1035#endif
1036
1037 rett
1038
1039
1040__entry_return_singlestep:
1041 movgs gr2,ccr
1042 lddi @(gr28,
1043 ldi @(gr28,
1044 ldi @(gr28,
1045 LEDS 0x67ff
1046 break
1047 .globl __entry_return_singlestep_breaks_here
1048__entry_return_singlestep_breaks_here:
1049 nop
1050
1051
1052
1053
1054
1055
1056
1057
1058 .balign L1_CACHE_BYTES
1059__entry_return_from_kernel_exception:
1060 LEDS 0x6302
1061 movsg psr,gr23
1062 ori gr23,
1063 movgs gr23,psr
1064 bra __entry_return_direct
1065
1066 .balign L1_CACHE_BYTES
1067__entry_return_from_kernel_interrupt:
1068 LEDS 0x6303
1069 movsg psr,gr23
1070 ori gr23,
1071 movgs gr23,psr
1072
1073#ifdef CONFIG_PREEMPT
1074 ldi @(gr15,
1075 subicc gr5,
1076 beq icc0,
1077
1078 subcc gr0,gr0,gr0,icc2
1079 call preempt_schedule_irq
1080#endif
1081 bra __entry_return_direct
1082
1083
1084
1085
1086
1087
1088
1089 .globl __entry_return_from_user_exception
1090 .balign L1_CACHE_BYTES
1091__entry_return_from_user_exception:
1092 LEDS 0x6501
1093
1094__entry_resume_userspace:
1095
1096
1097 movsg psr,gr23
1098 ori gr23,
1099 movgs gr23,psr
1100
1101__entry_return_from_user_interrupt:
1102 LEDS 0x6402
1103 ldi @(gr15,
1104 andicc gr4,
1105 beq icc0,
1106
1107__entry_work_pending:
1108 LEDS 0x6404
1109 andicc gr4,
1110 beq icc0,
1111
1112__entry_work_resched:
1113 LEDS 0x6408
1114 movsg psr,gr23
1115 andi gr23,
1116 movgs gr23,psr
1117 call schedule
1118 movsg psr,gr23
1119 ori gr23,
1120 movgs gr23,psr
1121
1122 LEDS 0x6401
1123 ldi @(gr15,
1124 andicc gr4,
1125 beq icc0,
1126 andicc gr4,
1127 bne icc0,
1128
1129__entry_work_notifysig:
1130 LEDS 0x6410
1131 ori.p gr4,
1132 call do_notify_resume
1133 bra __entry_resume_userspace
1134
1135
1136__syscall_trace_entry:
1137 LEDS 0x6320
1138 call syscall_trace_entry
1139
1140 lddi.p @(gr28,
1141 ori gr8,
1142 lddi @(gr28,
1143 lddi.p @(gr28,
1144
1145 subicc gr7,
1146 bnc icc0,
1147 bra __syscall_call
1148
1149
1150__syscall_exit_work:
1151 LEDS 0x6340
1152 andicc gr22,
1153 andicc.p gr4,
1154 bne icc1,
1155 beq icc0,
1156
1157 movsg psr,gr23
1158 andi gr23,
1159 movgs gr23,psr
1160
1161 call syscall_trace_exit
1162 bra __entry_resume_userspace
1163
1164__syscall_badsys:
1165 LEDS 0x6380
1166 setlos
1167 sti gr8,@(gr28,
1168 bra __entry_resume_userspace
1169
1170
1171
1172
1173
1174
1175
1176 .section .rodata
1177ALIGN
1178 .globl sys_call_table
1179sys_call_table:
1180 .long sys_restart_syscall
1181 .long sys_exit
1182 .long sys_fork
1183 .long sys_read
1184 .long sys_write
1185 .long sys_open
1186 .long sys_close
1187 .long sys_waitpid
1188 .long sys_creat
1189 .long sys_link
1190 .long sys_unlink
1191 .long sys_execve
1192 .long sys_chdir
1193 .long sys_time
1194 .long sys_mknod
1195 .long sys_chmod
1196 .long sys_lchown16
1197 .long sys_ni_syscall
1198 .long sys_stat
1199 .long sys_lseek
1200 .long sys_getpid
1201 .long sys_mount
1202 .long sys_oldumount
1203 .long sys_setuid16
1204 .long sys_getuid16
1205 .long sys_ni_syscall
1206 .long sys_ptrace
1207 .long sys_alarm
1208 .long sys_fstat
1209 .long sys_pause
1210 .long sys_utime
1211 .long sys_ni_syscall
1212 .long sys_ni_syscall
1213 .long sys_access
1214 .long sys_nice
1215 .long sys_ni_syscall
1216 .long sys_sync
1217 .long sys_kill
1218 .long sys_rename
1219 .long sys_mkdir
1220 .long sys_rmdir
1221 .long sys_dup
1222 .long sys_pipe
1223 .long sys_times
1224 .long sys_ni_syscall
1225 .long sys_brk
1226 .long sys_setgid16
1227 .long sys_getgid16
1228 .long sys_ni_syscall
1229 .long sys_geteuid16
1230 .long sys_getegid16
1231 .long sys_acct
1232 .long sys_umount
1233 .long sys_ni_syscall
1234 .long sys_ioctl
1235 .long sys_fcntl
1236 .long sys_ni_syscall
1237 .long sys_setpgid
1238 .long sys_ni_syscall
1239 .long sys_ni_syscall
1240 .long sys_umask
1241 .long sys_chroot
1242 .long sys_ustat
1243 .long sys_dup2
1244 .long sys_getppid
1245 .long sys_getpgrp
1246 .long sys_setsid
1247 .long sys_sigaction
1248 .long sys_ni_syscall
1249 .long sys_ni_syscall
1250 .long sys_setreuid16
1251 .long sys_setregid16
1252 .long sys_sigsuspend
1253 .long sys_ni_syscall
1254 .long sys_sethostname
1255 .long sys_setrlimit
1256 .long sys_ni_syscall
1257 .long sys_getrusage
1258 .long sys_gettimeofday
1259 .long sys_settimeofday
1260 .long sys_getgroups16
1261 .long sys_setgroups16
1262 .long sys_ni_syscall
1263 .long sys_symlink
1264 .long sys_lstat
1265 .long sys_readlink
1266 .long sys_uselib
1267 .long sys_swapon
1268 .long sys_reboot
1269 .long sys_ni_syscall
1270 .long sys_ni_syscall
1271 .long sys_munmap
1272 .long sys_truncate
1273 .long sys_ftruncate
1274 .long sys_fchmod
1275 .long sys_fchown16
1276 .long sys_getpriority
1277 .long sys_setpriority
1278 .long sys_ni_syscall
1279 .long sys_statfs
1280 .long sys_fstatfs
1281 .long sys_ni_syscall
1282 .long sys_socketcall
1283 .long sys_syslog
1284 .long sys_setitimer
1285 .long sys_getitimer
1286 .long sys_newstat
1287 .long sys_newlstat
1288 .long sys_newfstat
1289 .long sys_ni_syscall
1290 .long sys_ni_syscall
1291 .long sys_vhangup
1292 .long sys_ni_syscall
1293 .long sys_ni_syscall
1294 .long sys_wait4
1295 .long sys_swapoff
1296 .long sys_sysinfo
1297 .long sys_ipc
1298 .long sys_fsync
1299 .long sys_sigreturn
1300 .long sys_clone
1301 .long sys_setdomainname
1302 .long sys_newuname
1303 .long sys_ni_syscall
1304 .long sys_adjtimex
1305 .long sys_mprotect
1306 .long sys_sigprocmask
1307 .long sys_ni_syscall
1308 .long sys_init_module
1309 .long sys_delete_module
1310 .long sys_ni_syscall
1311 .long sys_quotactl
1312 .long sys_getpgid
1313 .long sys_fchdir
1314 .long sys_bdflush
1315 .long sys_sysfs
1316 .long sys_personality
1317 .long sys_ni_syscall
1318 .long sys_setfsuid16
1319 .long sys_setfsgid16
1320 .long sys_llseek
1321 .long sys_getdents
1322 .long sys_select
1323 .long sys_flock
1324 .long sys_msync
1325 .long sys_readv
1326 .long sys_writev
1327 .long sys_getsid
1328 .long sys_fdatasync
1329 .long sys_sysctl
1330 .long sys_mlock
1331 .long sys_munlock
1332 .long sys_mlockall
1333 .long sys_munlockall
1334 .long sys_sched_setparam
1335 .long sys_sched_getparam
1336 .long sys_sched_setscheduler
1337 .long sys_sched_getscheduler
1338 .long sys_sched_yield
1339 .long sys_sched_get_priority_max
1340 .long sys_sched_get_priority_min
1341 .long sys_sched_rr_get_interval
1342 .long sys_nanosleep
1343 .long sys_mremap
1344 .long sys_setresuid16
1345 .long sys_getresuid16
1346 .long sys_ni_syscall
1347 .long sys_ni_syscall
1348 .long sys_poll
1349 .long sys_ni_syscall
1350 .long sys_setresgid16
1351 .long sys_getresgid16
1352 .long sys_prctl
1353 .long sys_rt_sigreturn
1354 .long sys_rt_sigaction
1355 .long sys_rt_sigprocmask
1356 .long sys_rt_sigpending
1357 .long sys_rt_sigtimedwait
1358 .long sys_rt_sigqueueinfo
1359 .long sys_rt_sigsuspend
1360 .long sys_pread64
1361 .long sys_pwrite64
1362 .long sys_chown16
1363 .long sys_getcwd
1364 .long sys_capget
1365 .long sys_capset
1366 .long sys_sigaltstack
1367 .long sys_sendfile
1368 .long sys_ni_syscall
1369 .long sys_ni_syscall
1370 .long sys_vfork
1371 .long sys_getrlimit
1372 .long sys_mmap2
1373 .long sys_truncate64
1374 .long sys_ftruncate64
1375 .long sys_stat64
1376 .long sys_lstat64
1377 .long sys_fstat64
1378 .long sys_lchown
1379 .long sys_getuid
1380 .long sys_getgid
1381 .long sys_geteuid
1382 .long sys_getegid
1383 .long sys_setreuid
1384 .long sys_setregid
1385 .long sys_getgroups
1386 .long sys_setgroups
1387 .long sys_fchown
1388 .long sys_setresuid
1389 .long sys_getresuid
1390 .long sys_setresgid
1391 .long sys_getresgid
1392 .long sys_chown
1393 .long sys_setuid
1394 .long sys_setgid
1395 .long sys_setfsuid
1396 .long sys_setfsgid
1397 .long sys_pivot_root
1398 .long sys_mincore
1399 .long sys_madvise
1400 .long sys_getdents64
1401 .long sys_fcntl64
1402 .long sys_ni_syscall
1403 .long sys_ni_syscall
1404 .long sys_gettid
1405 .long sys_readahead
1406 .long sys_setxattr
1407 .long sys_lsetxattr
1408 .long sys_fsetxattr
1409 .long sys_getxattr
1410 .long sys_lgetxattr
1411 .long sys_fgetxattr
1412 .long sys_listxattr
1413 .long sys_llistxattr
1414 .long sys_flistxattr
1415 .long sys_removexattr
1416 .long sys_lremovexattr
1417 .long sys_fremovexattr
1418 .long sys_tkill
1419 .long sys_sendfile64
1420 .long sys_futex
1421 .long sys_sched_setaffinity
1422 .long sys_sched_getaffinity
1423 .long sys_ni_syscall
1424 .long sys_ni_syscall
1425 .long sys_io_setup
1426 .long sys_io_destroy
1427 .long sys_io_getevents
1428 .long sys_io_submit
1429 .long sys_io_cancel
1430 .long sys_fadvise64
1431 .long sys_ni_syscall
1432 .long sys_exit_group
1433 .long sys_lookup_dcookie
1434 .long sys_epoll_create
1435 .long sys_epoll_ctl
1436 .long sys_epoll_wait
1437 .long sys_remap_file_pages
1438 .long sys_set_tid_address
1439 .long sys_timer_create
1440 .long sys_timer_settime
1441 .long sys_timer_gettime
1442 .long sys_timer_getoverrun
1443 .long sys_timer_delete
1444 .long sys_clock_settime
1445 .long sys_clock_gettime
1446 .long sys_clock_getres
1447 .long sys_clock_nanosleep
1448 .long sys_statfs64
1449 .long sys_fstatfs64
1450 .long sys_tgkill
1451 .long sys_utimes
1452 .long sys_fadvise64_64
1453 .long sys_ni_syscall
1454 .long sys_mbind
1455 .long sys_get_mempolicy
1456 .long sys_set_mempolicy
1457 .long sys_mq_open
1458 .long sys_mq_unlink
1459 .long sys_mq_timedsend
1460 .long sys_mq_timedreceive
1461 .long sys_mq_notify
1462 .long sys_mq_getsetattr
1463 .long sys_ni_syscall
1464 .long sys_waitid
1465 .long sys_ni_syscall
1466 .long sys_add_key
1467 .long sys_request_key
1468 .long sys_keyctl
1469 .long sys_ioprio_set
1470 .long sys_ioprio_get
1471 .long sys_inotify_init
1472 .long sys_inotify_add_watch
1473 .long sys_inotify_rm_watch
1474 .long sys_migrate_pages
1475 .long sys_openat
1476 .long sys_mkdirat
1477 .long sys_mknodat
1478 .long sys_fchownat
1479 .long sys_futimesat
1480 .long sys_fstatat64
1481 .long sys_unlinkat
1482 .long sys_renameat
1483 .long sys_linkat
1484 .long sys_symlinkat
1485 .long sys_readlinkat
1486 .long sys_fchmodat
1487 .long sys_faccessat
1488 .long sys_pselect6
1489 .long sys_ppoll
1490 .long sys_unshare
1491 .long sys_set_robust_list
1492 .long sys_get_robust_list
1493 .long sys_splice
1494 .long sys_sync_file_range
1495 .long sys_tee
1496 .long sys_vmsplice
1497 .long sys_move_pages
1498 .long sys_getcpu
1499 .long sys_epoll_pwait
1500 .long sys_utimensat
1501 .long sys_signalfd
1502 .long sys_timerfd_create
1503 .long sys_eventfd
1504 .long sys_fallocate
1505 .long sys_timerfd_settime
1506 .long sys_timerfd_gettime
1507 .long sys_signalfd4
1508 .long sys_eventfd2
1509 .long sys_epoll_create1
1510 .long sys_dup3
1511 .long sys_pipe2
1512 .long sys_inotify_init1
1513 .long sys_preadv
1514 .long sys_pwritev
1515 .long sys_rt_tgsigqueueinfo
1516 .long sys_perf_event_open
1517 .long sys_setns
1518
1519syscall_table_size = (. - sys_call_table)
1520