#ifndef MAX_TASKS /* Default to 16 tasks, override may come from variant.h */ #define MAX_TASKS 16 #endif
#define MAX_EMBEDDED_EVT_SUBS 6/* tradeoff, no wrong answer */ #define TASK_IDX_BITS 8/* should be big enough to hold MAX_TASKS, but still fit in TaskIndex */
typedef uint8_t TaskIndex;
struct AppFuncs { /* do not rearrange */ /* lifescycle */ bool (*init)(uint32_t yourTid); //simple init only - no ints on at this time void (*end)(void); //die quickly please /* events */ void (*handle)(uint32_t evtType, constvoid* evtData);
};
#if MAX_TASKS > TASK_TID_IDX_MASK #error MAX_TASKS does not fit in TASK_TID_BITS #endif
#define OS_SYSTEM_TID 0 #define OS_VER 0x0000
// FIXME: compatibility: keep key ID 1 until key update is functional //#define ENCR_KEY_GOOGLE_PREPOPULATED 0x041F010000000001 #define ENCR_KEY_GOOGLE_PREPOPULATED 1// our key ID is 1
#define FL_APP_HDR_INTERNAL 0x0001 // to be able to fork behavior at run time for internal apps #define FL_APP_HDR_APPLICATION 0x0002 // image has AppHdr; otherwise is has AppInfo header #define FL_APP_HDR_SECURE 0x0004 // secure content, needs to be zero-filled when discarded #define FL_APP_HDR_VOLATILE 0x0008 // volatile content, segment shall be deleted after operation is complete #define FL_APP_HDR_CHRE 0x0010 // app is CHRE API compatible #define FL_KEY_HDR_DELETE 0x8000 // key-specific flag: if set key id refers to existing key which has to be deleted
/* app ids are split into vendor and app parts. vendor parts are assigned by google. App parts are free for each vendor to assign at will */ #define KEY_ID_MAKE(vendor, key) ((((uint64_t)(vendor)) << 24) | ((key) & KEY_SEQ_ID_ANY)) #define HW_ID_MAKE(vendor, ver) ((((uint64_t)(vendor)) << 24) | (PLATFORM_ID(ver) & HW_ID_ANY)) #define KEY_SEQ_ID_ANY UINT64_C(0xFFFFFF) #define HW_ID_ANY UINT64_C(0xFFFFFF) #define PLATFORM_ID(ver) ((((PLATFORM_HW_TYPE) & 0xFFFF) << 8) | (ver & 0xFF))
/* ==== ABOUT THE "urgent" FLAG ==== * *Donotset"urgent"unlessyouunderstandalltherepercussions!Whatrepercussionsyoumightask? *Settingthisflagwillplaceyourdeferrequestatthefrontofthequeue.Thisisusefulforenqueueingwork *frominterruptcontextthatneedstobedone"veryverysoon"(tm).Doingthiswilldelayallotherworkrequests *thathaveheretoforebeenpeacefullyqueueinginfullfaithandwithcompletebeliefinfairnessofour"FIFO"-ness. *Pleasebeappreciativeofthisfactanddonotabusethis!Example:ifyouaresetting"urgent"flagoutsideofinterrupt *context,you'reveryverylikelywrong.Thatisnottosaythatbeingininterruptcontextisafreepasstosetthis!
*/
// osMainInit is exposed for testing only, it must never be called for any reason at all by anyone void osMainInit(void); // osMainDequeueLoop is exposed for testing only, it must never be called for any reason at all by anyone void osMainDequeueLoop(void); void osMain(void);
//event retaining support bool osRetainCurrentEvent(TaggedPtr *evtFreeingInfoP); //called from any apps' event handling to retain current event. Only valid for first app that tries. evtFreeingInfoP filled by call and used to free evt later void osFreeRetainedEvent(uint32_t evtType, void *evtData, TaggedPtr *evtFreeingInfoP);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.