Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b881cfc5
Commit
b881cfc5
authored
Jan 09, 2009
by
Francois Gouget
Committed by
Alexandre Julliard
Jan 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix the sysctl() usage and the CPU detection on NetBSD.
parent
5da42336
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
cpu.c
dlls/kernel32/cpu.c
+15
-14
No files found.
dlls/kernel32/cpu.c
View file @
b881cfc5
...
...
@@ -547,7 +547,8 @@ VOID WINAPI GetSystemInfo(
#elif defined (__NetBSD__)
{
int
mib
[
2
];
int
value
[
2
];
int
value
;
size_t
val_len
;
char
model
[
256
];
char
*
cpuclass
;
FILE
*
f
=
fopen
(
"/var/run/dmesg.boot"
,
"r"
);
...
...
@@ -556,33 +557,33 @@ VOID WINAPI GetSystemInfo(
mib
[
0
]
=
CTL_MACHDEP
;
#ifdef CPU_FPU_PRESENT
mib
[
1
]
=
CPU_FPU_PRESENT
;
val
ue
[
1
]
=
sizeof
(
int
);
if
(
sysctl
(
mib
,
2
,
value
,
value
+
1
,
NULL
,
0
)
>=
0
)
val
_len
=
sizeof
(
value
);
if
(
sysctl
(
mib
,
2
,
&
value
,
&
val_len
,
NULL
,
0
)
>=
0
)
if
(
value
)
PF
[
PF_FLOATING_POINT_EMULATED
]
=
FALSE
;
else
PF
[
PF_FLOATING_POINT_EMULATED
]
=
TRUE
;
#endif
#ifdef CPU_SSE
mib
[
1
]
=
CPU_SSE
;
/* this should imply MMX */
val
ue
[
1
]
=
sizeof
(
int
);
if
(
sysctl
(
mib
,
2
,
value
,
value
+
1
,
NULL
,
0
)
>=
0
)
val
_len
=
sizeof
(
value
);
if
(
sysctl
(
mib
,
2
,
&
value
,
&
val_len
,
NULL
,
0
)
>=
0
)
if
(
value
)
PF
[
PF_MMX_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
#endif
#ifdef CPU_SSE2
mib
[
1
]
=
CPU_SSE2
;
/* this should imply MMX */
value
[
1
]
=
sizeof
(
int
);
if
(
sysctl
(
mib
,
2
,
value
,
value
+
1
,
NULL
,
0
)
>=
0
)
value
[
1
]
=
sizeof
(
value
);
if
(
sysctl
(
mib
,
2
,
&
value
,
&
val_len
,
NULL
,
0
)
>=
0
)
if
(
value
)
PF
[
PF_MMX_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
#endif
mib
[
0
]
=
CTL_HW
;
mib
[
1
]
=
HW_NCPU
;
val
ue
[
1
]
=
sizeof
(
int
);
if
(
sysctl
(
mib
,
2
,
value
,
value
+
1
,
NULL
,
0
)
>=
0
)
if
(
value
[
0
]
>
cachedsi
.
dwNumberOfProcessors
)
val
_len
=
sizeof
(
value
);
if
(
sysctl
(
mib
,
2
,
&
value
,
&
val_len
,
NULL
,
0
)
>=
0
)
if
(
value
>
cachedsi
.
dwNumberOfProcessors
)
cachedsi
.
dwNumberOfProcessors
=
value
[
0
];
mib
[
1
]
=
HW_MODEL
;
val
ue
[
1
]
=
255
;
if
(
sysctl
(
mib
,
2
,
model
,
value
+
1
,
NULL
,
0
)
>=
0
)
{
model
[
val
ue
[
1
]
]
=
'\0'
;
/* just in case */
val
_len
=
sizeof
(
model
)
-
1
;
if
(
sysctl
(
mib
,
2
,
model
,
&
val_len
,
NULL
,
0
)
>=
0
)
{
model
[
val
_len
]
=
'\0'
;
/* just in case */
cpuclass
=
strstr
(
model
,
"-class"
);
if
(
cpuclass
!=
NULL
)
{
while
(
cpuclass
>
model
&&
cpuclass
[
0
]
!=
'('
)
cpuclass
--
;
...
...
@@ -636,7 +637,7 @@ VOID WINAPI GetSystemInfo(
#elif defined(__FreeBSD__)
{
int
ret
,
num
;
unsigned
len
;
size_t
len
;
get_cpuinfo
(
&
cachedsi
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment