irix-osi-cred-decl-20040808
[openafs.git] / src / afs / IRIX / osi_misc.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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
8  */
9
10 /*
11  * Implementation of miscellaneous Irix routines.
12  */
13 #include <afsconfig.h>
14 #include "afs/param.h"
15
16 RCSID
17     ("$Header$");
18
19 #ifdef  AFS_SGI62_ENV
20 #include "afs/sysincludes.h"    /* Standard vendor system headers */
21 #include "afsincludes.h"        /* Afs-based standard headers */
22 #include "afs/afs_stats.h"      /* statistics */
23
24
25
26
27 /*
28  * various special purpose routines
29  */
30 void
31 afs_mpservice(void *a)
32 {
33 }
34
35 #ifdef AFS_SGI_VNODE_GLUE
36 #include <sys/invent.h>
37 extern mutex_t afs_init_kern_lock;
38
39 /* afs_init_kernel_config
40  *
41  * initialize vnode glue layer by testing for NUMA.
42  * Argument: flag
43  * 0 = no numa, 1 = has numa, -1 = test for numa.
44  */
45 int
46 afs_init_kernel_config(int flag)
47 {
48     static int afs_kern_inited = 0;
49     int code = 0;
50
51     mutex_enter(&afs_init_kern_lock);
52     if (!afs_kern_inited) {
53         afs_kern_inited = 1;
54
55         if (flag == -1) {
56             inventory_t *pinv;
57             /* test for numa arch. */
58             /* Determine if thisis a NUMA platform. Currently, this is true
59              * only if it's an IP27 or IP35.
60              */
61             pinv =
62                 find_inventory((inventory_t *) NULL, INV_PROCESSOR,
63                                INV_CPUBOARD, -1, -1, -1);
64             if (!pinv)
65                 code = ENODEV;
66             else
67                 afs_is_numa_arch = ((pinv->inv_state == INV_IP27BOARD)
68                                     || (pinv->inv_state == INV_IP35BOARD))
69                     ? 1 : 0;
70         } else
71             afs_is_numa_arch = flag;
72     }
73     mutex_exit(&afs_init_kern_lock);
74     return code;
75 }
76 #endif /* AFS_SGI_VNODE_GLUE */
77
78 /* And just so we know what someone is _really_ running */
79 #ifdef IP19
80 int afs_ipno = 19;
81 #elif defined(IP20)
82 int afs_ipno = 20;
83 #elif defined(IP21)
84 int afs_ipno = 21;
85 #elif defined(IP25)
86 int afs_ipno = 25;
87 #elif defined(IP26)
88 int afs_ipno = 26;
89 #elif defined(IP27)
90 int afs_ipno = 27;
91 #elif defined(IP28)
92 int afs_ipno = 28;
93 #elif defined(IP30)
94 int afs_ipno = 30;
95 #elif defined(IP35)
96 int afs_ipno = 35;
97 #else
98 int afs_ipno = -1;
99 #endif
100
101
102 #endif /* AFS_SGI62_ENV */