aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/entry.S
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2012-05-11 07:35:06 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-11 22:27:46 -0400
commit306f1231622176d06b1ad2bccc46122dd4e927fa (patch)
treec8ac1f2bf302484b0e87e7793fd6c9322c6860f4 /arch/sparc/kernel/entry.S
parente7eaf5b8abb836785a512fa7e9348dc6b0d7bc81 (diff)
sparc32: remove sun4c traps
We used to runtime patch the trap table for srmmu. With the removal of sun4c support this is no longer required. With the sun4c trap removed we can remove all the referenced trap handling which is sun4c specific. This also allows us to get rid of the nosun4c.c file that contained only dummy functions/data. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/entry.S')
-rw-r--r--arch/sparc/kernel/entry.S248
1 files changed, 0 insertions, 248 deletions
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index e0e0b8109225..8abe65d3f729 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -17,7 +17,6 @@
17#include <asm/asm-offsets.h> 17#include <asm/asm-offsets.h>
18#include <asm/psr.h> 18#include <asm/psr.h>
19#include <asm/vaddrs.h> 19#include <asm/vaddrs.h>
20#include <asm/memreg.h>
21#include <asm/page.h> 20#include <asm/page.h>
22#include <asm/pgtable.h> 21#include <asm/pgtable.h>
23#include <asm/pgtsun4c.h> 22#include <asm/pgtsun4c.h>
@@ -829,253 +828,6 @@ vac_hwflush_patch2_on: sta %g0, [%l3 + %l7] ASI_HWFLUSHSEG
829 .globl vac_hwflush_patch2 828 .globl vac_hwflush_patch2
830 829
831 .align 4 830 .align 4
832 .globl sun4c_fault
833
834! %l0 = %psr
835! %l1 = %pc
836! %l2 = %npc
837! %l3 = %wim
838! %l7 = 1 for textfault
839! We want error in %l5, vaddr in %l6
840sun4c_fault:
841 sethi %hi(AC_SYNC_ERR), %l4
842 add %l4, 0x4, %l6 ! AC_SYNC_VA in %l6
843 lda [%l6] ASI_CONTROL, %l5 ! Address
844 lda [%l4] ASI_CONTROL, %l6 ! Error, retained for a bit
845
846 andn %l5, 0xfff, %l5 ! Encode all info into l7
847 srl %l6, 14, %l4
848
849 and %l4, 2, %l4
850 or %l5, %l4, %l4
851
852 or %l4, %l7, %l7 ! l7 = [addr,write,txtfault]
853
854 andcc %l0, PSR_PS, %g0
855 be sun4c_fault_fromuser
856 andcc %l7, 1, %g0 ! Text fault?
857
858 be 1f
859 sethi %hi(KERNBASE), %l4
860
861 mov %l1, %l5 ! PC
862
8631:
864 cmp %l5, %l4
865 blu sun4c_fault_fromuser
866 sethi %hi(~((1 << SUN4C_REAL_PGDIR_SHIFT) - 1)), %l4
867
868 /* If the kernel references a bum kernel pointer, or a pte which
869 * points to a non existent page in ram, we will run this code
870 * _forever_ and lock up the machine!!!!! So we must check for
871 * this condition, the AC_SYNC_ERR bits are what we must examine.
872 * Also a parity error would make this happen as well. So we just
873 * check that we are in fact servicing a tlb miss and not some
874 * other type of fault for the kernel.
875 */
876 andcc %l6, 0x80, %g0
877 be sun4c_fault_fromuser
878 and %l5, %l4, %l5
879
880 /* Test for NULL pte_t * in vmalloc area. */
881 sethi %hi(VMALLOC_START), %l4
882 cmp %l5, %l4
883 blu,a invalid_segment_patch1
884 lduXa [%l5] ASI_SEGMAP, %l4
885
886 sethi %hi(swapper_pg_dir), %l4
887 srl %l5, SUN4C_PGDIR_SHIFT, %l6
888 or %l4, %lo(swapper_pg_dir), %l4
889 sll %l6, 2, %l6
890 ld [%l4 + %l6], %l4
891 andcc %l4, PAGE_MASK, %g0
892 be sun4c_fault_fromuser
893 lduXa [%l5] ASI_SEGMAP, %l4
894
895invalid_segment_patch1:
896 cmp %l4, 0x7f
897 bne 1f
898 sethi %hi(sun4c_kfree_ring), %l4
899 or %l4, %lo(sun4c_kfree_ring), %l4
900 ld [%l4 + 0x18], %l3
901 deccc %l3 ! do we have a free entry?
902 bcs,a 2f ! no, unmap one.
903 sethi %hi(sun4c_kernel_ring), %l4
904
905 st %l3, [%l4 + 0x18] ! sun4c_kfree_ring.num_entries--
906
907 ld [%l4 + 0x00], %l6 ! entry = sun4c_kfree_ring.ringhd.next
908 st %l5, [%l6 + 0x08] ! entry->vaddr = address
909
910 ld [%l6 + 0x00], %l3 ! next = entry->next
911 ld [%l6 + 0x04], %l7 ! entry->prev
912
913 st %l7, [%l3 + 0x04] ! next->prev = entry->prev
914 st %l3, [%l7 + 0x00] ! entry->prev->next = next
915
916 sethi %hi(sun4c_kernel_ring), %l4
917 or %l4, %lo(sun4c_kernel_ring), %l4
918 ! head = &sun4c_kernel_ring.ringhd
919
920 ld [%l4 + 0x00], %l7 ! head->next
921
922 st %l4, [%l6 + 0x04] ! entry->prev = head
923 st %l7, [%l6 + 0x00] ! entry->next = head->next
924 st %l6, [%l7 + 0x04] ! head->next->prev = entry
925
926 st %l6, [%l4 + 0x00] ! head->next = entry
927
928 ld [%l4 + 0x18], %l3
929 inc %l3 ! sun4c_kernel_ring.num_entries++
930 st %l3, [%l4 + 0x18]
931 b 4f
932 ld [%l6 + 0x08], %l5
933
9342:
935 or %l4, %lo(sun4c_kernel_ring), %l4
936 ! head = &sun4c_kernel_ring.ringhd
937
938 ld [%l4 + 0x04], %l6 ! entry = head->prev
939
940 ld [%l6 + 0x08], %l3 ! tmp = entry->vaddr
941
942 ! Flush segment from the cache.
943 sethi %hi((64 * 1024)), %l7
9449:
945vac_hwflush_patch1:
946vac_linesize_patch:
947 subcc %l7, 16, %l7
948 bne 9b
949vac_hwflush_patch2:
950 sta %g0, [%l3 + %l7] ASI_FLUSHSEG
951
952 st %l5, [%l6 + 0x08] ! entry->vaddr = address
953
954 ld [%l6 + 0x00], %l5 ! next = entry->next
955 ld [%l6 + 0x04], %l7 ! entry->prev
956
957 st %l7, [%l5 + 0x04] ! next->prev = entry->prev
958 st %l5, [%l7 + 0x00] ! entry->prev->next = next
959 st %l4, [%l6 + 0x04] ! entry->prev = head
960
961 ld [%l4 + 0x00], %l7 ! head->next
962
963 st %l7, [%l6 + 0x00] ! entry->next = head->next
964 st %l6, [%l7 + 0x04] ! head->next->prev = entry
965 st %l6, [%l4 + 0x00] ! head->next = entry
966
967 mov %l3, %l5 ! address = tmp
968
9694:
970num_context_patch1:
971 mov 0x08, %l7
972
973 ld [%l6 + 0x08], %l4
974 ldub [%l6 + 0x0c], %l3
975 or %l4, %l3, %l4 ! encode new vaddr/pseg into l4
976
977 sethi %hi(AC_CONTEXT), %l3
978 lduba [%l3] ASI_CONTROL, %l6
979
980 /* Invalidate old mapping, instantiate new mapping,
981 * for each context. Registers l6/l7 are live across
982 * this loop.
983 */
9843: deccc %l7
985 sethi %hi(AC_CONTEXT), %l3
986 stba %l7, [%l3] ASI_CONTROL
987invalid_segment_patch2:
988 mov 0x7f, %l3
989 stXa %l3, [%l5] ASI_SEGMAP
990 andn %l4, 0x1ff, %l3
991 bne 3b
992 stXa %l4, [%l3] ASI_SEGMAP
993
994 sethi %hi(AC_CONTEXT), %l3
995 stba %l6, [%l3] ASI_CONTROL
996
997 andn %l4, 0x1ff, %l5
998
9991:
1000 sethi %hi(VMALLOC_START), %l4
1001 cmp %l5, %l4
1002
1003 bgeu 1f
1004 mov 1 << (SUN4C_REAL_PGDIR_SHIFT - PAGE_SHIFT), %l7
1005
1006 sethi %hi(KERNBASE), %l6
1007
1008 sub %l5, %l6, %l4
1009 srl %l4, PAGE_SHIFT, %l4
1010 sethi %hi((SUN4C_PAGE_KERNEL & 0xf4000000)), %l3
1011 or %l3, %l4, %l3
1012
1013 sethi %hi(PAGE_SIZE), %l4
1014
10152:
1016 sta %l3, [%l5] ASI_PTE
1017 deccc %l7
1018 inc %l3
1019 bne 2b
1020 add %l5, %l4, %l5
1021
1022 b 7f
1023 sethi %hi(sun4c_kernel_faults), %l4
1024
10251:
1026 srl %l5, SUN4C_PGDIR_SHIFT, %l3
1027 sethi %hi(swapper_pg_dir), %l4
1028 or %l4, %lo(swapper_pg_dir), %l4
1029 sll %l3, 2, %l3
1030 ld [%l4 + %l3], %l4
1031 and %l4, PAGE_MASK, %l4
1032
1033 srl %l5, (PAGE_SHIFT - 2), %l6
1034 and %l6, ((SUN4C_PTRS_PER_PTE - 1) << 2), %l6
1035 add %l6, %l4, %l6
1036
1037 sethi %hi(PAGE_SIZE), %l4
1038
10392:
1040 ld [%l6], %l3
1041 deccc %l7
1042 sta %l3, [%l5] ASI_PTE
1043 add %l6, 0x4, %l6
1044 bne 2b
1045 add %l5, %l4, %l5
1046
1047 sethi %hi(sun4c_kernel_faults), %l4
10487:
1049 ld [%l4 + %lo(sun4c_kernel_faults)], %l3
1050 inc %l3
1051 st %l3, [%l4 + %lo(sun4c_kernel_faults)]
1052
1053 /* Restore condition codes */
1054 wr %l0, 0x0, %psr
1055 WRITE_PAUSE
1056 jmp %l1
1057 rett %l2
1058
1059sun4c_fault_fromuser:
1060 SAVE_ALL
1061 nop
1062
1063 mov %l7, %o1 ! Decode the info from %l7
1064 mov %l7, %o2
1065 and %o1, 1, %o1 ! arg2 = text_faultp
1066 mov %l7, %o3
1067 and %o2, 2, %o2 ! arg3 = writep
1068 andn %o3, 0xfff, %o3 ! arg4 = faulting address
1069
1070 wr %l0, PSR_ET, %psr
1071 WRITE_PAUSE
1072
1073 call do_sun4c_fault
1074 add %sp, STACKFRAME_SZ, %o0 ! arg1 = pt_regs ptr
1075
1076 RESTORE_ALL
1077
1078 .align 4
1079 .globl srmmu_fault 831 .globl srmmu_fault
1080srmmu_fault: 832srmmu_fault:
1081 mov 0x400, %l5 833 mov 0x400, %l5