2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * Linux module support routines.
14 #include <afsconfig.h>
15 #include "afs/param.h"
20 #ifdef AFS_LINUX24_ENV
21 #include <linux/module.h> /* early to avoid printf->printk mapping */
23 #include "afs/sysincludes.h"
24 #include "afsincludes.h"
25 #include "h/unistd.h" /* For syscall numbers. */
28 #ifdef AFS_AMD64_LINUX20_ENV
29 #include <asm/ia32_unistd.h>
32 #include <linux/proc_fs.h>
33 #include <linux/slab.h>
34 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
35 #include <linux/init.h>
36 #include <linux/sched.h>
40 #define NR_syscalls 222
43 /* On SPARC64 and S390X, sys_call_table contains 32-bit entries
44 * even though pointers are 64 bit quantities.
45 * XXX unify this with osi_probe.c
47 #if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_S390X_LINUX24_ENV)
48 #define SYSCALLTYPE unsigned int
49 #define POINTER2SYSCALL (unsigned int)(unsigned long)
50 #define SYSCALL2POINTER (void *)(long)
52 #define SYSCALLTYPE void *
53 #define POINTER2SYSCALL (void *)
54 #define SYSCALL2POINTER (void *)
57 #if defined(AFS_S390X_LINUX24_ENV)
58 #define INSERT_SYSCALL(SLOT, TMPPAGE, FUNC) \
59 if (SYSCALL2POINTER FUNC > 0x7fffffff) { \
60 TMPPAGE = kmalloc ( PAGE_SIZE, GFP_DMA|GFP_KERNEL ); \
61 if (SYSCALL2POINTER TMPPAGE > 0x7fffffff) { \
62 printf("Cannot allocate page for FUNC syscall jump vector\n"); \
65 memcpy(TMPPAGE, syscall_jump_code, sizeof(syscall_jump_code)); \
66 *(void **)(TMPPAGE + 0x0c) = &FUNC; \
67 afs_sys_call_table[_S(SLOT)] = POINTER2SYSCALL TMPPAGE; \
69 afs_sys_call_table[_S(SLOT)] = POINTER2SYSCALL FUNC;
71 #define INSERT_SYSCALL(SLOT, TMPPAGE, FUNC) \
72 afs_sys_call_table[_S(SLOT)] = POINTER2SYSCALL FUNC;
75 #if defined(AFS_S390X_LINUX24_ENV) && !defined(AFS_LINUX26_ENV)
76 #define _S(x) ((x)<<1)
77 #elif defined(AFS_IA64_LINUX20_ENV)
78 #define _S(x) ((x)-1024)
84 /***** ALL PLATFORMS *****/
85 extern asmlinkage long
86 afs_syscall(long syscall, long parm1, long parm2, long parm3, long parm4);
88 static SYSCALLTYPE *afs_sys_call_table;
89 static SYSCALLTYPE afs_ni_syscall = 0;
91 #ifdef AFS_S390X_LINUX24_ENV
92 static void *afs_sys_setgroups_page = 0;
93 static void *afs_sys_setgroups32_page = 0;
94 static void *afs_syscall_page = 0;
96 /* Because of how the syscall table is handled, we need to ensure our
97 syscalls are within the first 2gb of address space. This means we need
98 self-modifying code we can inject to call our handlers if the module
99 is loaded high. If keyrings had advanced as fast as false protection
100 this would be unnecessary. */
102 uint32_t syscall_jump_code[] = {
103 0xe3d0f030, 0x00240dd0, 0xa7f40006, 0xffffffff, 0xffffffff, 0xe310d004,
104 0x0004e3d0, 0xf0300004, 0x07f10000,
108 extern long afs_xsetgroups();
109 asmlinkage long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist);
111 #ifdef AFS_LINUX24_ENV
112 extern int afs_xsetgroups32();
113 asmlinkage int (*sys_setgroups32p) (int gidsetsize,
114 __kernel_gid32_t * grouplist);
117 #if !defined(AFS_LINUX24_ENV)
118 asmlinkage int (*sys_settimeofdayp) (struct timeval * tv, struct timezone * tz);
123 #ifdef AFS_AMD64_LINUX20_ENV
124 static SYSCALLTYPE *afs_ia32_sys_call_table;
125 static SYSCALLTYPE ia32_ni_syscall = 0;
127 extern int afs32_xsetgroups();
128 asmlinkage long (*sys32_setgroupsp) (int gidsetsize, u16 * grouplist);
129 #ifdef AFS_LINUX24_ENV
130 extern int afs32_xsetgroups32();
131 asmlinkage long (*sys32_setgroups32p) (int gidsetsize, gid_t * grouplist);
132 #endif /* __NR_ia32_setgroups32 */
133 #endif /* AFS_AMD64_LINUX20_ENV */
137 #ifdef AFS_PPC64_LINUX26_ENV
138 static SYSCALLTYPE *afs_sys_call_table32;
139 static SYSCALLTYPE afs_ni_syscall32 = 0;
140 static SYSCALLTYPE old_sys_setgroupsp = 0;
141 static SYSCALLTYPE old_sys32_setgroupsp = 0;
143 extern int afs32_xsetgroups();
144 asmlinkage long (*sys32_setgroupsp)(int gidsetsize, gid_t *grouplist);
146 asmlinkage long sys_close(unsigned int fd);
147 static void sys_setgroups_stub()
148 __attribute__ ((pure,const,no_instrument_function));
149 static void sys_setgroups_stub()
151 printf("*** error! sys_setgroups_stub called\n");
154 static void sys32_setgroups_stub()
155 __attribute__ ((pure,const,no_instrument_function));
156 static void sys32_setgroups_stub()
158 printf("*** error! sys32_setgroups_stub called\n");
161 #endif /* AFS_AMD64_LINUX20_ENV */
164 /***** SPARC64 *****/
165 #ifdef AFS_SPARC64_LINUX20_ENV
166 #ifdef AFS_SPARC64_LINUX26_ENV
167 static SYSCALLTYPE *afs_sys_call_table32;
169 extern SYSCALLTYPE *afs_sys_call_table32;
171 static SYSCALLTYPE afs_ni_syscall32 = 0;
173 extern int afs32_xsetgroups();
174 #ifdef AFS_SPARC64_LINUX26_ENV
175 asmlinkage int (*sys32_setgroupsp) (int gidsetsize,
176 __kernel_gid32_t * grouplist);
178 asmlinkage int (*sys32_setgroupsp) (int gidsetsize,
179 __kernel_gid_t32 * grouplist);
181 #ifdef AFS_LINUX24_ENV
182 /* This number is not exported for some bizarre reason. */
183 #define __NR_setgroups32 82
184 extern int afs32_xsetgroups32();
185 #ifdef AFS_SPARC64_LINUX26_ENV
186 asmlinkage int (*sys32_setgroups32p) (int gidsetsize,
187 __kernel_gid32_t * grouplist);
189 asmlinkage int (*sys32_setgroups32p) (int gidsetsize,
190 __kernel_gid_t32 * grouplist);
195 afs_syscall32(long syscall, long parm1, long parm2, long parm3, long parm4,
198 __asm__ __volatile__("srl %o4, 0, %o4\n\t"
200 "call afs_syscall\n\t"
201 "srl %o5, 0, %o5\n\t"
205 #endif /* AFS_SPARC64_LINUX20_ENV */
209 #ifdef AFS_IA64_LINUX20_ENV
212 afs_syscall_stub(int r0, int r1, long r2, long r3, long r4, long gp)
214 __asm__ __volatile__("alloc r42 = ar.pfs, 8, 3, 6, 0\n\t"
215 "mov r41 = b0\n\t" /* save rp */
221 "mov out5 = gp\n\t" /* save gp */
226 "addl r15=.fptr_afs_syscall-.L1,r3\n\t"
230 "ld8 r16=[r15],8\n\t"
234 "br.call.sptk.many b0 = b6\n\t"
236 "mov ar.pfs = r42\n\t"
238 "mov gp = r48\n\t" /* restore gp */
239 "br.ret.sptk.many b0\n"
240 ".fptr_afs_syscall:\n\t"
241 "data8 @fptr(afs_syscall)\n\t"
246 afs_xsetgroups_stub(int r0, int r1, long r2, long r3, long r4, long gp)
248 __asm__ __volatile__("alloc r42 = ar.pfs, 8, 3, 6, 0\n\t"
249 "mov r41 = b0\n\t" /* save rp */
255 "mov out5 = gp\n\t" /* save gp */
260 "addl r15=.fptr_afs_xsetgroups - .L2,r3\n\t"
264 "ld8 r16=[r15],8\n\t"
268 "br.call.sptk.many b0 = b6\n\t"
270 "mov ar.pfs = r42\n\t"
272 "mov gp = r48\n\t" /* restore gp */
273 "br.ret.sptk.many b0\n"
274 ".fptr_afs_xsetgroups:\n\t"
275 "data8 @fptr(afs_xsetgroups)\n\t"
284 #endif /* AFS_IA64_LINUX20_ENV */
288 * sys_call_table hook for PPC64
289 * by Soewono Effendi <Soewono.Effendi@sysgo.de>
290 * for IBM Deutschland
291 * Thanks go to SYSGO's team for their support:
292 * Horst Birthelmer <Horst.Birthelmer@sysgo.de>
293 * Marius Groeger <Marius.Groeger@sysgo.de>
295 #if defined(AFS_PPC64_LINUX26_ENV)
296 extern void flush_cache(void *, unsigned long);
297 #define PPC_LO(v) ((v) & 0xffff)
298 #define PPC_HI(v) (((v) >> 16) & 0xffff)
299 #define PPC_HA(v) PPC_HI ((v) + 0x8000)
300 #define PPC_HLO(v) ((short)(((v) >> 32) & 0xffff))
301 #define PPC_HHI(v) ((short)(((v) >> 48) & 0xffff))
305 unsigned long funcaddr;
311 unsigned char jump[136];
314 struct ppc64_opd opd;
315 } __attribute__ ((packed));
317 /* a stub to fix up r2 (TOC ptr) and to jump to our sys_call hook
318 function. We patch the new r2 value and function pointer into
320 #define PPC64_STUB(stub) \
321 static struct ppc64_stub stub = \
323 0xf8, 0x41, 0x00, 0x28, /* std r2,40(r1) */ \
324 0xfb, 0xc1, 0xff, 0xf0, /* std r30,-16(r1) */ \
325 0xfb, 0xa1, 0xff, 0xe8, /* std r29,-24(r1) */ \
326 0x7c, 0x5d, 0x13, 0x78, /* mr r29,r2 */ \
327 0x3c, 0x40, 0x12, 0x34, /*16: lis r2,4660 */ \
328 0x60, 0x42, 0x56, 0x78, /*20: ori r2,r2,22136 */ \
329 0x78, 0x42, 0x07, 0xc6, /* rldicr r2,r2,32,31 */ \
330 0x64, 0x42, 0x90, 0xab, /*28: oris r2,r2,37035 */ \
331 0x60, 0x42, 0xcd, 0xef, /*32: ori r2,r2,52719 */ \
332 0x3f, 0xc2, 0x00, 0x00, /*36: addis r30,r2,0 */ \
333 0x3b, 0xde, 0x00, 0x00, /*40: addi r30,r30,0 */ \
334 0xfb, 0xbe, 0x00, 0x88, /* std r29,136(r30) */ \
335 0x7f, 0xa8, 0x02, 0xa6, /* mflr r29 */ \
336 0xfb, 0xbe, 0x00, 0x90, /* std r29,144(r30) */ \
337 0xeb, 0xde, 0x00, 0x98, /* ld r30,152(r30) */ \
338 0x7f, 0xc8, 0x03, 0xa6, /* mtlr r30 */ \
339 0xeb, 0xa1, 0xff, 0xe8, /* ld r29,-24(r1) */ \
340 0xeb, 0xc1, 0xff, 0xf0, /* ld r30,-16(r1) */ \
341 0x4e, 0x80, 0x00, 0x21, /* blrl */ \
342 0x3c, 0x40, 0x12, 0x34, /*76: lis r2,4660 */ \
343 0x60, 0x42, 0x56, 0x78, /*80: ori r2,r2,22136 */ \
344 0x78, 0x42, 0x07, 0xc6, /* rldicr r2,r2,32,31 */ \
345 0x64, 0x42, 0x90, 0xab, /*88: oris r2,r2,37035 */ \
346 0x60, 0x42, 0xcd, 0xef, /*92: ori r2,r2,52719 */ \
347 0xfb, 0xc1, 0xff, 0xf0, /* std r30,-16(r1) */ \
348 0xfb, 0xa1, 0xff, 0xe8, /* std r29,-24(r1) */ \
349 0x3f, 0xc2, 0xab, 0xcd, /*104: addis r30,r2,-21555 */ \
350 0x3b, 0xde, 0x78, 0x90, /*108: addi r30,r30,30864 */ \
351 0xeb, 0xbe, 0x00, 0x90, /* ld r29,144(r30) */ \
352 0x7f, 0xa8, 0x03, 0xa6, /* mtlr r29 */ \
353 0xe8, 0x5e, 0x00, 0x88, /* ld r2,136(r30) */ \
354 0xeb, 0xa1, 0xff, 0xe8, /* ld r29,-24(r1) */ \
355 0xeb, 0xc1, 0xff, 0xf0, /* ld r30,-16(r1) */ \
356 0x4e, 0x80, 0x00, 0x20 /* blr */ \
359 static void * create_stub(struct ppc64_stub *stub,
360 struct ppc64_opd *opd)
362 unsigned short *p1, *p2, *p3, *p4;
365 stub->opd.funcaddr = opd->funcaddr;
366 stub->opd.r2 = opd->r2;
367 addr = (unsigned long) opd->r2;
368 p1 = (unsigned short*) &stub->jump[18];
369 p2 = (unsigned short*) &stub->jump[22];
370 p3 = (unsigned short*) &stub->jump[30];
371 p4 = (unsigned short*) &stub->jump[34];
378 addr = (unsigned long) stub - opd->r2;
379 p1 = (unsigned short*) &stub->jump[38];
380 p2 = (unsigned short*) &stub->jump[42];
383 p1 = (unsigned short*) &stub->jump[106];
384 p2 = (unsigned short*) &stub->jump[110];
388 addr = (unsigned long) opd->r2;
389 p1 = (unsigned short*) &stub->jump[78];
390 p2 = (unsigned short*) &stub->jump[82];
391 p3 = (unsigned short*) &stub->jump[90];
392 p4 = (unsigned short*) &stub->jump[94];
399 flush_cache((void *)stub, sizeof(*stub));
400 return ((void*)(stub));
403 PPC64_STUB(afs_sys_call_stub);
404 PPC64_STUB(afs_xsetgroups_stub);
405 PPC64_STUB(afs_xsetgroups32_stub);
406 #endif /* AFS_PPC64_LINUX26_ENV */
409 /**********************************************************************/
410 /********************* System Call Initialization *********************/
411 /**********************************************************************/
413 int osi_syscall_init(void)
416 #ifdef AFS_IA64_LINUX20_ENV
417 /* This needs to be first because we are declaring variables, and
418 * also because the handling of syscall pointers is bizarre enough
419 * that we want to special-case even the "common" part.
421 unsigned long kernel_gp = 0;
422 static struct fptr sys_setgroups;
424 afs_sys_call_table = osi_find_syscall_table(0);
425 if (afs_sys_call_table) {
427 #if !defined(AFS_LINUX24_ENV)
428 /* XXX no sys_settimeofday on IA64? */
431 /* check we aren't already loaded */
432 /* XXX this can't be right */
433 if (SYSCALL2POINTER afs_sys_call_table[_S(__NR_afs_syscall)]
435 printf("AFS syscall entry point already in use!\n");
439 /* setup AFS entry point */
440 afs_ni_syscall = afs_sys_call_table[_S(__NR_afs_syscall)];
441 afs_sys_call_table[_S(__NR_afs_syscall)] =
442 POINTER2SYSCALL((struct fptr *)afs_syscall_stub)->ip;
444 /* setup setgroups */
445 sys_setgroupsp = (void *)&sys_setgroups;
447 ((struct fptr *)sys_setgroupsp)->ip =
448 SYSCALL2POINTER afs_sys_call_table[_S(__NR_setgroups)];
449 ((struct fptr *)sys_setgroupsp)->gp = kernel_gp;
451 afs_sys_call_table[_S(__NR_setgroups)] =
452 POINTER2SYSCALL((struct fptr *)afs_xsetgroups_stub)->ip;
455 /* XXX no 32-bit syscalls on IA64? */
458 #elif defined(AFS_PPC64_LINUX26_ENV)
460 afs_sys_call_table = osi_find_syscall_table(0);
461 if (afs_sys_call_table) {
463 struct ppc64_opd* opd = (struct ppc64_opd*) sys_close;
464 unsigned long r2 = opd->r2;
465 opd = (struct ppc64_opd*) afs_syscall;
466 afs_sys_call_table32 = (unsigned long)afs_sys_call_table -
467 NR_syscalls * sizeof(SYSCALLTYPE);
468 /* check we aren't already loaded */
469 p = SYSCALL2POINTER afs_sys_call_table[_S(__NR_afs_syscall)];
470 if ((unsigned long)p == opd->funcaddr) {
471 printf("AFS syscall entry point already in use!\n");
474 /* setup AFS entry point */
475 p = create_stub(&afs_sys_call_stub, opd);
476 afs_ni_syscall = afs_sys_call_table[_S(__NR_afs_syscall)];
477 afs_sys_call_table[_S(__NR_afs_syscall)] = POINTER2SYSCALL p;
479 /* setup setgroups */
480 opd = (struct ppc64_opd*) afs_xsetgroups;
481 p = create_stub(&afs_xsetgroups_stub, opd);
482 old_sys_setgroupsp = SYSCALL2POINTER afs_sys_call_table[_S(__NR_setgroups)];
483 afs_sys_call_table[_S(__NR_setgroups)] = POINTER2SYSCALL p;
484 opd = (struct ppc64_opd*) sys_setgroups_stub;
485 opd->funcaddr = old_sys_setgroupsp;
488 /* setup setgroups32 */
489 opd = (struct ppc64_opd*) afs32_xsetgroups;
490 p = create_stub(&afs_xsetgroups32_stub, opd);
491 old_sys32_setgroupsp = SYSCALL2POINTER afs_sys_call_table32[_S(__NR_setgroups)];
492 afs_sys_call_table32[_S(__NR_setgroups)] = POINTER2SYSCALL p;
493 opd = (struct ppc64_opd*) sys32_setgroups_stub;
494 opd->funcaddr = old_sys32_setgroupsp;
497 flush_cache((void *)afs_sys_call_table, 2*NR_syscalls*sizeof(void*));
499 sys_setgroupsp = sys_setgroups_stub;
500 sys32_setgroupsp = sys32_setgroups_stub;
502 /***** COMMON (except IA64 or PPC64) *****/
503 #else /* !AFS_IA64_LINUX20_ENV */
505 afs_sys_call_table = osi_find_syscall_table(0);
506 if (afs_sys_call_table) {
507 #if !defined(AFS_LINUX24_ENV)
509 SYSCALL2POINTER afs_sys_call_table[_S(__NR_settimeofday)];
510 #endif /* AFS_LINUX24_ENV */
512 /* check we aren't already loaded */
513 if (SYSCALL2POINTER afs_sys_call_table[_S(__NR_afs_syscall)]
515 printf("AFS syscall entry point already in use!\n");
519 /* setup AFS entry point */
520 afs_ni_syscall = afs_sys_call_table[_S(__NR_afs_syscall)];
522 INSERT_SYSCALL(__NR_afs_syscall, afs_syscall_page, afs_syscall)
524 /* setup setgroups */
525 sys_setgroupsp = SYSCALL2POINTER afs_sys_call_table[_S(__NR_setgroups)];
526 INSERT_SYSCALL(__NR_setgroups, afs_sys_setgroups_page, afs_xsetgroups)
528 #if defined(__NR_setgroups32)
529 /* setup setgroups32 */
530 sys_setgroups32p = SYSCALL2POINTER afs_sys_call_table[__NR_setgroups32];
531 INSERT_SYSCALL(__NR_setgroups32, afs_sys_setgroups32_page, afs_xsetgroups32)
534 #endif /* !AFS_IA64_LINUX20_ENV */
538 #ifdef AFS_AMD64_LINUX20_ENV
539 afs_ia32_sys_call_table = osi_find_syscall_table(1);
540 if (afs_ia32_sys_call_table) {
541 /* setup AFS entry point for IA32 */
542 ia32_ni_syscall = afs_ia32_sys_call_table[__NR_ia32_afs_syscall];
543 afs_ia32_sys_call_table[__NR_ia32_afs_syscall] =
544 POINTER2SYSCALL afs_syscall;
546 /* setup setgroups for IA32 */
548 SYSCALL2POINTER afs_ia32_sys_call_table[__NR_ia32_setgroups];
549 afs_ia32_sys_call_table[__NR_ia32_setgroups] =
550 POINTER2SYSCALL afs32_xsetgroups;
553 /* setup setgroups32 for IA32 */
555 SYSCALL2POINTER afs_ia32_sys_call_table[__NR_ia32_setgroups32];
556 afs_ia32_sys_call_table[__NR_ia32_setgroups32] =
557 POINTER2SYSCALL afs32_xsetgroups32;
558 #endif /* __NR_ia32_setgroups32 */
560 #endif /* AFS_AMD64_LINUX20_ENV */
563 /***** SPARC64 *****/
564 #ifdef AFS_SPARC64_LINUX20_ENV
565 afs_sys_call_table32 = osi_find_syscall_table(1);
566 if (afs_sys_call_table32) {
567 /* setup AFS entry point for 32-bit SPARC */
568 afs_ni_syscall32 = afs_sys_call_table32[__NR_afs_syscall];
569 afs_sys_call_table32[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall32;
571 /* setup setgroups for 32-bit SPARC */
572 sys32_setgroupsp = SYSCALL2POINTER afs_sys_call_table32[__NR_setgroups];
573 afs_sys_call_table32[__NR_setgroups] = POINTER2SYSCALL afs32_xsetgroups;
575 #ifdef AFS_LINUX24_ENV
576 /* setup setgroups32 for 32-bit SPARC */
578 SYSCALL2POINTER afs_sys_call_table32[__NR_setgroups32];
579 afs_sys_call_table32[__NR_setgroups32] =
580 POINTER2SYSCALL afs32_xsetgroups32;
583 #endif /* AFS_SPARC64_LINUX20_ENV */
589 /**********************************************************************/
590 /************************ System Call Cleanup *************************/
591 /**********************************************************************/
593 void osi_syscall_clean(void)
596 if (afs_sys_call_table) {
597 /* put back the AFS entry point */
598 afs_sys_call_table[_S(__NR_afs_syscall)] = afs_ni_syscall;
600 /* put back setgroups */
601 #if defined(AFS_IA64_LINUX20_ENV)
602 afs_sys_call_table[_S(__NR_setgroups)] =
603 POINTER2SYSCALL((struct fptr *)sys_setgroupsp)->ip;
604 #elif defined(AFS_PPC64_LINUX26_ENV)
605 afs_sys_call_table[_S(__NR_setgroups)] =
606 POINTER2SYSCALL old_sys_setgroupsp;
607 /* put back setgroups32 for PPC64 */
608 afs_sys_call_table32[__NR_setgroups] =
609 POINTER2SYSCALL old_sys32_setgroupsp;
610 #else /* AFS_IA64_LINUX20_ENV */
611 afs_sys_call_table[_S(__NR_setgroups)] =
612 POINTER2SYSCALL sys_setgroupsp;
615 #if defined(__NR_setgroups32) && !defined(AFS_IA64_LINUX20_ENV)
616 /* put back setgroups32 */
617 afs_sys_call_table[__NR_setgroups32] = POINTER2SYSCALL sys_setgroups32p;
619 #if defined(AFS_S390X_LINUX24_ENV)
620 #if defined(__NR_setgroups32) && !defined(AFS_IA64_LINUX20_ENV)
621 if (afs_sys_setgroups32_page)
622 kfree(afs_sys_setgroups32_page);
624 if (afs_sys_setgroups_page)
625 kfree(afs_sys_setgroups_page);
626 if (afs_syscall_page)
627 kfree(afs_syscall_page);
633 #ifdef AFS_IA64_LINUX20_ENV
634 /* XXX no 32-bit syscalls on IA64? */
639 #ifdef AFS_AMD64_LINUX20_ENV
640 if (afs_ia32_sys_call_table) {
641 /* put back AFS entry point for IA32 */
642 afs_ia32_sys_call_table[__NR_ia32_afs_syscall] =
643 POINTER2SYSCALL ia32_ni_syscall;
645 /* put back setgroups for IA32 */
646 afs_ia32_sys_call_table[__NR_ia32_setgroups] =
647 POINTER2SYSCALL sys32_setgroupsp;
649 #ifdef AFS_LINUX24_ENV
650 /* put back setgroups32 for IA32 */
651 afs_ia32_sys_call_table[__NR_ia32_setgroups32] =
652 POINTER2SYSCALL sys32_setgroups32p;
658 /***** SPARC64 *****/
659 #ifdef AFS_SPARC64_LINUX20_ENV
660 if (afs_sys_call_table32) {
661 /* put back AFS entry point for 32-bit SPARC */
662 afs_sys_call_table32[__NR_afs_syscall] = afs_ni_syscall32;
664 /* put back setgroups for IA32 */
665 afs_sys_call_table32[__NR_setgroups] =
666 POINTER2SYSCALL sys32_setgroupsp;
668 #ifdef AFS_LINUX24_ENV
669 /* put back setgroups32 for IA32 */
670 afs_sys_call_table32[__NR_setgroups32] =
671 POINTER2SYSCALL sys32_setgroups32p;