Changeset 1920
- Timestamp:
- Apr 26, 2005, 4:22:50 AM (20 years ago)
- Location:
- trunk/src/emx/src/lib/misc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/misc/sysctl.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1919 r1920 41 41 42 42 #include <sys/param.h> 43 #define _KERNEL44 #include <sys/sysctl.h>45 43 #include <386/builtin.h> 46 44 #include <sys/fmutex.h> … … 49 47 #include <string.h> 50 48 #include <stdio.h> 49 #define _KERNEL 50 #include <sys/sysctl.h> 51 51 52 52 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_MISC … … 74 74 static int sysctl_root(SYSCTL_HANDLER_ARGS); 75 75 76 struct sysctl_oid_list sysctl__children ; /* root list */76 struct sysctl_oid_list sysctl__children = {0}; /* root list */ 77 77 78 78 static struct sysctl_oid * -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/sysctl_mib.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1919 r1920 134 134 #endif 135 135 136 #if 0 /* in sysctl_os2.c */ 136 137 //char kernelname[MAXPATHLEN] = "/kernel"; /* XXX bloat */ 137 138 // … … 139 140 // kernelname, sizeof kernelname, "Name of kernel file booted"); 140 141 141 #ifdef SMP 142 SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD, 143 &mp_ncpus, 0, "Number of active CPUs"); 144 #else 145 SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD, 146 0, 1, "Number of active CPUs"); 142 //#ifdef SMP 143 //SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD, 144 // &mp_ncpus, 0, "Number of active CPUs"); 145 //#else 146 //SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD, 147 // 0, 1, "Number of active CPUs"); 148 //#endif 147 149 #endif 148 150 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/sysctl_os2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1919 r1920 25 25 */ 26 26 27 /******************************************************************************* 28 * Header Files * 29 *******************************************************************************/ 27 30 #include "libc-alias.h" 28 31 29 32 #define INCL_BASE 30 33 #define INCL_ERRORS 31 #include <os2.h> 34 #define INCL_FSMACROS 35 #include <os2emx.h> 32 36 33 37 #include <unistd.h> … … 53 57 } u; 54 58 ULONG ul; 59 FS_VAR_SAVE_LOAD(); 55 60 56 61 /* Try the highres timer first. */ … … 75 80 tv.tv_sec -= ul / 1000; 76 81 } 82 FS_RESTORE(); 77 83 if (tv.tv_usec < 0) 78 84 { … … 103 109 0, 0, sysctl_kern_bootfile, "A", "Kernel file"); 104 110 111 112 /* 113 * HW 114 */ 115 116 SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, 117 "i386", sizeof("i386"), "Machine"); 118 119 /** 120 * HW_MODEL 121 */ 122 static int sysctl_hw_model(SYSCTL_HANDLER_ARGS) 123 { 124 static union 125 { 126 char szModel[17]; 127 uint32_t uRegs[4]; 128 } u; 129 if (!u.szModel[0]) 130 { 131 int i; 132 asm ("cpuid\n" 133 : "=a" (i), 134 "=b" (u.uRegs[0]), 135 "=c" (u.uRegs[2]), 136 "=d" (u.uRegs[1]) 137 : "a" (0) 138 ); 139 } 140 141 return (sysctl_handle_string(oidp, u.szModel, sizeof(u.szModel), req)); 142 } 143 144 SYSCTL_PROC(_hw, HW_MODEL, hw_model, CTLFLAG_RD, 145 0, 0, sysctl_hw_model, "A", "Process model"); 146 147 /** 148 * Number of CPUs. 149 */ 150 static int sysctl_hw_ncpus(SYSCTL_HANDLER_ARGS) 151 { 152 static u_int cCpus; 153 if (!cCpus) 154 { 155 ULONG ul; 156 FS_VAR_SAVE_LOAD(); 157 if (DosQuerySysInfo(QSV_NUMPROCESSORS, QSV_NUMPROCESSORS, &ul, sizeof(ul))) 158 ul = 1; 159 cCpus = ul; 160 FS_RESTORE(); 161 } 162 163 return (sysctl_handle_int(oidp, &cCpus, 0, req)); 164 } 165 166 SYSCTL_PROC(_hw, HW_NCPU, ncpus, CTLFLAG_RD, 167 0, 0, sysctl_hw_ncpus, "UI", "number of cpus"); 168 169 170 SYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD, 171 "i386", sizeof("i386"), "Machine arch"); 172 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.