Loading...
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | /* * sys32.S: I-cache tricks for 32-bit compatability layer simple * conversions. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) * Copyright (C) 2000 Ken Aaker (kdaaker@rchland.vnet.ibm.com) * For PPC ABI convention is parms in Regs 3-10. * The router in entry.S clears the high 32 bits in the first * 4 arguments (R3-R6). * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <asm/ppc_asm.h> #include <asm/errno.h> #include <asm/processor.h> .text _GLOBAL(ppc32_lseek) extsw r4,r4 /* sign extend off_t offset parm */ b .sys_lseek _GLOBAL(sys32_socketcall) /* r3=call, r4=args */ cmpwi r3, 1 blt- .do_einval cmpwi r3, 17 bgt- .do_einval subi r3, r3, 1 /* index into socketcall_table vectors and jmp */ sldi r3, r3, 3 /* each entry is 8 bytes */ LOADADDR(r10,.socketcall_table_begin) ldx r10, r10, r3 mtctr r10 bctr /* Socket function vectored fix ups for 32 bit */ _STATIC(do_sys_socket) /* sys_socket(int, int, int) */ mr r10,r4 1: lwa r3,0(r10) 2: lwa r4,4(r10) 3: lwa r5,8(r10) b .sys_socket .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .previous _STATIC(do_sys_bind) /* sys_bind(int fd, struct sockaddr *, int) */ mr r10,r4 1: lwa r3,0(r10) 2: lwz r4,4(r10) 3: lwa r5,8(r10) b .sys_bind .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .previous _STATIC(do_sys_connect) /* sys_connect(int, struct sockaddr *, int) */ mr r10,r4 1: lwa r3,0(r10) 2: lwz r4,4(r10) 3: lwa r5,8(r10) b .sys_connect .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .previous _STATIC(do_sys_listen) /* sys_listen(int, int) */ mr r10,r4 1: lwa r3,0(r10) 2: lwa r4,4(r10) b .sys_listen .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .previous _STATIC(do_sys_accept) /* sys_accept(int, struct sockaddr *, int *) */ mr r10,r4 1: lwa r3,0(r10) 2: lwz r4,4(r10) 3: lwz r5,8(r10) b .sys_accept .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .previous _STATIC(do_sys_getsockname) /* sys_getsockname(int, struct sockaddr *, int *) */ mr r10,r4 1: lwa r3,0(r10) 2: lwz r4,4(r10) 3: lwz r5,8(r10) b .sys_getsockname .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .previous _STATIC(do_sys_getpeername) /* sys_getpeername(int, struct sockaddr *, int *) */ mr r10,r4 1: lwa r3,0(r10) 2: lwz r4,4(r10) 3: lwz r5,8(r10) b .sys_getpeername .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .previous _STATIC(do_sys_socketpair) /* sys_socketpair(int, int, int, int *) */ mr r10,r4 1: lwa r3,0(r10) 2: lwa r4,4(r10) 3: lwa r5,8(r10) 4: lwz r6,12(r10) b .sys_socketpair .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .llong 4b,.do_efault .previous _STATIC(do_sys_send) /* sys_send(int, void *, size_t, unsigned int) */ mr r10,r4 1: lwa r3,0(r10) 2: lwz r4,4(r10) 3: lwz r5,8(r10) 4: lwz r6,12(r10) b .sys_send .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .llong 4b,.do_efault .previous _STATIC(do_sys_recv) /* sys_recv(int, void *, size_t, unsigned int) */ mr r10,r4 1: lwa r3,0(r10) 2: lwz r4,4(r10) 3: lwz r5,8(r10) 4: lwz r6,12(r10) b .sys_recv .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .llong 4b,.do_efault .previous _STATIC(do_sys_sendto) /* sys32_sendto(int, u32, compat_size_t, unsigned int, u32, int) */ mr r10,r4 1: lwa r3,0(r10) 2: lwz r4,4(r10) 3: lwz r5,8(r10) 4: lwz r6,12(r10) 5: lwz r7,16(r10) 6: lwz r8,20(r10) b .sys_sendto .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .llong 4b,.do_efault .llong 5b,.do_efault .llong 6b,.do_efault .previous _STATIC(do_sys_recvfrom) /* sys32_recvfrom(int, u32, compat_size_t, unsigned int, u32, u32) */ mr r10,r4 1: lwa r3,0(r10) 2: lwz r4,4(r10) 3: lwz r5,8(r10) 4: lwz r6,12(r10) 5: lwz r7,16(r10) 6: lwz r8,20(r10) b .sys_recvfrom .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .llong 4b,.do_efault .llong 5b,.do_efault .llong 6b,.do_efault .previous _STATIC(do_sys_shutdown) /* sys_shutdown(int, int) */ mr r10,r4 1: lwa r3,0(r10) 2: lwa r4,4(r10) b .sys_shutdown .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .previous _STATIC(do_sys_setsockopt) /* sys32_setsockopt(int, int, int, char *, int) */ mr r10,r4 1: lwa r3,0(r10) 2: lwa r4,4(r10) 3: lwa r5,8(r10) 4: lwz r6,12(r10) 5: lwa r7,16(r10) b .sys32_setsockopt .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .llong 4b,.do_efault .llong 5b,.do_efault .previous _STATIC(do_sys_getsockopt) /* sys32_getsockopt(int, int, int, u32, u32) */ mr r10,r4 1: lwa r3,0(r10) 2: lwa r4,4(r10) 3: lwa r5,8(r10) 4: lwz r6,12(r10) 5: lwz r7,16(r10) b .sys32_getsockopt .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .llong 4b,.do_efault .llong 5b,.do_efault .previous _STATIC(do_sys_sendmsg) /* sys32_sendmsg(int, struct msghdr32 *, unsigned int) */ mr r10,r4 1: lwa r3,0(r10) 2: lwz r4,4(r10) 3: lwa r5,8(r10) b .sys32_sendmsg .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .previous _STATIC(do_sys_recvmsg) /* sys32_recvmsg(int, struct msghdr32 *, unsigned int) */ mr r10,r4 1: lwa r3,0(r10) 2: lwz r4,4(r10) 3: lwa r5,8(r10) b .sys32_recvmsg .section __ex_table,"a" .align 3 .llong 1b,.do_efault .llong 2b,.do_efault .llong 3b,.do_efault .previous _STATIC(do_einval) li r3,-EINVAL blr _STATIC(do_efault) li r3,-EFAULT blr .data .align 8 _GLOBAL(socketcall_table_begin) .llong .do_sys_socket .llong .do_sys_bind .llong .do_sys_connect .llong .do_sys_listen .llong .do_sys_accept .llong .do_sys_getsockname .llong .do_sys_getpeername .llong .do_sys_socketpair .llong .do_sys_send .llong .do_sys_recv .llong .do_sys_sendto .llong .do_sys_recvfrom .llong .do_sys_shutdown .llong .do_sys_setsockopt .llong .do_sys_getsockopt .llong .do_sys_sendmsg .llong .do_sys_recvmsg _GLOBAL(socketcall_table_end) |