3
(******************************************************************************
5
* Copyright (c) 1994-2000 Palm, Inc. or its subsidiaries.
10
* Release: Palm OS SDK 4.0 (63220)
13
* Pilot system equates
16
* 10/27/94 RM Created by Ron Marianetti
17
* 10/07/96 SCL Added sysAppLaunchFlagDataRelocated flag
18
* 11/13/96 vmk Added sysErrDelayWakened error code
19
* 08/12/98 dia Added sysFtrNumGremlinsSupportGlobals.
20
* 08/18/98 SCL Added sysFtrNumHwrMiscFlags and ...FlagsExt.
21
* Redefined sysFtrNumProcessorID.
22
* 08/23/98 SCL Merged in tsmErrorClass.
23
* 09/07/98 kwk Added SysWantEvent routine declaration.
24
* 10/05/98 jfs Added SysLCDContrast trap descriptor
25
* 04/08/99 kwk Added sysFtrNumVendor (OS 3.3 and later)
26
* 06/28/99 kwk Added omErrorClass.
27
* 08/11/99 kwk Added sysFtrNumCharEncodingFlags.
28
* 11/01/99 kwk Moved SysWantEvent to SystemPrv.h
29
* 12/03/99 SCL Moved SysAppInfoType, SysAppStartup, and SysAppExit
30
* here from SystemPrv.h (for StartupCode/Runtime)
31
* 07/19/00 gap Added launch code sysAppLaunchCmdAttention for use by
33
* 7/26/00 jhl Integrate HSIMgr functionality
34
* 09/22/00 BGT Integrated sysAppLaunchNppiNoUI and sysAppLaunchNppiUI
36
*****************************************************************************)
42
uses palmos, coretraps, libtraps, errorbase, bitmap, datamgr, systemresources, event_;
44
(************************************************************
46
*************************************************************)
48
// Define the number of ticks/second
49
// NOTE: It is strongly recommended that developers avoid using these
50
// defines, and use the SysTicksPerSecond() API (below) instead....
51
//#if EMULATION_LEVEL == EMULATION_MAC
52
// #define sysTicksPerSecond 60 // 60/sec on Macintosh
53
//#elif EMULATION_LEVEL == EMULATION_NONE
55
sysTicksPerSecond_ = 100; // 100/sec on Pilot
56
//#elif EMULATION_LEVEL == EMULATION_WINDOWS
57
// #define sysTicksPerSecond 1000 // 1000/sec on Windows PC
58
//#elif EMULATION_LEVEL == EMULATION_UNIX
59
// #define sysTicksPerSecond 1000
60
// // 1000/sec on Linux
62
// #error Invalid EMULATION_LEVEL
65
(************************************************************
66
* Rules for creating and using the Command Parameter Block
67
* passed to SysUIAppSwitch
68
*************************************************************)
70
// A parameter block containing application-specific information may be passed
71
// to an application when launching it via SysUIAppSwitch. To create the
72
// parameter block, you allocate a memory block using MemPtrNew and then you must
73
// call MemPtrSetOwner to set the block's owner ID to 0. This assigns the block's
74
// ownership to the system so that it will not be automatically freed by the system
75
// when the calling app exits. The command block must be self contained. It must not
76
// have pointers to anything on the stack or in memory blocks owned by an application.
77
// The launching and launched applications do not need to worry about freeing the
78
// command block since the system will do this after the launched application exits.
79
// If no parameter block is being passed, this parameter must be NULL.
81
(************************************************************
84
* IMPORTANT ACTION CODE CONSIDERATIONS:
86
* Many action codes are "sent" to apps via a direct function call into the app's
87
* PilotMain() function without launching the app. For these action codes, the
88
* application's global and static variables are *not* available, unless the
89
* application is already running. Some action codes are synchronized with the
90
* currently running UI applcation via the event manager (alarm action codes,
91
* for example), while others, such as HotSync action codes, are sent from a
92
* background thread. To find out if your app is running (is the current UI
93
* app) when an action code is received, test the sysAppLaunchFlagSubCall flag
94
* (defined in SystemMgr.h) which is passed to your PilotMain in the
95
* launchFlags parameter (the third PilotMain parameter). If it is non-zero,
96
* you may assume that your app is currently running and the global variables
97
* are accessible. This information is useful if your app maintains an open
98
* data database (or another similar resource) when it is running. If the app
99
* receives an action code and the sysAppLaunchFlagSubCall is set in
100
* launchFlags, the handler may access global variables and use the open
101
* database handle while handling the call. On the other hand, if the
102
* sysAppLaunchFlagSubCall flag is not set (ie., zero), the handler will need
103
* to open and close the database itself and is not allowed to access global
104
* or static variables.
106
*************************************************************)
108
// NOTE: for defining custom action codes, see sysAppLaunchCmdCustomBase below.
110
// System SysAppLaunch Commands
112
sysAppLaunchCmdNormalLaunch = 0; // Normal Launch
114
sysAppLaunchCmdFind = 1; // Find string
116
sysAppLaunchCmdGoTo = 2; // Launch and go to a particular record
118
sysAppLaunchCmdSyncNotify = 3; // Sent to apps whose databases changed during
119
// HotSync after the sync has been completed,
120
// including when the app itself has been installed
121
// by HotSync. The data database(s) must have the
122
// same creator ID as the application for this
123
// mechanism to function correctly. This is a
124
// good opportunity to update/initialize/validate
125
// the app's data, such as resorting records,
126
// setting alarms, etc.
128
// Parameter block: None.
129
// Restrictions: No accessing of global or
130
// static variables; no User Interface calls.
131
// Notes: This action code is sent via a
132
// direct function call into the app's
133
// PilotMain function from the background
134
// thread of the HotSync application.
136
sysAppLaunchCmdTimeChange = 4; // Sent to all applications and preference
137
// panels when the system time is changed.
138
// This notification is the right place to
139
// update alarms and other time-related
140
// activities and resources.
142
// Parameter block: None.
143
// Restrictions: No accessing of global or
144
// static variables; no User Interface calls.
145
// Notes: This action code is sent via a direct
146
// function call into the app's PilotMain
147
// function without "launching" the app.
149
sysAppLaunchCmdSystemReset = 5; // Sent to all applications and preference
150
// panels when the system is either soft-reset
151
// or hard-reset. This notification is the
152
// right place to initialize and/or validate
153
// your application's preferences/features/
154
// database(s) as well as to update alarms and
155
// other time-related activities and resources.
157
// Parameter block: SysAppLaunchCmdSystemResetType
158
// Restrictions: No accessing of global or
159
// static variables; no User Interface calls.
160
// Notes: This action code is sent via a direct
161
// function call into the app's PilotMain
162
// function without "launching" the app.
164
sysAppLaunchCmdAlarmTriggered = 6; // Sent to an application at the time its
165
// alarm time expires (even when another app
166
// is already displaying its alarm dialog box).
167
// This call is intended to allow the app to
168
// perform some very quick activity, such as
169
// scheduling the next alarm or performing a
170
// quick maintenance task. The handler for
171
// sysAppLaunchCmdAlarmTriggered must take as
172
// little time as possible and is *not* allowed
173
// to block (this would delay notification for
174
// alarms set by other applications).
176
// Parameter block: SysAlarmTriggeredParamType
177
// (defined in AlarmMgr.h)
178
// Restrictions: No accessing of global or
179
// static variables unless sysAppLaunchFlagSubCall
180
// flag is set, as discussed above.
181
// Notes: This action code is sent via a direct
182
// function call into the app's PilotMain
183
// function without "launching" the app.
185
sysAppLaunchCmdDisplayAlarm = 7; // Sent to an application when it is time
186
// to display the alarm UI. The application
187
// is responsible for making any alarm sounds
188
// and for displaying the alarm UI.
189
// sysAppLaunchCmdDisplayAlarm calls are ordered
190
// chronoligically and are not overlapped.
191
// This means that your app will receive
192
// sysAppLaunchCmdDisplayAlarm only after
193
// all earlier alarms have been displayed.
195
// Parameter block: SysDisplayAlarmParamType
196
// (defined in AlarmMgr.h)
197
// Restrictions: No accessing of global or
198
// static variables unless sysAppLaunchFlagSubCall
199
// flag is set, as discussed above. UI calls are
200
// allowed to display the app's alarm dialog.
201
// Notes: This action code is sent via a direct
202
// function call into the app's PilotMain
203
// function without "launching" the app.
205
sysAppLaunchCmdCountryChange = 8; // The country has changed
207
sysAppLaunchCmdSyncRequestLocal = 9; // Sent to the HotSync application to request a
208
// local HotSync. ("HotSync" button was pressed.)
210
sysAppLaunchCmdSyncRequest = sysAppLaunchCmdSyncRequestLocal; // for backward compatibility
212
sysAppLaunchCmdSaveData = 10; // Sent to running app before sysAppLaunchCmdFind
213
// or other action codes that will cause data
214
// searches or manipulation.
216
sysAppLaunchCmdInitDatabase = 11; // Sent to an application when a database with
217
// a matching Creator ID is created during
218
// HotSync (in response to a "create db"
219
// request). This allows the application to
220
// initialize a newly-created database during
221
// HotSync. This might include creating some
222
// default records, setting up the database's
223
// application and sort info blocks, etc.
225
// Parameter block: SysAppLaunchCmdInitDatabaseType
226
// Restrictions: No accessing of global or
227
// static variables; no User Interface calls.
228
// Notes: This action code is sent via a
229
// direct function call into the app's
230
// PilotMain function from the background
231
// thread of the HotSync application.
233
sysAppLaunchCmdSyncCallApplicationV10 = 12; // Used by DesktopLink Server command "call application";
234
// Pilot v1.0 only!!!
236
//------------------------------------------------------------------------
237
// New launch codes defined for PalmOS 2.0
238
//------------------------------------------------------------------------
240
sysAppLaunchCmdPanelCalledFromApp = 13; // The panel should display a done
241
// button instead of the pick list.
242
// The Done button will return the user
245
sysAppLaunchCmdReturnFromPanel = 14; // A panel returned to this app
247
sysAppLaunchCmdLookup = 15; // Lookup info managed by an app
249
sysAppLaunchCmdSystemLock = 16; // Lock the system until a password is entered.
251
sysAppLaunchCmdSyncRequestRemote = 17; // Sent to the HotSync application to request
252
// a remote HotSync. ("Remote HotSync" button
255
sysAppLaunchCmdHandleSyncCallApp = 18; // Pilot v2.0 and greater. Sent by DesktopLink Server to an application to handle
256
// the "call application" command; use DlkControl with
257
// control code dlkCtlSendCallAppReply to send the reply(see DLServer.h).
258
// This action code replaces the v1.0 code sysAppLaunchCmdSyncCallApplication.
261
sysAppLaunchCmdAddRecord = 19; // Add a record to an applications's database.
263
//------------------------------------------------------------------------
264
// Standard Service Panel launch codes (used by network panel, dialer panel, etc.)
265
//------------------------------------------------------------------------
267
sysSvcLaunchCmdSetServiceID = 20;
268
sysSvcLaunchCmdGetServiceID = 21;
269
sysSvcLaunchCmdGetServiceList = 22;
270
sysSvcLaunchCmdGetServiceInfo = 23;
272
sysAppLaunchCmdFailedAppNotify = 24; // An app just switched to failed.
273
sysAppLaunchCmdEventHook = 25; // Application event hook callback
274
sysAppLaunchCmdExgReceiveData = 26; // Exg command for app to receive data.
275
sysAppLaunchCmdExgAskUser = 27; // Exg command sent before asking user.
277
//------------------------------------------------------------------------
278
// Standard Dialer Service launch codes (30 - 39 reserved)
279
//------------------------------------------------------------------------
281
// sysDialLaunchCmdDial: dials the modem(optionally displays dial progress UI), given service id
282
// and serial library reference number
283
sysDialLaunchCmdDial = 30;
284
// sysDialLaunchCmdHangUp: hangs up the modem(optionally displays disconnect progress UI), given service id
285
// and serial library reference number
286
sysDialLaunchCmdHangUp = 31;
287
sysDialLaunchCmdLast = 39;
289
//------------------------------------------------------------------------
290
// Additional standard Service Panel launch codes (used by network panel, dialer panel, etc)
292
//------------------------------------------------------------------------
294
sysSvcLaunchCmdGetQuickEditLabel = 40; // SvcQuickEditLabelInfoType
295
sysSvcLaunchCmdLast = 49;
297
//------------------------------------------------------------------------
298
// New launch codes defined for PalmOS 3.x where x >= 1
299
//------------------------------------------------------------------------
301
sysAppLaunchCmdURLParams = 50; // Sent from the Web Clipper application.
302
// This launch code gets used to satisfy
303
// URLs like the following:
304
// palm:memo.appl?param1=value1¶m2=value2
305
// Everything in the URL past the '?' is passed
306
// to the app as the cmdPBP parameter of PilotMain().
308
sysAppLaunchCmdNotify = 51; // This is a NotifyMgr notification sent
309
// via SysNotifyBroadcast. The cmdPBP parameter
310
// points to a SysNotifyParamType structure
311
// containing more specific information
312
// about the notification (e.g., what it's for).
314
sysAppLaunchCmdOpenDB = 52; // Sent to switch to an application and have it
315
// "open" up the given data file. The cmdPBP
316
// pointer is a pointer to a SysAppLaunchCmdOpenDBType
317
// structure that has the cardNo and localID of the database
318
// to open. This action code is used by the Launcher
319
// to launch data files, like Eleven PQA files that
320
// have the dmHdrAttrLaunchableData bit set in their
321
// database attributes.
323
sysAppLaunchCmdAntennaUp = 53; // Sent to switch only to the launcher when
324
// the antenna is raised and the launcher
325
// is the application in the buttons preferences
326
// that is to be run when the antenna is raised is
329
sysAppLaunchCmdGoToURL = 54; // Sent to Clipper to have it launch and display
330
// a given URL. cmdPBP points to the URL string.
332
// Begin Change - BGT 03/21/2000
334
//------------------------------------------------------------------------
335
// New launch codes defined for Network panel plug-in
336
//------------------------------------------------------------------------
338
sysAppLaunchNppiNoUI = 55; // Sent to network panel plug-in ("nppi") to have it launch
339
// without UI and load to netlib
341
sysAppLaunchNppiUI = 56; // Sent to network panel plug-in ("nppi") to have it launch
343
// End Change - BGT 03/21/2000
345
//------------------------------------------------------------------------
346
// New launch codes defined for PalmOS 4.x where x >= 0
347
//------------------------------------------------------------------------
349
sysAppLaunchCmdExgPreview = 57; // Sent to an application by the Exchange Manager when the
350
// application needs to produce a preview.
353
sysAppLaunchCmdCardLaunch = 58; // Sent to an application by the Launcher when the
354
// application is being run from a card.
356
sysAppLaunchCmdExgGetData = 59; // Exg command for app to send data requested by an ExgGet
358
sysAppLaunchCmdAttention = 60; // sent to an application by the attention manager
359
// when the application needs to take action on an entry
360
// that has been submitted to the attention manager queue.
362
sysAppLaunchPnpsPreLaunch = 61; // pre-launch code for Pnps devices,
363
// cmdPBP points to SysAppLaunchCmdPnpsType
365
// ***ADD NEW SYSTEM ACTION CODES BEFORE THIS COMMENT***
367
//------------------------------------------------------------------------
368
// Custom action code base (custom action codes begin at this value)
369
//------------------------------------------------------------------------
371
sysAppLaunchCmdCustomBase = $8000;
373
// Your custom launch codes can be defined like this:
376
// MyAppCustomActionCodes = WordEnum;
378
// myAppCmdDoSomething = sysAppLaunchCmdCustomBase;
379
// myAppCmdDoSomethingElse = Succ(myAppCmdDoSomething);
380
// myAppCmdEtcetera = Succ(myAppCmdDoSomethingElse);
382
//------------------------------------------------------------------------
383
// SysAppLaunch flags (passed to PilotMain)
384
//------------------------------------------------------------------------
386
sysAppLaunchFlagNewThread = $01; // create a new thread for application
387
// - implies sysAppLaunchFlagNewStack
388
sysAppLaunchFlagNewStack = $02; // create separate stack for application
389
sysAppLaunchFlagNewGlobals = $04; // create new globals world for application
390
// - implies new owner ID for Memory chunks
391
sysAppLaunchFlagUIApp = $08; // notifies launch routine that this is a UI app being
393
sysAppLaunchFlagSubCall = $10; // notifies launch routine that the app is calling it's
394
// entry point as a subroutine call. This tells the launch
395
// code that it's OK to keep the A5 (globals) pointer valid
397
// IMPORTANT: This flag is for internal use by
398
// SysAppLaunch only!!! It should NEVER be set
400
sysAppLaunchFlagDataRelocated = $80; // global data (static ptrs) have been "relocated"
401
// by either SysAppStartup or StartupCode.c
402
// IMPORTANT: This flag is for internal use by
403
// SysAppLaunch only!!! It should NEVER be set
406
// The set of private, internal flags that should never be set by the caller
407
sysAppLaunchFlagPrivateSet = sysAppLaunchFlagSubCall or sysAppLaunchFlagDataRelocated;
409
//-------------------------------------------------------------------
410
// Parameter blocks for action codes
411
// NOTE: The parameter block for the sysAppLaunchCmdFind and sysAppLaunchCmdGoTo
412
// action codes are defined in "Find.h";
413
//---------------------------------------------------------------------------
415
// For sysAppLaunchCmdSaveData
417
SysAppLaunchCmdSaveDataType = record
418
uiComing: Boolean; // true if system dialog will be put up
419
// before coming action code arrives.
423
// For sysAppLaunchCmdSystemReset
424
SysAppLaunchCmdSystemResetType = record
425
hardReset: Boolean; // true if system was hardReset, false if soft-reset.
426
createDefaultDB: Boolean; // true if app should create default database.
429
// For sysAppLaunchCmdInitDatabase
430
SysAppLaunchCmdInitDatabaseType = record
431
dbP: DmOpenRef; // Handle of the newly-created database,
432
// already open for read/write access.
433
// IMPORTANT: The handler *MUST* leave
434
// this database handle open on return.
435
creator: UInt32; // Creator ID of the newly-created database
436
type_: UInt32; // Type ID of the newly-created database
437
version: UInt16; // Version number of the newly-created database
440
// For sysAppLaunchCmdSyncCallApplicationV10
441
// This structure used on Pilot v1.0 only. See sysAppLaunchCmdHandleSyncCallApp
442
// for later platforms.
443
SysAppLaunchCmdSyncCallApplicationTypeV10 = record
444
action: UInt16; // call action id (app-specific)
445
paramSize: UInt16; // parameter size
446
paramP: Pointer; // ptr to parameter
447
remoteSocket: UInt8; // remote socket id
448
tid: UInt8; // command transaction id
449
handled: Boolean; // if handled, MUST be set true by the app
453
// For sysAppLaunchCmdHandleSyncCallApp (Pilot v2.0 and greater).
454
// This structure replaces SysAppLaunchCmdSyncCallApplicationType
455
// which was used in Pilot v1.0
456
SysAppLaunchCmdHandleSyncCallAppType = record
457
pbSize: UInt16; // this parameter block size (set to sizeof SysAppLaunchCmdHandleSyncCallAppType)
458
action: UInt16; // call action id (app-specific)
459
paramP: Pointer; // ptr to parameter
460
dwParamSize: UInt32; // parameter size
461
dlRefP: Pointer; // DesktopLink reference pointer for passing
462
// to DlkControl()'s dlkCtlSendCallAppReply code
464
handled: Boolean; // initialized to FALSE by DLServer; if
465
// handled, MUST be set TRUE by the app(the
466
// handler MUST call DlkControl with
467
// control code dlkCtlSendCallAppReply);
468
// if the handler is not going to send a reply,
469
// it should leave this field set to FALSE, in which
470
// case DesktopLink Server will send the default
471
// "unknown request" reply.
475
replyErr: Err; // error from dlkCtlSendCallAppReply
477
// RESERVED FOR FUTURE EXTENSIONS
478
dwReserved1: UInt32; // RESERVED -- set to null!!!
479
dwReserved2: UInt32; // RESERVED -- set to null!!!
481
// Target executable creator and type for testing the mechanism
482
// in EMULATION MODE ONLY!!!
483
// #if EMULATION_LEVEL != EMULATION_NONE
489
// For sysAppLaunchCmdFailedAppNotify
490
SysAppLaunchCmdFailedAppNotifyType = record
496
// For sysAppLaunchCmdOpenDB
497
SysAppLaunchCmdOpenDBType = record
502
// For sysAppLaunchCmdCardLaunch
504
SysAppLaunchCmdCardType = record
508
startFlags: UInt16; // See vfsStartFlagXXX constants below
512
sysAppLaunchStartFlagAutoStart = $0001; // this bit in the 'startFlags' field is set for an app which is run automatically on card insertion
513
sysAppLaunchStartFlagNoUISwitch = $0002; // set this bit in the 'startFlags' field to prevent a UI switch to the start.prc app
514
sysAppLaunchStartFlagNoAutoDelete = $0004; // set this bit in the 'startFlags' field to prevent VFSMgr from deleting start.prc app on volume unmount
516
//for launch code sysAppLaunchPnpsPreLaunch
518
SysAppLaunchCmdPnpsType = record
519
error: Err; // an error code from the pre-launch application, set to errNone to prevent normal launching
520
volRefNum: UInt16; // Non-zero if an optional file system was mounted
521
slotLibRefNum: UInt16; // always valid for a slot driver call
522
slotRefNum: UInt16; // always valid for a slot driver call
525
(************************************************************
526
* Structure of Application info for an application. Applications
527
* do not necessarily have to be on their own thread - there
528
* can be more than 1 app on the same AMX task. Each application
529
* has an assocated SysAppInfoType structure which holds the
530
* application specific information like the database MemHandle of the
531
* app, the code MemHandle, the stack chunk pointer, the owner ID, etc.
533
* As of PalmOS 3.X, one of these structures is created for each
534
* app running as an action code.
537
****IMPORTANT: ADD NEW FIELDS AT THE END OF THE STRUCTURE FOR
538
**** BACKWARD COMPATIBILITY
540
*************************************************************)
542
SysAppInfoTag = record
543
cmd: Int16; // command code for app
544
cmdPBP: MemPtr; // cmd ParamBlock
545
launchFlags: UInt16; // launch flags
547
taskID: UInt32; // AMX task ID of task that app runs in
548
codeH: MemHandle; // code MemHandle of the main code segment
549
dbP: DmOpenRef; // Application database access MemPtr of App
550
stackP: ^UInt8; // stack chunk for the App
551
globalsChunkP: ^UInt8; // globals chunk for the App
553
memOwnerID: UInt16; // owner ID for Memory Manager chunks
554
dmAccessP: MemPtr; // pointer to linked list of opened DB's
555
dmLastErr: Err; // Last error from Data Manager
556
errExceptionP: MemPtr; // ErrTry,Catch exception list
558
// PalmOS v3.0 fields begin here
559
a5Ptr: ^UInt8; // A5 MemPtr for this app
560
stackEndP: ^UInt8; // stack chunk end for the App (last byte)
561
globalEndP: ^UInt8; // global chunk end for the App (last byte)
562
rootP: ^SysAppInfoType;// Points to the SysAppInfoType first
563
// allocated for this thread.
564
extraP: MemPtr; // unused MemPtr for the App.
566
SysAppInfoType = SysAppInfoTag;
567
SysAppInfoPtr = ^SysAppInfoType;
569
(************************************************************
570
* Function prototype for libraries
571
*************************************************************)
577
// The assembly level TrapDispatcher() function uses a hard-coded value for
578
// the size of the structure SysLibTblEntryType to obtain a pointer to a
579
// library entry in the library table. Therefore, any changes to this structure,
580
// require corresponding changes in TrapDispatcher() in ROMBoot.c. Furthermore,
581
// it is advantageous to keep the size of the structure a power of 2 as this
582
// improves performance by allowing the entry offset to be calculated by shifting
583
// left instead of using the multiply instruction. vmk 8/27/96 (yes, I fell into
585
SysLibTblEntryType = record
586
dispatchTblP: ^MemPtr; // pointer to library dispatch table
587
globalsP: Pointer; // Library globals
589
// New INTERNAL fields for v2.0 (vmk 8/27/96):
590
dbID: LocalID; // database id of the library
591
codeRscH: Pointer; // library code resource handle for RAM-based libraries
593
SysLibTblEntryPtr = ^SysLibTblEntryType;
595
// Emulated versions of libraries have a slightly different dispatch table
596
// Enough for the offset to the library name and the name itself.
597
//#if EMULATION_LEVEL != EMULATION_NONE
598
SimDispatchTableType = record
599
numEntries: UInt32 ; // number of library entries
600
entries: array [0..0] of Pointer; // dispatch routine entries
601
// followed by pointer to name
603
SimDispatchTablePtr = ^SimDispatchTableType;
606
// Library entry point procedure
607
SysLibEntryProcPtr = function(refNum: UInt16; entryP: SysLibTblEntryPtr): Err;
609
// This library refNum is reserved for the Debugger comm library
611
sysDbgCommLibraryRefNum = 0;
613
// This portID is reserved for identifying the debugger's port
614
sysDbgCommPortID = $C0FF;
616
// This refNum signals an invalid refNum
617
sysInvalidRefNum = $FFFF;
619
(************************************************************
620
* Function prototype for Kernel
621
*************************************************************)
623
// Task termination procedure prototype for use with SysTaskSetTermProc
625
SysTermProcPtr = procedure(taskID: UInt32; reason: Int32);
627
// Timer procedure for use with SysTimerCreate
628
SysTimerProcPtr = procedure(timerID, param: Int32);
630
(************************************************************
631
* Structure of the pref=0 resource in applications. Note, this
632
* structure must mirror the structure of the sysResTAppPrefs
633
* resource as defined in SystemResources.h.
634
*************************************************************)
638
priority: UInt16; // task priority
639
stackSize: UInt32; // required stack space
640
minHeapSpace: UInt32; // minimum heap space required
642
SysAppPrefsType = SysAppPrefs;
643
SysAppPrefsPtr = ^SysAppPrefsType;
645
(************************************************************
646
* Structure of the xprf=0 resource in resource DBs. Note, this
647
* structure must mirror the structure of the sysResTExtPrefs
648
* resource as defined in SystemResources.h. Also, fields can only
649
* be added (at the end), never removed or changed.
650
*************************************************************)
655
// Flags defined for SysExtPrefsType.flags
657
sysExtPrefsNoOverlayFlag = $00000001;
660
SysExtPrefsType = record
661
version: UInt16; // version of structure.
662
flags: UInt32; // 32 boolean flags.
665
(************************************************************
667
*************************************************************)
670
sysErrTimeout = sysErrorClass or 1;
671
sysErrParamErr = sysErrorClass or 2;
672
sysErrNoFreeResource = sysErrorClass or 3;
673
sysErrNoFreeRAM = sysErrorClass or 4;
674
sysErrNotAllowed = sysErrorClass or 5;
675
sysErrSemInUse = sysErrorClass or 6;
676
sysErrInvalidID = sysErrorClass or 7;
677
sysErrOutOfOwnerIDs = sysErrorClass or 8;
678
sysErrNoFreeLibSlots = sysErrorClass or 9;
679
sysErrLibNotFound = sysErrorClass or 10;
680
sysErrDelayWakened = sysErrorClass or 11; // SysTaskDelay wakened by SysTaskWake before delay completed.
681
sysErrRomIncompatible = sysErrorClass or 12;
682
sysErrBufTooSmall = sysErrorClass or 13;
683
sysErrPrefNotFound = sysErrorClass or 14;
685
// NotifyMgr error codes:
686
sysNotifyErrEntryNotFound = sysErrorClass or 16; // could not find registration entry in the list
687
sysNotifyErrDuplicateEntry = sysErrorClass or 17; // identical entry already exists
688
sysNotifyErrBroadcastBusy = sysErrorClass or 19; // a broadcast is already in progress - try again later.
689
sysNotifyErrBroadcastCancelled = sysErrorClass or 20; // a handler cancelled the broadcast
691
// AMX error codes continued - jb 10/20/98
692
sysErrMbId = sysErrorClass or 21;
693
sysErrMbNone = sysErrorClass or 22;
694
sysErrMbBusy = sysErrorClass or 23;
695
sysErrMbFull = sysErrorClass or 24;
696
sysErrMbDepth = sysErrorClass or 25;
697
sysErrMbEnv = sysErrorClass or 26;
699
// NotifyMgr Phase #2 Error Codes:
700
sysNotifyErrQueueFull = sysErrorClass or 27; // deferred queue is full.
701
sysNotifyErrQueueEmpty = sysErrorClass or 28; // deferred queue is empty.
702
sysNotifyErrNoStackSpace = sysErrorClass or 29; // not enough stack space for a broadcast
703
sysErrNotInitialized = sysErrorClass or 30; // manager is not initialized
705
// AMX error/warning codes continued - jed 9/10/99
706
sysErrNotAsleep = sysErrorClass or 31; // Task woken by SysTaskWake was not asleep, 1 wake pending
707
sysErrNotAsleepN = sysErrorClass or 32; // Task woken by SysTaskWake was not asleep, >1 wake pending
709
// Power Manager error codes - soe, srj 9/19/00
710
pwrErrNone = pwrErrorClass or 0;
711
pwrErrBacklight = pwrErrorClass or 1;
712
pwrErrRadio = pwrErrorClass or 2;
713
pwrErrBeam = pwrErrorClass or 3;
714
pwrErrGeneric = pwrErrorClass or 4;
716
(************************************************************
718
*************************************************************)
720
sysFtrCreator = sysFileCSystem; // Feature Creator
722
sysFtrNumROMVersion = 1; // ROM Version
723
// 0xMMmfsbbb, where MM is major version, m is minor version
724
// f is bug fix, s is stage: 3-release,2-beta,1-alpha,0-development,
725
// bbb is build number for non-releases
726
// V1.12b3 would be: 0x01122003
727
// V2.00a2 would be: 0x02001002
728
// V1.01 would be: 0x01013000
730
sysFtrNumProcessorID = 2; // Product id
731
// 0xMMMMRRRR, where MMMM is the processor model and RRRR is the revision.
732
sysFtrNumProcessorMask = $FFFF0000; // Mask to obtain processor model
733
sysFtrNumProcessor328 = $00010000; // Motorola 68328 (Dragonball)
734
sysFtrNumProcessorEZ = $00020000; // Motorola 68EZ328 (Dragonball EZ)
735
sysFtrNumProcessorVZ = $00030000; // Motorola 68VZ328 (Dragonball VZ)
736
sysFtrNumProductID = sysFtrNumProcessorID; // old (obsolete) define
738
sysFtrNumBacklight = 3; // Backlight
739
// bit 0: 1 if present. 0 if Feature does not exist or backlight is not present
741
sysFtrNumEncryption = 4; // Which encryption schemes are present
742
sysFtrNumEncryptionMaskDES = $00000001; // bit 0: 1 if DES is present
744
sysFtrNumCountry = 5; // International ROM identifier
745
// Result is of type CountryType as defined in Preferences.h.
746
// Result is essentially the "default" country for this ROM.
747
// Assume cUnitedStates if sysFtrNumROMVersion >= 02000000
748
// and feature does not exist. Result is in low sixteen bits.
750
sysFtrNumLanguage = 6; // Language identifier
751
// Result is of untyped; values are defined in Incs:BuildRules.h
752
// Result is essentially the "default" language for this ROM.
753
// This is new for the WorkPad (v2.0.2) and did NOT exist for any of the
754
// following: GermanPersonal, GermanPro, FrenchPersonal, FrenchPro
755
// Thus we can't really assume anything if the feature doesn't exist,
756
// though the actual language MAY be determined from sysFtrNumCountry,
757
// above. Result is in low sixteen bits.
759
sysFtrNumDisplayDepth = 7; // Display depth
760
// Result is the "default" display depth for the screen. (PalmOS 3.0)
761
// This value is used by ScrDisplayMode when setting the default display depth.
763
sysFtrNumHwrMiscFlags = 8; // GHwrMiscFlags value (PalmOS 3.1)
764
sysFtrNumHwrMiscFlagsExt = 9; // GHwrMiscFlagsExt value (PalmOS 3.1)
766
sysFtrNumIntlMgr = 10;
767
// Result is a set of flags that define functionality supported
768
// by the Int'l Manager. (PalmOS 3.1)
770
sysFtrNumEncoding = 11;
771
// Result is the character encoding (defined in PalmLocale.h) supported
772
// by this ROM. If this feature doesn't exist then the assumed encoding
773
// is Palmlatin (superset of Windows code page 1252). (PalmOS 3.1)
775
sysFtrDefaultFont = 12;
776
// Default font ID used for displaying text. (PalmOS 3.1)
778
sysFtrDefaultBoldFont = 13;
779
// Default font ID used for displaying bold text. (PalmOS 3.1)
781
sysFtrNumGremlinsSupportGlobals = 14; // Globals for supporting gremlins.
782
// This value is a pointer to a memory location that stores global variables needed
783
// for intelligently supporting gremlins. Currently, it is only used in Progress.c.
784
// It is only initialized on first use (gremlins and progress bar in combination)
785
// when ERROR_CHECK_LEVEL == ERROR_CHECK_FULL. (PalmOS 3.2)
787
sysFtrNumVendor = 15;
788
// Result is the vendor id, in the low sixteen bits. (PalmOS 3.3)
790
sysFtrNumCharEncodingFlags = 16;
791
// Flags for a given character encoding, specified in TextMgr.h (PalmOS 3.5)
793
sysFtrNumNotifyMgrVersion = 17; // version of the NotifyMgr, if any (PalmOS 3.5)
795
sysFtrNumOEMROMVersion = 18; // Supplemental ROM version, provided by OEM
796
// This value may be present in OEM devices, and is in the same format
797
// as sysFtrNumROMVersion. (PalmOS 3.5)
799
sysFtrNumErrorCheckLevel = 19; // ROM build setting of ERROR_CHECK_LEVEL
800
// May be set to ERROR_CHECK_NONE, ERROR_CHECK_PARTIAL, or ERROR_CHECK_FULL
801
// as defined in <BuildDefines.h>. (PalmOS 3.5)
803
sysFtrNumOEMCompanyID = 20; // GHwrOEMCompanyID value (PalmOS 3.5)
804
sysFtrNumOEMDeviceID = 21; // GHwrOEMDeviceID value (PalmOS 3.5)
805
sysFtrNumOEMHALID = 22; // GHwrOEMHALID value (PalmOS 3.5)
806
sysFtrNumDefaultCompression = 23; // Default Clipper's compression (Palmos 3.5)
807
sysFtrNumWinVersion = 24; // Window version (PalmOS 4.0)
808
sysFtrNumAccessorTrapPresent = 25; // If accessor trap exists (PalmOS 4.0)
810
(************************************************************
811
* ROM token information (for SysGetROMToken, below)
812
*************************************************************)
814
// Additional tokens and token information is located in <Hardware.h>
815
sysROMTokenSnum = Rsc('snum'); // Memory Card Flash ID (serial number)
817
(************************************************************
818
* Macros for extracting and combining ROM/OS version components
819
*************************************************************)
821
// ROM/OS stage numbers
822
sysROMStageDevelopment = 0;
823
sysROMStageAlpha = 1;
825
sysROMStageRelease = 3;
827
// MACRO: sysMakeROMVersion
829
// Builds a ROM version value from the major, minor, fix, stage, and build numbers
832
function sysMakeROMVersion(major, minor, fix, stage: UInt8; buildNum: UInt16): UInt32;
835
// Macros for parsing the ROM version number
836
// (the system OS version is obtained by calling
837
// FtrGet(sysFtrCreator, sysFtrNumROMVersion, dwOSVerP), where dwOSVerP is
838
// a pointer to to a UInt32 variable that is to receive the OS version number)
840
function sysGetROMVerMajor(dwROMVer: UInt32): UInt16;
841
function sysGetROMVerMinor(dwROMVer: UInt32): UInt16;
842
function sysGetROMVerFix(dwROMVer: UInt32): UInt16;
843
function sysGetROMVerStage(dwROMVer: UInt32): UInt16;
844
function sysGetROMVerBuild(dwROMVer: UInt32): UInt16;
846
(************************************************************
848
*************************************************************)
850
// Types of batteries installed.
852
SysBatteryKind = Enum;
855
sysBatteryKindAlkaline=0;
856
sysBatteryKindNiCad = Succ(sysBatteryKindAlkaline);
857
sysBatteryKindLiIon = Succ(sysBatteryKindNiCad);
858
sysBatteryKindRechAlk = Succ(sysBatteryKindLiIon);
859
sysBatteryKindNiMH = Succ(sysBatteryKindRechAlk);
860
sysBatteryKindLiIon1400 = Succ(sysBatteryKindNiMH);
861
sysBatteryKindLast = $FF; // insert new battery types BEFORE this one
863
// Different battery states (output of hwrBattery)
865
SysBatteryState = Enum;
868
sysBatteryStateNormal = 0;
869
sysBatteryStateLowBattery = Succ(sysBatteryStateNormal);
870
sysBatteryStateCritBattery = Succ(sysBatteryStateLowBattery);
871
sysBatteryStateShutdow = Succ(sysBatteryStateCritBattery);
873
// SysCreateDataBaseList can generate a list of database.
875
SysDBListItemType = record
876
name: array [0..dmDBNameLength-1] of Char;
885
// Structure of a generic message that can be send to a mailbox
886
// through the SysMailboxSend call. Note, this structure MUST
887
// be CJ_MAXMSZ bytes large, where CJ_MAXMSZ is defined in
889
SysMailboxMsgType = record
890
data: array [0..2] of UInt32;
893
// Constants used by the SysEvGroupSignal call
895
sysEvGroupSignalConstant = 0;
896
sysEvGroupSignalPulse = 1;
898
// Constants used by the SysEvGroupWait call
899
sysEvGroupWaitOR = 0;
900
sysEvGroupWaitAND = 1;
902
(************************************************************
903
* System Pre-defined "file descriptors"
904
* These are used by applications that use the Net Library's
905
* NetLibSelect() call
906
*************************************************************)
908
sysFileDescStdIn = 0;
910
//============================================================================
911
// jhl 7/26/00 Integrate HSIMgr functionality
912
//============================================================================
913
sysNotifyHSISerialPortInUseEvent = Rsc('hsiu'); // Sent when serial port is in use
914
sysNotifyHSIPeripheralRespondedEvent = Rsc('hspr'); // Sent with peripheral response
915
sysNotifyHSIPeripheralNotRespondingEvent = Rsc('hspn'); // Sent when peripheral does not respond
916
sysNotifyHSINoConnectionEvent = Rsc('ncon'); // Sent on VID of no connection
917
sysNotifyHSIUSBCradleEvent = sysPortUSBDesktop; // Sent on VID of USB Cradle
918
sysNotifyHSIRS232CradleEvent = Rsc('rs2c'); // Sent on VID of RS232 Cradle
919
sysNotifyHSIUSBPeripheralEvent = sysPortUSBPeripheral; // Sent on VID of USB Peripheral
920
sysNotifyHSIRS232PeripheralEvent = Rsc('rs2p'); // Sent on VID of RS232 Peripheral
921
sysNotifyHSIDebugEvent = Rsc('dbug'); // Sent on VID of Debug
923
sysMaxHSIResponseSize = 64;
924
sysHSISerialInquiryBaud = 9600;
925
sysHSISerialInquiryString = 'ATI3\015\012';
926
sysHSISerialInquiryStringLen = 6;
927
sysHSISerialInterChrTimeout = 3; // ticks (20-30 ms)
928
sysHSISerialInquiryTimeout = 11; // ticks (100-110 ms)
931
SysHSIResponseType = record
932
// "Voltage ID" from modem pin converted to 4 character VID
934
// Actual voltage detected on modem VID pin
936
// Character string received in response to inquiry string
937
// (will be NUL terminated)
938
responseBuffer: array [0..sysMaxHSIResponseSize-1] of Char;
939
// Length of string in responseBuffer
940
responseLength: UInt16;
943
(************************************************************
944
* Function Prototypes
945
*************************************************************)
947
// Prototype for Pilot applications entry point
949
// UInt32 PilotMain(UInt16 cmd, void *cmdPBP, UInt16 launchFlags);
951
// SystemMgr routines
952
procedure SysUnimplemented; syscall sysTrapSysUnimplemented;
954
procedure SysColdBoot(card0P: Pointer; card0Size: UInt32; card1P: Pointer;
955
card1Size, sysCardHeaderOffset: UInt32); syscall sysTrapSysColdBoot;
957
procedure SysInit; syscall sysTrapSysInit;
959
procedure SysReset; syscall sysTrapSysReset;
961
//procedure SysPowerOn(card0P: Pointer; card0Size: UInt32; card1P: Pointer;
962
// card1Size, sysCardHeaderOffset: UInt32; reFormat: Boolean); syscall sysTrapSysPowerOn;
964
procedure SysDoze(onlyNMI: Boolean); syscall sysTrapSysDoze;
966
function SysSetPerformance(var sysClockP: UInt32; var cpuDutyP: UInt16): Err; syscall sysTrapSysSetPerformance;
968
procedure SysSleep(untilReset, emergency: Boolean); syscall sysTrapSysSleep;
970
function SysSetAutoOffTime(seconds: UInt16): UInt16; syscall sysTrapSysSetAutoOffTime;
972
function SysTicksPerSecond: UInt16; syscall sysTrapSysTicksPerSecond;
974
function SysLaunchConsole: Err; syscall sysTrapSysLaunchConsole;
976
function SysHandleEvent(var eventP: EventType): Boolean; syscall sysTrapSysHandleEvent;
978
procedure SysUILaunch; syscall sysTrapSysUILaunch;
980
function SysUIAppSwitch(cardNo: UInt16; dbID: LocalID; cmd: UInt16; cmdPBP: MemPtr): Err; syscall sysTrapSysUIAppSwitch;
982
function SysCurAppDatabase(var cardNoP: UInt16; var dbIDP: LocalID): Err; syscall sysTrapSysCurAppDatabase;
984
function SysBroadcastActionCode(cmd: UInt16; cmdPBP: MemPtr): Err; syscall sysTrapSysBroadcastActionCode;
986
function SysAppLaunch(cardNo: UInt16; dbID: LocalID; launchFlags, cmd: UInt16;
987
cmdPBP: MemPtr; var resultP: UInt32): Err; syscall sysTrapSysAppLaunch;
989
function SysNewOwnerID: UInt16; syscall sysTrapSysNewOwnerID;
991
function SysSetA5(newValue: UInt32): UInt32; syscall sysTrapSysSetA5;
993
// Routines used by startup code
994
function SysAppStartup(var appInfoPP: SysAppInfoPtr; var prevGlobalsP, globalsPtrP: MemPtr): Err; syscall sysTrapSysAppStartup;
996
function SysAppExit(appInfoP: SysAppInfoPtr; prevGlobalsP, globalsP: MemPtr): Err; syscall sysTrapSysAppExit;
998
//#if EMULATION_LEVEL != EMULATION_NONE
999
// Simulator-specific routines
1000
//MemPtr SysCardImageInfo(UInt16 cardNo, UInt32 *sizeP;
1002
//void SysCardImageDeleted(UInt16 cardNo;
1003
//#endif // EMULATION_LEVEL != EMULATION_NONE
1005
function SysUIBusy(set_, value: Boolean): UInt16; syscall sysTrapSysUIBusy;
1007
function SysLCDContrast(set_: Boolean; newContrastLevel: UInt8): UInt8; syscall sysTrapSysLCDContrast;
1009
function SysLCDBrightness(set_: Boolean; newBrightnessLevel: UInt8): UInt8; syscall sysTrapSysLCDBrightness;
1012
procedure SysBatteryDialog; syscall sysTrapSysBatteryDialog;
1015
function SysSetTrapAddress(trapNum: UInt16; procP: Pointer): Err; syscall sysTrapSysSetTrapAddress;
1017
function SysGetTrapAddress(trapNum: UInt16): Pointer; syscall sysTrapSysGetTrapAddress;
1019
function SysDisableInts: UInt16; syscall sysTrapSysDisableInts;
1021
procedure SysRestoreStatus(status: UInt16); syscall sysTrapSysRestoreStatus;
1023
function SysGetOSVersionString: PChar; syscall sysTrapSysGetOSVersionString;
1025
// The following trap is a public definition of HwrGetROMToken from <Hardware.h>
1026
// See token definitions (like sysROMTokenSerial) above...
1028
function SysGetROMToken(cardNo: UInt16; token: UInt32; var dataP: UInt8Ptr; var sizeP: UInt16): Err; syscall sysTrapHwrGetROMToken;
1031
// Library Management
1032
function SysLibInstall(libraryP: SysLibEntryProcPtr; var refNumP: UInt16): Err; syscall sysTrapSysLibInstall;
1034
function SysLibLoad(libType, libCreator: UInt32; var refNumP: UInt16): Err; syscall sysTrapSysLibLoad;
1036
function SysLibRemove(refNum: UInt16): Err; syscall sysTrapSysLibRemove;
1038
function SysLibFind(const nameP: PChar; var refNumP: UInt16): Err; syscall sysTrapSysLibFind;
1040
function SysLibTblEntry(refNum: UInt16): SysLibTblEntryPtr; syscall sysTrapSysLibTblEntry;
1042
// Generic Library calls
1043
function SysLibOpen(refNum: UInt16): Err; syscall sysLibTrapOpen;
1044
function SysLibClose(refNum: UInt16): Err; syscall sysLibTrapClose;
1045
function SysLibSleep(refNum: UInt16): Err; syscall sysLibTrapSleep;
1046
function SysLibWake(refNum: UInt16): Err; syscall sysLibTrapWake;
1048
//-----------------------------------------------------
1049
// Kernel Prototypes
1050
//-----------------------------------------------------
1052
// Task Creation and deleation
1053
function SysTranslateKernelErr(err: Err): Err; syscall sysTrapSysTranslateKernelErr;
1055
function SysTaskCreate(var taskIDP, creator: UInt32; codeP: ProcPtr; stackP: MemPtr;
1056
stackSize, attr, priority, tSlice: UInt32): Err; syscall sysTrapSysTaskCreate;
1058
function SysTaskDelete(taskID, priority: UInt32): Err; syscall sysTrapSysTaskDelete;
1060
function SysTaskTrigger(taskID: UInt32): Err; syscall sysTrapSysTaskTrigger;
1062
function SysTaskID: UInt32; syscall sysTrapSysTaskID;
1064
function SysTaskDelay(delay: Int32): Err; syscall sysTrapSysTaskDelay;
1066
function SysTaskSetTermProc(taskID: UInt32; termProcP: SysTermProcPtr): Err; syscall sysTrapSysTaskSetTermProc;
1068
function SysTaskSwitching(enable: Boolean): Err; syscall sysTrapSysTaskSwitching;
1070
function SysTaskWait(timeout: Int32): Err; syscall sysTrapSysTaskWait;
1072
function SysTaskWake(taskID: UInt32): Err; syscall sysTrapSysTaskWake;
1074
procedure SysTaskWaitClr; syscall sysTrapSysTaskWaitClr;
1076
function SysTaskSuspend(taskID: UInt32): Err; syscall sysTrapSysTaskSuspend;
1078
function SysTaskResume(taskID: UInt32): Err; syscall sysTrapSysTaskResume;
1080
// Counting Semaphores
1081
function SysSemaphoreCreate(var smIDP, tagP: UInt32; initValue: Int32): Err; syscall sysTrapSysSemaphoreCreate;
1083
function SysSemaphoreDelete(smID: UInt32): Err; syscall sysTrapSysSemaphoreDelete;
1085
function SysSemaphoreWait(smID, priority: UInt32; timeout: Int32): Err; syscall sysTrapSysSemaphoreWait;
1087
function SysSemaphoreSignal(smID: UInt32): Err; syscall sysTrapSysSemaphoreSignal;
1089
function SysSemaphoreSet(smID: UInt32): Err; syscall sysTrapSysSemaphoreSet;
1091
// Resource Semaphores
1092
function SysResSemaphoreCreate(var smIDP, tagP: UInt32): Err; syscall sysTrapSysResSemaphoreCreate;
1094
function SysResSemaphoreDelete(smID: UInt32): Err; syscall sysTrapSysResSemaphoreDelete;
1096
function SysResSemaphoreReserve(smID, priority: UInt32; timeout: Int32): Err; syscall sysTrapSysResSemaphoreReserve;
1098
function SysResSemaphoreRelease(smID: UInt32): Err; syscall sysTrapSysResSemaphoreRelease;
1101
function SysTimerCreate(var timerIDP, tagP: UInt32; timerProc: SysTimerProcPtr;
1102
periodicDelay, param: UInt32): Err; syscall sysTrapSysTimerCreate;
1104
function SysTimerDelete(timerID: UInt32): Err; syscall sysTrapSysTimerDelete;
1106
function SysTimerWrite(timerID, value: UInt32): Err; syscall sysTrapSysTimerWrite;
1108
function SysTimerRead(timerID: UInt32; var valueP: UInt32): Err; syscall sysTrapSysTimerRead;
1111
function SysKernelInfo(paramP: Pointer): Err; syscall sysTrapSysKernelInfo;
1113
function SysCreateDataBaseList(type_, creator: UInt32; var dbCount: UInt16;
1114
var dbIDs: MemHandle; lookupName: Boolean): Boolean; syscall sysTrapSysCreateDataBaseList;
1116
function SysCreatePanelList(var panelCount: UInt16; var panelIDs: MemHandle): Boolean; syscall sysTrapSysCreatePanelList;
1118
function SysBatteryInfo(set_: Boolean; var warnThresholdP, criticalThresholdP: UInt16;
1119
var maxTicksP: Int16; var kindP: SysBatteryKind; var pluggedIn: Boolean;
1120
var percentP: UInt8): UInt16; syscall sysTrapSysBatteryInfo;
1122
function SysBatteryInfoV20(set_: Boolean; warnThresholdP, criticalThresholdP: UInt16;
1123
var maxTicksP: Int16; var kindP: SysBatteryKind; var pluggedIn: Boolean): UInt16; syscall sysTrapSysBatteryInfoV20;
1125
function SysGetStackInfo(var startPP, endPP: MemPtr): Boolean; syscall sysTrapSysGetStackInfo;
1128
function SysMailboxCreate(var mbIDP, tagP: UInt32; depth: UInt32): Err; syscall sysTrapSysMailboxCreate;
1130
function SysMailboxDelete(mbID: UInt32): Err; syscall sysTrapSysMailboxDelete;
1132
function SysMailboxFlush(mbID: UInt32): Err; syscall sysTrapSysMailboxFlush;
1134
function SysMailboxSend(mbID: UInt32; msgP: Pointer; wAck: UInt32): Err; syscall sysTrapSysMailboxSend;
1136
function SysMailboxWait(mbID: UInt32; msgP: Pointer; priority: UInt32; timeout: Int32): Err; syscall sysTrapSysMailboxWait;
1139
function SysEvGroupCreate(var evIDP, tagP: UInt32; init: UInt32): Err; syscall sysTrapSysEvGroupCreate;
1141
//Err SysEvGroupDelete(UInt32 evID) // save trap table space - don't need
1142
//; syscall sysTrapSysEvGroupDelete;
1144
function SysEvGroupSignal(evID, mask, value: UInt32; type_: Int32): Err; syscall sysTrapSysEvGroupSignal;
1146
function SysEvGroupRead(evID: UInt32; var valueP: UInt32): Err; syscall sysTrapSysEvGroupRead;
1148
function SysEvGroupWait(evID, mask, value: UInt32; matchType, timeout: Int32): Err; syscall sysTrapSysEvGroupWait;
1150
(************************************************************
1151
* Assembly Function Prototypes
1152
*************************************************************)
1154
//#define _SysSemaphoreSignal ASM_; syscall sysTrapSysSemaphoreSignal
1156
//#define _SysSemaphoreSet ASM_; syscall sysTrapSysSemaphoreSet
1158
//#define _SysDoze ASM_; syscall sysTrapSysDoze
1162
function sysMakeROMVersion(major, minor, fix, stage: UInt8; buildNum: UInt16): UInt32;
1164
sysMakeROMVersion :=
1165
((major and $0FF) shl 24) or
1166
((minor and $00F) shl 20) or
1167
((fix and $00F) shl 16) or
1168
((stage and $00F) shl 12) or
1169
(buildNum and $0FFF);
1172
function sysGetROMVerMajor(dwROMVer: UInt32): UInt16;
1174
sysGetROMVerMajor := (dwROMVer shr 24) and $00FF;
1177
function sysGetROMVerMinor(dwROMVer: UInt32): UInt16;
1179
sysGetROMVerMinor := (dwROMVer shr 20) and $000F;
1182
function sysGetROMVerFix(dwROMVer: UInt32): UInt16;
1184
sysGetROMVerFix := (dwROMVer shr 16) and $000F;
1187
function sysGetROMVerStage(dwROMVer: UInt32): UInt16;
1189
sysGetROMVerStage := (dwROMVer shr 12) and $000F;
1192
function sysGetROMVerBuild(dwROMVer: UInt32): UInt16;
1194
sysGetROMVerBuild := dwROMVer and $0FFF;