Fix circularity in hardware-info
parent
837b89422b
commit
9f90cf6263
|
@ -1,8 +1,8 @@
|
||||||
USING: alien.c-types hardware-info hardware-info.windows
|
USING: alien.c-types hardware-info kernel math namespaces
|
||||||
kernel math namespaces windows windows.kernel32
|
windows windows.kernel32 hardware-info.backend ;
|
||||||
hardware-info.backend ;
|
|
||||||
IN: hardware-info.windows.ce
|
IN: hardware-info.windows.ce
|
||||||
|
|
||||||
|
TUPLE: wince ;
|
||||||
T{ wince } os set-global
|
T{ wince } os set-global
|
||||||
|
|
||||||
: memory-status ( -- MEMORYSTATUS )
|
: memory-status ( -- MEMORYSTATUS )
|
||||||
|
@ -10,6 +10,8 @@ T{ wince } os set-global
|
||||||
"MEMORYSTATUS" heap-size over set-MEMORYSTATUS-dwLength
|
"MEMORYSTATUS" heap-size over set-MEMORYSTATUS-dwLength
|
||||||
[ GlobalMemoryStatus ] keep ;
|
[ GlobalMemoryStatus ] keep ;
|
||||||
|
|
||||||
|
M: wince cpus ( -- n ) 1 ;
|
||||||
|
|
||||||
M: wince memory-load ( -- n )
|
M: wince memory-load ( -- n )
|
||||||
memory-status MEMORYSTATUS-dwMemoryLoad ;
|
memory-status MEMORYSTATUS-dwMemoryLoad ;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
USING: alien alien.c-types hardware-info hardware-info.windows
|
USING: alien alien.c-types kernel libc math namespaces
|
||||||
kernel libc math namespaces hardware-info.backend
|
hardware-info.backend windows windows.advapi32 windows.kernel32
|
||||||
windows windows.advapi32 windows.kernel32 ;
|
;
|
||||||
IN: hardware-info.windows.nt
|
IN: hardware-info.windows.nt
|
||||||
|
|
||||||
|
TUPLE: winnt ;
|
||||||
|
|
||||||
T{ winnt } os set-global
|
T{ winnt } os set-global
|
||||||
|
|
||||||
|
: system-info ( -- SYSTEM_INFO )
|
||||||
|
"SYSTEM_INFO" <c-object> [ GetSystemInfo ] keep ;
|
||||||
|
|
||||||
|
M: winnt cpus ( -- n )
|
||||||
|
system-info SYSTEM_INFO-dwNumberOfProcessors ;
|
||||||
|
|
||||||
: memory-status ( -- MEMORYSTATUSEX )
|
: memory-status ( -- MEMORYSTATUSEX )
|
||||||
"MEMORYSTATUSEX" <c-object>
|
"MEMORYSTATUSEX" <c-object>
|
||||||
"MEMORYSTATUSEX" heap-size over set-MEMORYSTATUSEX-dwLength
|
"MEMORYSTATUSEX" heap-size over set-MEMORYSTATUSEX-dwLength
|
||||||
|
|
|
@ -1,22 +1,15 @@
|
||||||
USING: alien alien.c-types kernel libc math namespaces
|
USING: alien alien.c-types kernel libc math namespaces
|
||||||
windows windows.kernel32 windows.advapi32
|
windows windows.kernel32 windows.advapi32
|
||||||
words combinators vocabs.loader hardware-info.backend ;
|
words combinators vocabs.loader hardware-info.backend
|
||||||
|
system ;
|
||||||
IN: hardware-info.windows
|
IN: hardware-info.windows
|
||||||
|
|
||||||
TUPLE: wince ;
|
|
||||||
TUPLE: winnt ;
|
|
||||||
UNION: windows wince winnt ;
|
|
||||||
USE: system
|
|
||||||
|
|
||||||
: system-info ( -- SYSTEM_INFO )
|
: system-info ( -- SYSTEM_INFO )
|
||||||
"SYSTEM_INFO" <c-object> [ GetSystemInfo ] keep ;
|
"SYSTEM_INFO" <c-object> [ GetSystemInfo ] keep ;
|
||||||
|
|
||||||
: page-size ( -- n )
|
: page-size ( -- n )
|
||||||
system-info SYSTEM_INFO-dwPageSize ;
|
system-info SYSTEM_INFO-dwPageSize ;
|
||||||
|
|
||||||
M: windows cpus ( -- n )
|
|
||||||
system-info SYSTEM_INFO-dwNumberOfProcessors ;
|
|
||||||
|
|
||||||
! 386, 486, 586, 2200 (IA64), 8664 (AMD_X8664)
|
! 386, 486, 586, 2200 (IA64), 8664 (AMD_X8664)
|
||||||
: processor-type ( -- n )
|
: processor-type ( -- n )
|
||||||
system-info SYSTEM_INFO-dwProcessorType ;
|
system-info SYSTEM_INFO-dwProcessorType ;
|
||||||
|
@ -70,8 +63,7 @@ M: windows cpus ( -- n )
|
||||||
: system-windows-directory ( -- str )
|
: system-windows-directory ( -- str )
|
||||||
\ GetSystemWindowsDirectory get-directory ;
|
\ GetSystemWindowsDirectory get-directory ;
|
||||||
|
|
||||||
<< {
|
{
|
||||||
{ [ wince? ] [ "hardware-info.windows.ce" ] }
|
{ [ wince? ] [ "hardware-info.windows.ce" ] }
|
||||||
{ [ winnt? ] [ "hardware-info.windows.nt" ] }
|
{ [ winnt? ] [ "hardware-info.windows.nt" ] }
|
||||||
{ [ t ] [ f ] }
|
} cond [ require ] when*
|
||||||
} cond [ require ] when* >>
|
|
||||||
|
|
Loading…
Reference in New Issue