Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

926 lines
24 KiB

  1. /*++
  2. INTEL CORPORATION PROPRIETARY INFORMATION
  3. This software is supplied under the terms of a license
  4. agreement or nondisclosure agreement with Intel Corporation
  5. and may not be copied or disclosed except in accordance with
  6. the terms of that agreement.
  7. Copyright (c) 1992-1999 Intel Corporation.
  8. Module Name:
  9. ssc.h
  10. Abstract:
  11. This module is used by the NT device drivers for doing Gambit
  12. Simulation System Calls (SSC). It defines the SSC calls and
  13. the related data structures.
  14. Author:
  15. Ayelet Edrey (aedrey) 1-Jun-1995
  16. Environment:
  17. IA-64 NT running on Gambit
  18. Revision History:
  19. --*/
  20. #ifndef _SSC_H
  21. #define _SSC_H
  22. #if _MSC_VER > 1000
  23. #pragma once
  24. #endif
  25. #ifdef WINNT
  26. # ifdef CDECL
  27. # undef CDECL
  28. # endif
  29. #define CDECL __cdecl
  30. #else
  31. #define CDECL
  32. #endif
  33. #define MAX_SSC_STRING 512
  34. /* NOTE : all pointers are 64 bit addresses to physical memory */
  35. /* Structures and Enums */
  36. typedef unsigned int SSC_HANDLE;
  37. typedef int SSC_BOOL;
  38. typedef void *LARGE_POINTER;
  39. typedef unsigned short GB_U16;
  40. typedef unsigned long GB_U32;
  41. typedef unsigned int U32;
  42. typedef LONGLONG LARGE_RET_VAL;
  43. /* Disk */
  44. #define SSC_ACCESS_READ 0x1 /* for OpenVolume */
  45. #define SSC_ACCESS_WRITE 0x2 /* for OpenVolume */
  46. #define SSC_MAX_VOLUMES 128
  47. #define SSC_MAX_VOLUME_NAME 512
  48. #define SSC_IO_BLOCK_SIZE 512
  49. #define SSC_INVALID_HANDLE SSC_MAX_VOLUMES
  50. /* Disk Request */
  51. typedef struct _SSC_DISK_REQUEST {
  52. LARGE_POINTER DiskBufferAddress;
  53. GB_U32 DiskByteCount;
  54. GB_U32 PaddingWord;
  55. } *PSSC_DISK_REQUEST, SSC_DISK_REQUEST;
  56. /* Disk Completion */
  57. typedef struct _SSC_DISK_COMPLETION {
  58. SSC_HANDLE VolumeHandle;
  59. GB_U32 XferBytes;
  60. } *PSSC_DISK_COMPLETION, SSC_DISK_COMPLETION;
  61. /* interrupt */
  62. typedef enum {
  63. SSC_INTERRUPT_NONE=0,
  64. SSC_DISK_INTERRUPT,
  65. SSC_MOUSE_INTERRUPT,
  66. SSC_KEYBOARD_INTERRUPT,
  67. SSC_CLOCK_TIMER_INTERRUPT,
  68. SSC_PROFILE_TIMER_INTERRUPT,
  69. SSC_APC_INTERRUPT,
  70. SSC_DPC_INTERRUPT,
  71. SSC_SERIAL_INTERRUPT,
  72. SSC_PERFMON_INTERRUPT,
  73. SSC_INTERRUPT_LAST
  74. } SSC_INTERRUPT;
  75. /* timer */
  76. typedef struct _SSC_TIME_FIELDS {
  77. GB_U32 Year;
  78. GB_U32 Month;
  79. GB_U32 Day;
  80. GB_U32 Hour;
  81. GB_U32 Minute;
  82. GB_U32 Second;
  83. GB_U32 Milliseconds;
  84. GB_U32 WeekDay;
  85. } SSC_TIME_FIELDS, *PSSC_TIME_FIELDS;
  86. /* TAL VM */
  87. typedef struct _SSC_TAL_VM_INFO {
  88. LARGE_INTEGER PageSize;
  89. LARGE_INTEGER NumberOfDataTr;
  90. LARGE_INTEGER NumberOfInstructionTr;
  91. LARGE_INTEGER NumberOfDataTc;
  92. LARGE_INTEGER NumberOfInstructionTc;
  93. LARGE_INTEGER UnifiedTlb;
  94. LARGE_INTEGER ProtectionKeySize;
  95. LARGE_INTEGER RegionIdSize;
  96. LARGE_INTEGER HardwareMissHandler;
  97. LARGE_INTEGER NumberOfProtectionId;
  98. LARGE_INTEGER VirtualAddressSize;
  99. LARGE_INTEGER PhysicalAddressSize;
  100. } SSC_TAL_VM_INFO,*PSSC_TAL_VM_INFO;
  101. /* TAL CACHE SUMMARY */
  102. typedef struct _SSC_TAL_CACHE_SUMMARY {
  103. LARGE_INTEGER CacheLevel;
  104. LARGE_INTEGER UniqueCache;
  105. LARGE_INTEGER Snoop;
  106. } SSC_TAL_CACHE_SUMMARY,*PSSC_TAL_CACHE_SUMMARY;
  107. /* TAL CACHE INFO */
  108. typedef struct _SSC_TAL_CACHE {
  109. LARGE_INTEGER LineSize;
  110. LARGE_INTEGER Stride;
  111. LARGE_INTEGER AliasBoundary;
  112. LARGE_INTEGER Hint;
  113. LARGE_INTEGER MemoryAttribute;
  114. LARGE_INTEGER CacheSize;
  115. LARGE_INTEGER LoadPenalty;
  116. LARGE_INTEGER StorePenalty;
  117. LARGE_INTEGER Associativity;
  118. LARGE_INTEGER Unified;
  119. } SSC_TAL_CACHE;
  120. typedef struct _SSC_TAL_CACHE_INFO {
  121. SSC_TAL_CACHE DataLevel0;
  122. SSC_TAL_CACHE DataLevel1;
  123. SSC_TAL_CACHE DataLevel2;
  124. SSC_TAL_CACHE InstLevel0;
  125. SSC_TAL_CACHE InstLevel1;
  126. SSC_TAL_CACHE InstLevel2;
  127. } SSC_TAL_CACHE_INFO, *PSSC_CACHE_INFO;
  128. typedef LARGE_INTEGER SSC_TAL_MEM_ATTRIB;
  129. typedef LARGE_POINTER SSC_TAL_FIXED_ADDR;
  130. /* TAL PROC ID */
  131. typedef struct _SSC_TAL_PROC_ID {
  132. LARGE_INTEGER ArchitectureRevision;
  133. LARGE_INTEGER ProcessorModel;
  134. LARGE_INTEGER ProcessorRevision;
  135. LARGE_INTEGER Gr;
  136. char Vendor[32];
  137. char Name[32];
  138. } SSC_TAL_PROC_ID, *PSSC_TAL_PROC_ID;
  139. /* TAL DEBUG */
  140. typedef struct _SSC_TAL_DEBUG_INFO {
  141. LARGE_INTEGER IRegister;
  142. LARGE_INTEGER DRegister;
  143. } SSC_TAL_DEBUG_INFO, *PSSC_TAL_DEBUG_INFO;
  144. /* Config TAL */
  145. typedef struct _SSC_TAL {
  146. SSC_TAL_VM_INFO VmInfo;
  147. SSC_TAL_CACHE_SUMMARY CacheSummary;
  148. SSC_TAL_CACHE_INFO CacheInfo;
  149. SSC_TAL_MEM_ATTRIB MemoryAttrib;
  150. SSC_TAL_FIXED_ADDR FixedAddress;
  151. SSC_TAL_PROC_ID ProcessorId;
  152. SSC_TAL_DEBUG_INFO DebugInfo;
  153. } SSC_TAL, *PSSC_TAL;
  154. /* Config Mem */
  155. typedef enum {
  156. SSC_MEM_TYPE_RAM = 0,
  157. SSC_MEM_TYPE_ROM,
  158. SSC_MEM_TYPE_IO
  159. } SSC_MEM_TYPE, *PSSC_MEM_TYPE;
  160. typedef struct _SSC_MEM {
  161. LARGE_POINTER StartAddress;
  162. LARGE_INTEGER Size;
  163. SSC_MEM_TYPE Type;
  164. char InitValue;
  165. char PaddingByte1;
  166. char PaddingByte2;
  167. char PaddingByte3;
  168. } SSC_MEM, *PSSC_MEM;
  169. /* VGA size */
  170. typedef enum {
  171. SSC_SCREEN_SIZE_NONE = 0,
  172. SSC_SCREEN_SIZE_800x600,
  173. SSC_SCREEN_SIZE_640x480,
  174. SSC_SCREEN_SIZE_25x80, /* text mode */
  175. SSC_SCREEN_SIZE_LAST
  176. } SSC_SCREEN_SIZE;
  177. /* Keyboard */
  178. #define SSC_KBD_GET_SUCCESS 1
  179. #define SSC_KBD_GET_NODATA 0
  180. #define SSC_KBD_EXTENDED_KEY_VAL 0xE000
  181. #define SSC_KBD_UP_KEY_VAL 0x80
  182. typedef struct _SSC_KBD_LOCK {
  183. U32 KbdNumLock:1 , /* Num lock is ON */
  184. KbdCapsLock:1, /* Caps lock is ON */
  185. KbdScrollLock:1, /* Scroll lock is ON */
  186. KbdFillers:29;
  187. } SSC_KBD_LOCK;
  188. /* Mouse */
  189. typedef U32 SSC_MOUSEBUTTONS;
  190. /* SscMouseGetKeyEvent returns this structure. the prototype of the
  191. function returns int instead, for compilation reasons. */
  192. typedef struct _SSC_MOUSEDATA {
  193. U32 MouseXLocation : 12,
  194. MouseYLocation : 12,
  195. MouseButtonLeft : 1,
  196. MouseButtonRight : 1,
  197. MouseButtonMiddle : 1,
  198. MouseValid :1,
  199. MouseFillers : 4;
  200. } SSC_MOUSEDATA;
  201. /* Kernel debug */
  202. #define SSC_KD_SUCCESS 0
  203. #define SSC_KD_ERROR -1
  204. typedef struct _SSC_DEBUG_PARAMETERS {
  205. U32 CommunicationPort;
  206. U32 BaudRate;
  207. } SSC_DEBUG_PARAMETERS, *PSSC_DEBUG_PARAMETERS;
  208. #define MAX_SSC_MEM 50
  209. #define MAX_SSC_PARAMS 10
  210. /* Network */
  211. #define SSC_SERIAL_SUCCESS 1
  212. #define SSC_SERIAL_FAILED 0
  213. #define SSC_SERIAL_GET_SUCCESS 1 /* data was returned, there may be more data */
  214. #define SSC_SERIAL_GET_NODATA 0
  215. #define SSC_SERIAL_MAX_FIFO_SIZE 512
  216. typedef struct _SSC_INTERRUPT_INFO {
  217. SSC_HANDLE SerialHandle;
  218. GB_U32 CommEvent;
  219. GB_U32 ModemControl;
  220. GB_U32 ErrorFlags;
  221. U32 NumberOfChars;
  222. } *PSSC_INTERRUPT_INFO, SSC_INTERRUPT_INFO;
  223. /* CommEvent decodings */
  224. #define SSC_EV_RXCHAR 0x0001 /* A character was received and placed
  225. in the input buffer */
  226. #define SSC_EV_RXFLAG 0x0002 /* The event character was received and placed
  227. in the input buffer */
  228. #define SSC_EV_TXEMPTY 0x0004 /* The last character in the output buffer
  229. was sent */
  230. #define SSC_EV_CTS 0x0008 /* The CTS (clear-to-send) signal changed state */
  231. #define SSC_EV_DSR 0x0010 /* The DSR (data-set-ready) signal changed */
  232. #define SSC_EV_RLSD 0x0020 /* (receive-line-signal-detect) signal changed */
  233. #define SSC_EV_BREAK 0x0040 /* A break was detected on input */
  234. #define SSC_EV_ERR 0x0080 /* A line-status error occurred */
  235. #define SSC_EV_RING 0x0100 /* A ring indicator was detected */
  236. /* Modem control is one of the following */
  237. #define SSC_MS_CTS_ON 0x0010 /* The CTS (clear-to-send) signal is on. */
  238. #define SSC_MS_DSR_ON 0x0020 /* The DSR (data-set-ready) signal is on.*/
  239. #define SSC_MS_RING_ON 0x0040 /* The ring indicator signal is on. */
  240. #define SSC_MS_RLSD_ON 0x0080 /* The RLSD (receive-line-signal-detect)
  241. signal is on. */
  242. /* Error Codes */
  243. #define SSC_CE_RXOVER 0x0001 /* An input buffer overflow has occurred.
  244. There is either no room in the input buffer,
  245. or a character was received after the
  246. end-of-file (EOF) character. */
  247. #define SSC_CE_OVERRUN 0x0002 /* A character-buffer overrun has occurred.
  248. The next character is lost. */
  249. #define SSC_CE_RXPARITY 0x0004 /* The hardware detected a parity error */
  250. #define SSC_CE_FRAME 0x0008 /* The hardware detected a framing error. */
  251. #define SSC_CE_BREAK 0x0010 /* The hardware detected a break condition. */
  252. #define SSC_CE_TXFULL 0x0100 /* The application tried to transmit a character,
  253. but the output buffer was full. */
  254. #define SSC_CE_IOE 0x0400 /* An I/O error occurred during communications
  255. with the device. */
  256. #define SSC_CE_MODE 0x8000 /* The requested mode is not supported,
  257. or the hFile parameter is invalid. If
  258. this value is specified, it is the
  259. only valid error. */
  260. /* Config */
  261. typedef struct _SSC_CONFIG {
  262. SSC_TAL Tal;
  263. SSC_MEM Memory[MAX_SSC_MEM];
  264. LARGE_INTEGER Params[MAX_SSC_PARAMS];
  265. } SSC_CONFIG, *PSSC_CONFIG;
  266. typedef struct _SSC_IMAGE_INFO {
  267. LARGE_POINTER LoadBase; /* base address for image load */
  268. GB_U32 ImageSize;
  269. GB_U32 ImageType;
  270. LARGE_INTEGER ProcessID;
  271. GB_U32 LoadCount;
  272. } SSC_IMAGE_INFO, *PSSC_IMAGE_INFO;
  273. /* define types in Unix like style */
  274. typedef SSC_CONFIG Ssc_config_t;
  275. typedef SSC_TAL_DEBUG_INFO Ssc_tal_debug_info_t;
  276. typedef SSC_TAL Ssc_tal_t;
  277. typedef SSC_MEM Ssc_mem_t;
  278. typedef SSC_MEM_TYPE Ssc_mem_type_t;
  279. typedef SSC_TAL_PROC_ID Ssc_tal_proc_id_t;
  280. typedef SSC_TAL_MEM_ATTRIB Ssc_tal_mem_attrib_t;
  281. typedef SSC_TAL_FIXED_ADDR Ssc_tal_fixed_addr_t;
  282. typedef SSC_TAL_CACHE Ssc_tal_cache_t;
  283. typedef SSC_TAL_CACHE_SUMMARY Ssc_tal_cache_summary_t;
  284. typedef SSC_TAL_CACHE_INFO Ssc_tal_cache_info_t;
  285. typedef SSC_TAL_VM_INFO Ssc_tal_vm_info_t;
  286. typedef SSC_TIME_FIELDS Ssc_time_fields_t;
  287. typedef SSC_DISK_COMPLETION Ssc_disk_completion_t;
  288. typedef SSC_DISK_REQUEST Ssc_disk_request_t;
  289. typedef SSC_INTERRUPT Ssc_interrupt_t;
  290. typedef SSC_SCREEN_SIZE Ssc_screen_size_t;
  291. typedef SSC_KBD_LOCK Ssc_kbd_lock_t;
  292. typedef SSC_MOUSEBUTTONS Ssc_mousebuttons_t;
  293. typedef SSC_MOUSEDATA Ssc_mousedata_t;
  294. typedef SSC_DEBUG_PARAMETERS Ssc_debug_parameters_t;
  295. typedef SSC_INTERRUPT_INFO Ssc_interrupt_info_t;
  296. typedef SSC_IMAGE_INFO Ssc_image_info_t;
  297. /* performance SSC return values */
  298. #define SSC_SUCCESS 0
  299. #define SSC_VIRTUAL_ADDRESS_NOT_FOUND 1
  300. #define SSC_ILLEGAL_NAME 2
  301. #define SSC_ILLEGAL_HANDLE 3
  302. #define SSC_PERMISSION_DENIED 4
  303. #define SSC_VIRTUAL_ADDRESS_NOT_LOCKED 5
  304. #define GE_SSC_ERR_FIRST 6
  305. #define GE_SSC_ERR_BUFF_TOO_SHORT 6 /* supplied buffer is too short for value */
  306. #define GE_SSC_ERR_INVALID_HNDL 7 /* invalid object handl supplied */
  307. #define GE_SSC_ERR_INVALID_TOOL 8 /* GE internal error */
  308. #define GE_SSC_ERR_INVALID_GE_STAGE 9 /* GE internal error */
  309. #define GE_SSC_ERR_NO_INIT 10 /* GE internal error */
  310. #define GE_SSC_ERR_NOT_OWNER 11 /* object can not be set */
  311. #define GE_SSC_ERR_NOT_ITEM 12 /* operation can be done only on an item object (not a family of objects) */
  312. #define GE_SSC_ERR_OBJ_CLOSED 13 /* object is not available for use due to configuration */
  313. #define GE_SSC_ERR_OBJ_NOT_OPENED 14 /* object is not available for use */
  314. #define GE_SSC_ERR_OBJ_NOT_AVAILABLE 15 /* object not required for use in this session */
  315. #define GE_SSC_ERR_OBJ_NOT_ACTIVE 16 /* object should be active befor used for this operation */
  316. #define GE_SSC_ERR_OBJ_UNDER_TREATMENT 17 /* object is in use at the moment */
  317. #define GE_SSC_ERR_WRONG_CLASS 18 /* specified class is invalid for this operation */
  318. #define GE_SSC_ERR_WRONG_SIZE 19 /* specified wrong size */
  319. #define GE_SSC_ERR_NO_OWNER 20 /* object is not available for use */
  320. #define GE_SSC_ERR_OWNER_FAILURE 21 /* owner failed to handle the operation */
  321. #define GE_SSC_ERR_UNKNOWN 22 /* unrecognized error number detected */
  322. #define GE_SSC_ERR_LAST 22
  323. /* SSC Functions */
  324. /* Disk */
  325. SSC_HANDLE CDECL
  326. SscDiskOpenVolume(
  327. LARGE_POINTER VolumeName,
  328. GB_U32 AccessMode
  329. );
  330. SSC_BOOL CDECL
  331. SscDiskCloseVolume(
  332. SSC_HANDLE VolumeHandle
  333. );
  334. int CDECL
  335. SscDiskReadVolume(
  336. SSC_HANDLE VolumeHandle,
  337. GB_U32 NReq,
  338. LARGE_POINTER RequestPtr,
  339. LARGE_INTEGER VolumeOffset
  340. );
  341. int CDECL
  342. SscDiskWriteVolume(
  343. SSC_HANDLE VolumeHandle,
  344. GB_U32 NReq,
  345. LARGE_POINTER RequestPtr,
  346. LARGE_INTEGER VolumeOffset
  347. );
  348. SSC_BOOL CDECL
  349. SscDiskGetCompletion(
  350. LARGE_POINTER DiskCompletionPtr
  351. );
  352. SSC_BOOL CDECL
  353. SscDiskWaitIoCompletion(
  354. LARGE_POINTER DiskCompletionPtr
  355. );
  356. /* the file SSC_HANDLE in low word, error code in high word */
  357. LARGE_RET_VAL CDECL
  358. SscOpenHostFile (LARGE_POINTER HostPathNameAddress
  359. );
  360. /* the file SSC_HANDLE in low word, error code in high word.
  361. Does not create a new file if a host file does not exist. */
  362. LARGE_RET_VAL CDECL
  363. SscOpenHostFileNoCreate (LARGE_POINTER HostPathNameAddress
  364. );
  365. U32 CDECL
  366. SscWriteHostFile(
  367. SSC_HANDLE SscFileHandle,
  368. LARGE_POINTER TransferBufferAddress,
  369. LARGE_POINTER TransferBufferSizeAddress
  370. );
  371. U32 CDECL
  372. SscReadHostFile(
  373. SSC_HANDLE SscFileHandle,
  374. LARGE_POINTER TransferBufferAddress,
  375. LARGE_POINTER TransferBufferSizeAddress
  376. );
  377. void CDECL
  378. SscCloseHostFile(SSC_HANDLE HostFileHandle
  379. );
  380. /* Kernel debug */
  381. U32 CDECL
  382. SscKdInitialize(
  383. LARGE_POINTER DebugParameters,
  384. SSC_BOOL Initialize
  385. );
  386. U32 CDECL
  387. SscKdPortGetByte(
  388. LARGE_POINTER InputPtr
  389. );
  390. void CDECL
  391. SscKdPortPutByte(
  392. unsigned char Output
  393. );
  394. /* Video */
  395. void CDECL
  396. SscDisplayString(
  397. LARGE_POINTER CharacterString
  398. );
  399. U32 CDECL
  400. SscVideoSetPalette (
  401. U32 iStart,
  402. U32 cEntries,
  403. LARGE_POINTER lppe
  404. );
  405. /* Keyboard */
  406. int CDECL
  407. SscKbdSynchronizeState(
  408. SSC_KBD_LOCK KbdLock
  409. );
  410. GB_U32 CDECL
  411. SscKbdGetKeyCode(
  412. LARGE_POINTER KeyCodeAddress
  413. );
  414. /* Mouse */
  415. SSC_MOUSEBUTTONS CDECL
  416. SscMouseGetButtons();
  417. int CDECL
  418. SscMouseGetKeyEvent();
  419. /* Network */
  420. SSC_HANDLE CDECL
  421. SscSerialOpen(
  422. GB_U32 SerialPortID
  423. );
  424. GB_U32 CDECL
  425. SscSerialGetInterruptInfo(
  426. LARGE_POINTER SerialInterruptInfoPtr,
  427. LARGE_POINTER SerialMessegePtr
  428. );
  429. GB_U32 CDECL
  430. SscSerialWriteChar(
  431. SSC_HANDLE SerialHandle,
  432. LARGE_POINTER SerialCharPtr,
  433. GB_U32 NumChars
  434. );
  435. GB_U32 CDECL
  436. SscSerialClose(
  437. SSC_HANDLE SerialHandle
  438. );
  439. /* Debug */
  440. void CDECL
  441. SscDbgPrintf(
  442. LARGE_POINTER CharacterString
  443. );
  444. /* Interrupt */
  445. void CDECL
  446. SscConnectInterrupt(
  447. SSC_INTERRUPT InterruptSource,
  448. GB_U32 Vector
  449. );
  450. void CDECL
  451. SscGenerateInterrupt(
  452. SSC_INTERRUPT InterruptSource
  453. );
  454. void CDECL
  455. SscSetPeriodicInterruptInterval(
  456. GB_U32 InterruptSource,
  457. GB_U32 IntervalInNanoSeconds
  458. );
  459. /* TAL */
  460. void CDECL
  461. SscTalInitTC();
  462. void CDECL
  463. SscTalHalt();
  464. void CDECL
  465. SscGetConfig(
  466. LARGE_POINTER ConfigInfoPtr
  467. );
  468. /* Video */
  469. void CDECL
  470. SscVideoSetMode(
  471. SSC_SCREEN_SIZE ScreenSize
  472. );
  473. /* Performance */
  474. void CDECL
  475. SscCreateProcess(
  476. U32 ProcessID,
  477. U32 EProcess
  478. );
  479. void CDECL
  480. SscCreateProcess64(
  481. LARGE_INTEGER ProcessID,
  482. LARGE_POINTER EProcess
  483. );
  484. void CDECL
  485. SscCreateThread(
  486. U32 ProcessID,
  487. U32 ThreadID,
  488. U32 EThread
  489. );
  490. void CDECL
  491. SscCreateThread64(
  492. LARGE_INTEGER ProcessID,
  493. LARGE_INTEGER ThreadID,
  494. LARGE_POINTER EThread
  495. );
  496. void CDECL
  497. SscSwitchProcess64(
  498. LARGE_INTEGER NewProcessID,
  499. LARGE_POINTER NewEProcess
  500. );
  501. void CDECL
  502. SscSwitchThread(
  503. U32 NewThreadID,
  504. U32 NewEThread
  505. );
  506. void CDECL
  507. SscSwitchThread64(
  508. LARGE_INTEGER NewThreadID,
  509. LARGE_POINTER NewEThread
  510. );
  511. void CDECL
  512. SscDeleteProcess(
  513. U32 ProcessID
  514. );
  515. void CDECL
  516. SscDeleteProcess64(
  517. LARGE_INTEGER ProcessID
  518. );
  519. void CDECL
  520. SscDeleteThread(
  521. U32 ThreadID
  522. );
  523. void CDECL
  524. SscDeleteThread64(
  525. LARGE_INTEGER ThreadID
  526. );
  527. /* image loading/unloading functions */
  528. void
  529. SscLoadImage(LARGE_POINTER FullPathName,
  530. U32 LoadBase,
  531. U32 ImageSize,
  532. U32 ImageType,
  533. U32 ProcessID,
  534. U32 LoadCount);
  535. void
  536. SscUnloadImage(U32 LoadBase,
  537. U32 ProcessID,
  538. U32 LoadCount);
  539. GB_U32 CDECL
  540. SscLoadImage64(
  541. LARGE_POINTER FullPathNamePhysicalAddress,
  542. LARGE_POINTER ImageInfoPhysicalAddress
  543. );
  544. GB_U32 CDECL
  545. SscUnloadImage64(
  546. LARGE_POINTER FullPathNamePhysicalAddress,
  547. LARGE_POINTER ImageInfoPhysicalAddress
  548. );
  549. /* Performance Counter handoff call */
  550. GB_U32 CDECL
  551. SscPerfCounterAddress(
  552. LARGE_POINTER CounterNamePhysicalAddress,
  553. LARGE_POINTER CounterPhysicalAddress
  554. );
  555. /* Trace Generation Control */
  556. GB_U32 CDECL
  557. SscPerfForm(
  558. U32 SwitchMode,
  559. LARGE_POINTER FormNamePhysicalAddress
  560. );
  561. /* Generating and dispatching a send event.
  562. i.e. an application can put something in the trace pipe */
  563. LARGE_RET_VAL CDECL
  564. SscPerfEventHandle(
  565. LARGE_POINTER EventNamePhysicalAddress
  566. );
  567. LARGE_RET_VAL CDECL
  568. SscPerfHandleApp(
  569. LARGE_POINTER EventNameAddress
  570. );
  571. GB_U32 CDECL
  572. SscPerfFormActivate(
  573. LARGE_POINTER FormName
  574. );
  575. GB_U32 CDECL
  576. SscPerfFormDeActivate(
  577. LARGE_POINTER FormName
  578. );
  579. GB_U32 CDECL
  580. SscPerfSendEvent(
  581. U32 Handle
  582. );
  583. /* Simulated code access to data items in the Gambit Environment */
  584. LARGE_RET_VAL CDECL
  585. SscPerfCounterHandle(
  586. LARGE_POINTER DataItemNamePhysicalAddress
  587. );
  588. GB_U32 CDECL
  589. SscPerfSetCounter32(
  590. U32 Handle,
  591. U32 Value
  592. );
  593. GB_U32 CDECL
  594. SscPerfGetNotifier32(
  595. U32 Handle
  596. );
  597. GB_U32 CDECL
  598. SscPerfSetNotifier32(
  599. U32 Handle,
  600. U32 Value
  601. );
  602. GB_U32 CDECL
  603. SscPerfSetCounter64(
  604. U32 Handle,
  605. LARGE_INTEGER Value
  606. );
  607. GB_U32 CDECL
  608. SscPerfSetCounterStr(
  609. U32 Handle,
  610. LARGE_POINTER StringValuePhysicalAddress
  611. );
  612. LARGE_RET_VAL CDECL
  613. SscPerfGetCounter32(
  614. U32 Handle
  615. );
  616. LARGE_RET_VAL CDECL
  617. SscPerfGetCounter64(
  618. U32 Handle
  619. );
  620. /* Misc. */
  621. void CDECL
  622. SscTraceUserInfo(
  623. GB_U32 Mark
  624. );
  625. void CDECL
  626. SscMakeBeep(
  627. GB_U32 Frequency
  628. );
  629. void CDECL
  630. SscQueryRealTimeClock(
  631. LARGE_POINTER TimeFieldsPtr
  632. );
  633. void CDECL
  634. SscExit(
  635. int ExitCode
  636. );
  637. /* KDI */
  638. #ifdef SSC_KDI
  639. /* GENERAL KDI INTERFACE to CALL any function in kernel */
  640. typedef struct kdi_jmptable {
  641. int KdiMagic; /* Some known magic value */
  642. int KdiVersion; /* Some version value */
  643. LARGE_INTEGER *KdiActive; /* for internal OS use */
  644. LARGE_INTEGER *KeiEnabled; /* kdi can be used now */
  645. LARGE_POINTER *KdiBuffer; /* pointer to buffer area of */
  646. /* size 4096 bytes */
  647. LARGE_POINTER (*KdiCallFunc)(); /* function to call func */
  648. LARGE_POINTER *KdiReserved[3]; /* reserved area */
  649. /* FUNCTIONS EXPORTED VIA KDI */
  650. LARGE_POINTER (*KdiMemoryRead)(); /* function for mem read */
  651. LARGE_POINTER (*KdiMemoryWrite)(); /* function for mem write */
  652. LARGE_POINTER (*KdiCopy)(); /* function for mem read/write */
  653. LARGE_POINTER (*KdiBootInfo)(); /* function to provide call back
  654. info */
  655. LARGE_POINTER (*KdiVirtualToPhysical)(); /* virtual -> physical */
  656. LARGE_POINTER (*KdiPhysicalToVirtual)(); /* physical -> virtual */
  657. LARGE_POINTER (*KdiMapUser)(); /* function to map user */
  658. LARGE_POINTER (*KdiUnmapUser)(); /* function to unmap user */
  659. LARGE_POINTER (*KdiFiller[25])(); /* fillers */
  660. } kdi_jmptable_t;
  661. /* trap to the debugger with value to indicate an internal reason
  662. the value is passed to gb_t.opt.info.kdi */
  663. int CDECL
  664. SscTrap(
  665. int Value
  666. );
  667. typedef enum {
  668. SSC_KDI_STATUS_OK = 0, /* KDI or KDI call is OK */
  669. SSC_KDI_STATUS_DISABLED, /* KDI not available right now */
  670. SSC_KDI_STATUS_BUSY, /* KDI already in use */
  671. SSC_KDI_STATUS_FAILED /* KDI call failed */
  672. } SSC_kdi_status_t;
  673. /* return from a previous call of gambit to the kernel k_callf function
  674. return the return value of the function in ret_val and a status in
  675. status */
  676. int CDECL
  677. SscReturn(
  678. int ReturnValue,
  679. Ssc_kdi_status_t Status
  680. );
  681. #endif SSC_KDI
  682. /* Statistics */
  683. /* Instruction Counter Functions */
  684. U32 CDECL
  685. SscIcountGet(
  686. void
  687. );
  688. /* Instruction Mix Collection */
  689. typedef enum {
  690. SSC_COLLECT_START,
  691. SSC_COLLECT_STOP
  692. } SSC_imix_index_t;
  693. void CDECL
  694. SscInstrMixCollect(
  695. SSC_imix_index_t Index
  696. );
  697. typedef enum {
  698. Enable=0,
  699. Disable=1
  700. } Ssc_event_enable_t;
  701. /* CPROF requests */
  702. typedef enum {
  703. SSC_CPROF_NONE = 0,
  704. SSC_CPROF_ON,
  705. SSC_CPROF_OFF,
  706. SSC_CPROF_RESET,
  707. SSC_CPROF_CLEAR,
  708. SSC_CPROF_PRINT
  709. } SSC_cprof_request;
  710. /* GEMSTONE requests */
  711. typedef enum {
  712. SSC_GEMSTONE_NONE = 0,
  713. SSC_GEMSTONE_START,
  714. SSC_GEMSTONE_ON,
  715. SSC_GEMSTONE_OFF
  716. } SSC_gemstone_request;
  717. /* MP specific */
  718. /* Set OS_RENDEZ address */
  719. void CDECL
  720. SscSetOSRendez(
  721. LARGE_POINTER OsRendezEntryPoint
  722. );
  723. /* MP interrupt association */
  724. void CDECL
  725. SscConnectInterruptEx(
  726. SSC_INTERRUPT InterruptSource,
  727. GB_U32 Vector,
  728. GB_U16 LocalID
  729. );
  730. /* Get number of CPUs in the MP system */
  731. GB_U32 CDECL
  732. SscGetNumberOfCPUs(
  733. void
  734. );
  735. /* Get LIDs of CPUs in the MP system */
  736. void CDECL
  737. SscGetLIDs(
  738. LARGE_POINTER LIDs0,
  739. LARGE_POINTER LIDs1,
  740. LARGE_POINTER LIDs2,
  741. LARGE_POINTER LIDs3
  742. );
  743. void CDECL
  744. SscPlatformAssociateInterrupt(
  745. LARGE_POINTER VirtualAddr,
  746. GB_U32 Device,
  747. GB_U32 Vector);
  748. void CDECL
  749. SscPlatformMemSync(
  750. LARGE_POINTER PhysicalAddress, /* Physical address of the block */
  751. GB_U32 Size, /* size of the block */
  752. GB_U32 Operation); /* 0 = Read, 1 = Write */
  753. void CDECL
  754. SscDevMemSync(
  755. LARGE_POINTER PhysicalPageAddress /* Physical address of the page written by device */
  756. );
  757. #endif /* _SSC_H */