1a88b5ba8SSam Ravnborg/* una_asm.S: Kernel unaligned trap assembler helpers. 2a88b5ba8SSam Ravnborg * 3a88b5ba8SSam Ravnborg * Copyright (C) 1996,2005 David S. Miller (davem@davemloft.net) 4a88b5ba8SSam Ravnborg * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 5a88b5ba8SSam Ravnborg */ 6a88b5ba8SSam Ravnborg 7a88b5ba8SSam Ravnborg .text 8a88b5ba8SSam Ravnborg 9a88b5ba8SSam Ravnborg .globl __do_int_store 10a88b5ba8SSam Ravnborg__do_int_store: 11a88b5ba8SSam Ravnborg rd %asi, %o4 12a88b5ba8SSam Ravnborg wr %o3, 0, %asi 13a88b5ba8SSam Ravnborg mov %o2, %g3 14a88b5ba8SSam Ravnborg cmp %o1, 2 15a88b5ba8SSam Ravnborg be,pn %icc, 2f 16a88b5ba8SSam Ravnborg cmp %o1, 4 17a88b5ba8SSam Ravnborg be,pt %icc, 1f 18a88b5ba8SSam Ravnborg srlx %g3, 24, %g2 19a88b5ba8SSam Ravnborg srlx %g3, 56, %g1 20a88b5ba8SSam Ravnborg srlx %g3, 48, %g7 21a88b5ba8SSam Ravnborg4: stba %g1, [%o0] %asi 22a88b5ba8SSam Ravnborg srlx %g3, 40, %g1 23a88b5ba8SSam Ravnborg5: stba %g7, [%o0 + 1] %asi 24a88b5ba8SSam Ravnborg srlx %g3, 32, %g7 25a88b5ba8SSam Ravnborg6: stba %g1, [%o0 + 2] %asi 26a88b5ba8SSam Ravnborg7: stba %g7, [%o0 + 3] %asi 27a88b5ba8SSam Ravnborg srlx %g3, 16, %g1 28a88b5ba8SSam Ravnborg8: stba %g2, [%o0 + 4] %asi 29a88b5ba8SSam Ravnborg srlx %g3, 8, %g7 30a88b5ba8SSam Ravnborg9: stba %g1, [%o0 + 5] %asi 31a88b5ba8SSam Ravnborg10: stba %g7, [%o0 + 6] %asi 32a88b5ba8SSam Ravnborg ba,pt %xcc, 0f 33a88b5ba8SSam Ravnborg11: stba %g3, [%o0 + 7] %asi 34a88b5ba8SSam Ravnborg1: srl %g3, 16, %g7 35a88b5ba8SSam Ravnborg12: stba %g2, [%o0] %asi 36a88b5ba8SSam Ravnborg srl %g3, 8, %g2 37a88b5ba8SSam Ravnborg13: stba %g7, [%o0 + 1] %asi 38a88b5ba8SSam Ravnborg14: stba %g2, [%o0 + 2] %asi 39a88b5ba8SSam Ravnborg ba,pt %xcc, 0f 40a88b5ba8SSam Ravnborg15: stba %g3, [%o0 + 3] %asi 41a88b5ba8SSam Ravnborg2: srl %g3, 8, %g2 42a88b5ba8SSam Ravnborg16: stba %g2, [%o0] %asi 43a88b5ba8SSam Ravnborg17: stba %g3, [%o0 + 1] %asi 44a88b5ba8SSam Ravnborg0: 45a88b5ba8SSam Ravnborg wr %o4, 0x0, %asi 46a88b5ba8SSam Ravnborg retl 47a88b5ba8SSam Ravnborg mov 0, %o0 48a88b5ba8SSam Ravnborg .size __do_int_store, .-__do_int_store 49a88b5ba8SSam Ravnborg 50a88b5ba8SSam Ravnborg .section __ex_table,"a" 51a88b5ba8SSam Ravnborg .word 4b, __retl_efault 52a88b5ba8SSam Ravnborg .word 5b, __retl_efault 53a88b5ba8SSam Ravnborg .word 6b, __retl_efault 54a88b5ba8SSam Ravnborg .word 7b, __retl_efault 55a88b5ba8SSam Ravnborg .word 8b, __retl_efault 56a88b5ba8SSam Ravnborg .word 9b, __retl_efault 57a88b5ba8SSam Ravnborg .word 10b, __retl_efault 58a88b5ba8SSam Ravnborg .word 11b, __retl_efault 59a88b5ba8SSam Ravnborg .word 12b, __retl_efault 60a88b5ba8SSam Ravnborg .word 13b, __retl_efault 61a88b5ba8SSam Ravnborg .word 14b, __retl_efault 62a88b5ba8SSam Ravnborg .word 15b, __retl_efault 63a88b5ba8SSam Ravnborg .word 16b, __retl_efault 64a88b5ba8SSam Ravnborg .word 17b, __retl_efault 65a88b5ba8SSam Ravnborg .previous 66a88b5ba8SSam Ravnborg 67a88b5ba8SSam Ravnborg .globl do_int_load 68a88b5ba8SSam Ravnborgdo_int_load: 69a88b5ba8SSam Ravnborg rd %asi, %o5 70a88b5ba8SSam Ravnborg wr %o4, 0, %asi 71a88b5ba8SSam Ravnborg cmp %o1, 8 72a88b5ba8SSam Ravnborg bge,pn %icc, 9f 73a88b5ba8SSam Ravnborg cmp %o1, 4 74a88b5ba8SSam Ravnborg be,pt %icc, 6f 75a88b5ba8SSam Ravnborg4: lduba [%o2] %asi, %g2 76a88b5ba8SSam Ravnborg5: lduba [%o2 + 1] %asi, %g3 77a88b5ba8SSam Ravnborg sll %g2, 8, %g2 78a88b5ba8SSam Ravnborg brz,pt %o3, 3f 79a88b5ba8SSam Ravnborg add %g2, %g3, %g2 80a88b5ba8SSam Ravnborg sllx %g2, 48, %g2 81a88b5ba8SSam Ravnborg srax %g2, 48, %g2 82a88b5ba8SSam Ravnborg3: ba,pt %xcc, 0f 83a88b5ba8SSam Ravnborg stx %g2, [%o0] 84a88b5ba8SSam Ravnborg6: lduba [%o2 + 1] %asi, %g3 85a88b5ba8SSam Ravnborg sll %g2, 24, %g2 86a88b5ba8SSam Ravnborg7: lduba [%o2 + 2] %asi, %g7 87a88b5ba8SSam Ravnborg sll %g3, 16, %g3 88a88b5ba8SSam Ravnborg8: lduba [%o2 + 3] %asi, %g1 89a88b5ba8SSam Ravnborg sll %g7, 8, %g7 90a88b5ba8SSam Ravnborg or %g2, %g3, %g2 91a88b5ba8SSam Ravnborg or %g7, %g1, %g7 92a88b5ba8SSam Ravnborg or %g2, %g7, %g2 93a88b5ba8SSam Ravnborg brnz,a,pt %o3, 3f 94a88b5ba8SSam Ravnborg sra %g2, 0, %g2 95a88b5ba8SSam Ravnborg3: ba,pt %xcc, 0f 96a88b5ba8SSam Ravnborg stx %g2, [%o0] 97a88b5ba8SSam Ravnborg9: lduba [%o2] %asi, %g2 98a88b5ba8SSam Ravnborg10: lduba [%o2 + 1] %asi, %g3 99a88b5ba8SSam Ravnborg sllx %g2, 56, %g2 100a88b5ba8SSam Ravnborg11: lduba [%o2 + 2] %asi, %g7 101a88b5ba8SSam Ravnborg sllx %g3, 48, %g3 102a88b5ba8SSam Ravnborg12: lduba [%o2 + 3] %asi, %g1 103a88b5ba8SSam Ravnborg sllx %g7, 40, %g7 104a88b5ba8SSam Ravnborg sllx %g1, 32, %g1 105a88b5ba8SSam Ravnborg or %g2, %g3, %g2 106a88b5ba8SSam Ravnborg or %g7, %g1, %g7 107a88b5ba8SSam Ravnborg13: lduba [%o2 + 4] %asi, %g3 108a88b5ba8SSam Ravnborg or %g2, %g7, %g7 109a88b5ba8SSam Ravnborg14: lduba [%o2 + 5] %asi, %g1 110a88b5ba8SSam Ravnborg sllx %g3, 24, %g3 111a88b5ba8SSam Ravnborg15: lduba [%o2 + 6] %asi, %g2 112a88b5ba8SSam Ravnborg sllx %g1, 16, %g1 113a88b5ba8SSam Ravnborg or %g7, %g3, %g7 114a88b5ba8SSam Ravnborg16: lduba [%o2 + 7] %asi, %g3 115a88b5ba8SSam Ravnborg sllx %g2, 8, %g2 116a88b5ba8SSam Ravnborg or %g7, %g1, %g7 117a88b5ba8SSam Ravnborg or %g2, %g3, %g2 118a88b5ba8SSam Ravnborg or %g7, %g2, %g7 119a88b5ba8SSam Ravnborg cmp %o1, 8 120a88b5ba8SSam Ravnborg be,a,pt %icc, 0f 121a88b5ba8SSam Ravnborg stx %g7, [%o0] 122a88b5ba8SSam Ravnborg srlx %g7, 32, %g2 123a88b5ba8SSam Ravnborg sra %g7, 0, %g7 124a88b5ba8SSam Ravnborg stx %g2, [%o0] 125a88b5ba8SSam Ravnborg stx %g7, [%o0 + 8] 126a88b5ba8SSam Ravnborg0: 127a88b5ba8SSam Ravnborg wr %o5, 0x0, %asi 128a88b5ba8SSam Ravnborg retl 129a88b5ba8SSam Ravnborg mov 0, %o0 13035043c42SBen Hutchings .size do_int_load, .-do_int_load 131a88b5ba8SSam Ravnborg 132a88b5ba8SSam Ravnborg .section __ex_table,"a" 133a88b5ba8SSam Ravnborg .word 4b, __retl_efault 134a88b5ba8SSam Ravnborg .word 5b, __retl_efault 135a88b5ba8SSam Ravnborg .word 6b, __retl_efault 136a88b5ba8SSam Ravnborg .word 7b, __retl_efault 137a88b5ba8SSam Ravnborg .word 8b, __retl_efault 138a88b5ba8SSam Ravnborg .word 9b, __retl_efault 139a88b5ba8SSam Ravnborg .word 10b, __retl_efault 140a88b5ba8SSam Ravnborg .word 11b, __retl_efault 141a88b5ba8SSam Ravnborg .word 12b, __retl_efault 142a88b5ba8SSam Ravnborg .word 13b, __retl_efault 143a88b5ba8SSam Ravnborg .word 14b, __retl_efault 144a88b5ba8SSam Ravnborg .word 15b, __retl_efault 145a88b5ba8SSam Ravnborg .word 16b, __retl_efault 146a88b5ba8SSam Ravnborg .previous 147