這些是 KernelIoControl 中 FILE_DEVICE_HAL 用的 control code, 號碼是十進位, 這些是從 FreeScale 的 BSP 裡挖出來的, 還不是全部的 Control Code..
CTL_CODE(FILE_DEVICE_HAL, xx, METHOD_BUFFERED, FILE_ANY_ACCESS)
xx:
01 HAL_GET_DEVICE_INFO
03 HAL_GET_IP_ADDR
04 HAL_RADIO_CNTRL
05 HAL_DDK_CALL
06 EDBG_REGISTER_CLIENT
07 EDBG_DEREGISTER_CLIENT
08 EDBG_REGISTER_DFLT_CLIENT
09 EDBG_SEND
10 EDBG_RECV
11 EDBG_SET_DEBUG
78 KITL_STARTUP
79 KITL_INTRINIT
80 KITL_IS_KDBG_REGISTERED
// KITL PowerOn/Off ioctl, *lpInBuf = 0 for off, 1 for on.
81 KITL_POWER_CALL
12 SET_KERNEL_COMM_DEV
13 HAL_GET_UUID
14 HAL_INIT_RTC
15 HAL_REBOOT
16 HAL_HALT
17 SET_KERNEL_DEV_PORT
18 HAL_TRANSLATE_IRQ
19 HAL_GET_RIO_INFO
20 HAL_ILTIMING
21 HAL_GET_DEVICEID
22 HAL_PROFILE
23 HAL_SET_DEVICE_INFO
24 QUERY_PHYSICALMEM
25 PROCESSOR_INFORMATION
35 HAL_GETREGSECUREKEYS
36 HAL_REQUEST_IRQ
38 HAL_REQUEST_SYSINTR
54 HAL_RELEASE_SYSINTR
// IOCTL to get KITL transport info
37 KITL_GET_INFO
40 HAL_ENABLE_WAKE
41 HAL_DISABLE_WAKE
42 HAL_GET_WAKE_SOURCE
61 HAL_PRESUSPEND
// IOCTL to tell OEM to initialize registry on boot
44 HAL_INITREGISTRY
// IOCTL to give OEM a more full-featured init when the kernel is ready to go
// and before any apps are started
45 HAL_POSTINIT
// IOCTL to ask OEM whether to force clean registry hive
49 HAL_GET_HIVE_CLEAN_FLAG
// IOCTL to ask OEM the reason for power on
50 HAL_GET_POWERONREASON
// IOCTL to get random hardware seed
52 HAL_GET_RANDOM_SEED
// IOCTL to ask OEM for a RAM region to put the registry hive into
53 GET_HIVE_RAM_REGION
// IOCTL to tell OEM to save the RAM region where the registry hive is stored
55 SAVE_HIVE_RAM_REGION
// IOCTL to write XIP section.
46 HAL_WRITE_XIP
47 HAL_XIPCHAIN
// IOCTL for authenticate device
60 HAL_AUTHENTICATE_DEVICE
// IOCTL for WHQL testing (used to check whether hardware is in a jumpered test mode)
56 WHQL_TEST_MODE
// IOCTL for retrieving location and size of bootloader in flash
57 HAL_GET_BOOTLOADER_PARAMS
// IOCTL for retrieving the signed state of an OS image
58 HAL_GET_IMAGE_SIGNED_STATE
// IOCTL to query for a default display resolution.
63 HAL_QUERY_DISPLAYSETTINGS
// IOCTL to query device for device-specific information
64 HAL_QUERY_DEVICE_SETTINGS
// IOCTL to allow the HAL to override the extension region
65 HAL_GET_BIN_CHAIN
// IOCTL to retrieve cache information
66 HAL_GET_CACHE_INFO
// IOCTL to control OEM-specified profiler
67 HAL_OEM_PROFILER
// IOCTL to allow the networking component interrupts to use one SYSINTR_NETWORK_SHARED
68 HAL_SYSINTR_NETWORK_SHARED
// IOCTL to allow OEM specify MAC address for RNDIS
69 HAL_GET_RNDIS_MACADDR
// IOCTL to allow OEM's to specify if a partition is to be formated before being mounted.
70 HAL_QUERY_FORMAT_PARTITION
// IOCTL used by halflat display driver
71 HAL_DDI
// This IOCTL enables/disables update mode. It's used when updating system images and it sets/clears a flag in
// an OEM-defined location that's interpreted by the initial program loader (IPL) at boot time. Based on the
// flag, the IPL will either boot the OS image or it'll load the update loader which starts the update process.
//
// The IOCTL takes a single boolean input parameter: TRUE == update mode and FALSE == normal OS
//
77 HAL_UPDATE_MODE
// IOCTL used by kernel to query page pool parameters from the OAL
// The IOCTL takes no input parameters but returns an NKPoolParameters struct as output.
82 HAL_GET_POOL_PARAMETERS
////////////////////////////////////////////////////////////////////////////////
// VBridge support in kernel, used by VMini (Null miniport driver).
//
26 VBRIDGE_GET_TX_PACKET
27 VBRIDGE_GET_TX_PACKET_COMPLETE
28 VBRIDGE_GET_RX_PACKET
29 VBRIDGE_GET_RX_PACKET_COMPLETE
30 VBRIDGE_GET_ETHERNET_MAC
31 VBRIDGE_ADD_MAC
32 VBRIDGE_SHARED_ETHERNET
33 VBRIDGE_CURRENT_PACKET_FILTER
34 VBRIDGE_802_3_MULTICAST_LIST
39 VBRIDGE_WILD_CARD
//
// These are only handled in vbridge.lib
//
42 VBRIDGE_WILD_CARD_RESET_BUFFER
43 VBRIDGE_WILD_CARD_VB_INITIALIZED
// Ioctl to retrieve OutputDebugString
48 EDBG_GET_OUTPUT_DEBUG_FN
51 EDBG_IS_STARTED
// IOCTL to retrieve hardware-generated entropy
62 HAL_GET_HWENTROPY
例如呼叫已經被串接好的 RTC_init 就像這樣:
SYSTEMTIME tTIME = { 0 };
KernelIoControl(CTL_CODE(FILE_DEVICE_HAL, 14, METHOD_BUFFERED, FILE_ANY_ACCESS), &tTIME, sizeof(SYSTEMTIME), NULL, 0, NULL);
至於串接到 OEM function 這個是在 WinCE 裡被定義好的, 能不能改我就不確定了..
{WINCE_ROOT}\\PLATFORM\\COMMON\\SRC\\INC\\oal_ioctl_tab.h :
{ IOCTL_HAL_INIT_RTC, 0, OALIoCtlHalInitRTC },
2 則留言:
你把這些常數定義弄出來不會有事吧?
這是已公開的, 沒公開的大概是這篇的十倍多...
張貼留言