Home

I SCIOPTA - Real

image

Contents

1. Name Number Error Source SC MSGALLOC 0x01 sc msgAlloc SC MSGFREE 0x02 sc msgFree SC MSGADDRGET 0x03 sc msgAddrGet SC MSGSNDGET 0x04 sc msgSndGet SC MSGSIZEGET 0x05 sc msgOwnerGet SC MSGSIZESET 0x06 sc msgSizeGet SC MSGOWNERGET 0x07 sc msgSizeSet SC MSGTX 0x08 sc msgTx SC MSGTXALIAS 0x09 sc msgTxAlias SC MSGRX sc msgRx SC MSGPOOLIDGET OxOB 5 poolldGet SC MSGACQUIRE 0 0 sc msgAcquire SC MSGALLOCCLR OxOD sc msgAllocClr SC MSGHOOKREGISTER OxOE msgHookRegister SC POOLCREATE 0x10 sc_poolCreate SC_POOLRESET 0x11 sc poolReset SC POOLKILL Ox12 sc poolKill SC POOLINFO 0 13 sc poolInfo SC POOLDEFAULT 0x14 sc poolInfo SC POOLIDGET 0 15 sc procIdGet SC SYSPOOLKILL 0 16 sysPoolKill SC POOLHOOKREGISTER 0x17 poolHookRegister SC POOLCBCHK 0 1 sc poolCbChk see Safety Manual SC PROCWAKEUPENABLE OxIE procWakeupEnable SC PROCWAKEUPDISABLE OxIF sc procWakeupDisable SC PROCPRIOGET 0x20 sc procPrioGet SC PROCPRIOSET 0 21 Sc procPrioSet SC PROCSLICEGET 0x22 procSliceGet SC PROCSLICESET 0x23 Sc procSliceSet SC PROCIDGET 0x24 sc procIdGet SC PROCPPIDGET 0x25 sc procPpidGet SC PROCNAMEGET 0x26 sc procNameGet SC PROCSTART 0x27 Sc procStart SC PROCSTOP 0x28 Sc procStop SC PROCVARINIT 0x29 sc procVarlnit SC PROCSCHEDUNLOCK Ox2A sc procSchedUnlock SC PROCPRIOCREATESTATIC Ox2B Internal SC PROCINTCREATESTATIC O
2. 3 18 1 b CHIU OM 55 3 18 2 Aas sac 3 18 3 I sro RR 3 18 4 Value 3 18 5 M 3 18 9 1 T OCCUR UE 3 19 sc 3 19 1 Descrptionz zen utto hb eee Hee REI RGIS 3 19 2 ur M 3 19 3 Parameter 3 19 4 Return 3 19 5 I cidcm 3 19 6 3 20 scomodulePrioGet 3 20 1 Ib eap 3 20 2 3 20 3 eaaa PM ID SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 5 em SC IOPTA Table of Contents 4 3 20 4 UO UOEm 3 25 3 20 5 locum 3 25 3 20 6 luus DM S 3 25 3 21 SCAMS ACQUIT C 3 26 3 21 1 Description ceret nineteenth obe ree tipa dre 3 26 3 21 2
3. Ma 3 33 EORR VERE RR 4 1 Get a Process Variable ssp ORDRE 3 104 Get Information About a Message Pool 3 56 Get Information About a Module 3 19 Get Module Friend Information ccccccccccccssesssecccecessnssececessseecececesaceeccecesesaeseecsessaeseeceesesseseeceesseeseeeeneaeees 3 15 Get the Addressee of a Message 15 eee Dis EEEE EENE ETE Rope ER o epe aba 3 28 Get the Creator creer rette En ov PUER 3 80 20 aes 3 55 Get the ID of a Module 3 18 the IDOA PROCESS TREO HE 3 66 Get the Interttpt Vector E 3 109 Get the Name of aA 3 24 Get the Name of Process c ccccccsessseccecsesssececesesseecececessuasececessasseeececessseeccecesssaesesceessaeseceseseasseseeceesseeeeesenenaees 3 73 Get t
4. 4 4 SCRI IIR Ert 3 113 SC TCE 4 4 3 115 SC 4 4 TC GS ee 3 116 4 5 SGP ICS SU 552055 3 117 SC TICKIMS2 EUER 4 5 Se ek MS TICK Pere 3 118 G3 M OL SPA TEC 4 5 SCH TICK TICK MIS MH 3 119 SC TMO Cm 3 30 3 39 Va ERR EE ERE 3 120 C MIC EID IUE IM I Et 3 122 SC TRIGGER E 4 4 SG UIP BEM REOR ERE Re UTOR een erede e ee ero 3 124 SC TRIGGERVALUEQGET 1 nnne nn nnns nennen aane enne sette tana 4 4 tripgerValueGret HO ERES eas 3 125 SC TRIGGERVALUESBET tas ss se eitis 4 4 Sc tripgerValueSet dede E GR te Pie 3 126 SC TRIGGERWAIT 4 4 SC UIE SEL Wall soi OR ERR BER ERE REG
5. 3 20 Message Hook 3 35 Mod le Syst m Calls 2 3 mnm c 3 19 nup qe 1 4 TOPCO DOO T t 1 4 TOP CS ARK ssi 1 4 iod qc 1 4 m 1 4 MPXIXK 1 4 N E UCM HR 3 73 O EE 3 75 On chip TIMET M 3 115 Owner of d Message EUM 3 26 3 37 MCI 3 78 Pool Control GC 3 56 Pool Create HOOK quM EcL NEEDS 3 53 Np M 3 38 SCIOPTA Real Time Kernel 6 4 Manual Version 4 1 Reference Manual 6 Index Pool Info Structure tease ext e ese Ed er Ren Pool HOOK Process System
6. eade 3 60 3 40 4 Return 3 60 3 40 5 pte ERREUR RD de ae 3 60 3 40 6 inso M 3 60 3 41 NIV MEE 3 61 3 41 1 b esp n e 3 61 3 41 2 dle hier 3 61 3 41 3 3 61 3 41 4 V alte M 3 61 3 41 5 BEX AU M 3 61 3 41 6 lusu CR mr 3 61 3 42 SC procDaemon ag 3 62 3 42 1 Description A em ee RE eS 3 62 3 42 2 DY ULAR nn 3 62 SCIOPTA Real Time Kernel Vi Manual Version 4 1 Reference Manual Table of Contents 3 42 3 e tees 3 42 4 Return 3 42 5 luus M PEPPER 3 43 sc procDaemonUnrfegister 3 43 1 nce eerte m E 3 43 2 un D 3 43 3 MM 3 43 4 Return 3 43 5 e EE 3 44 sc procHookRePISIer etse e
7. 3 115 3 74 3 ParaMeter cccecccccsssssscccecesssseececesssseceecesesseececesessnececccessnaeececesenaeseccecssaeseccscseeaeseccsensaeceeesensaesesens 3 115 3 74 4 Valie is ses M 3 115 3 74 5 BX AUP c 3 115 3 74 6 luu C 3 115 3 75 SCC GE entere aei 3 116 3 75 1 IDESCHIPUON 3 116 3 75 2 uu M 3 116 3 75 3 cue DERE REESE Les TEE EAE tia vases RES ERREUR 3 116 3 75 4 IUBE CEREREM 3 116 3 75 5 Iocunj cM TEE 3 116 3 75 6 NEED ONG E CENE CENSURE 3 116 3 76 MICE ea e E A A EE E E E E T R 3 117 3 76 1 oieracea ERR E E E E 3 117 3 76 2 SYNAR E E E E AE E EE 3 117 3 76 3 eE EE E E NE EH E eee ORS 3 117 3 76 4 Ret rn Value eerie 3 117 3 76 5 PIX AUD TAT 3 117 3 76 6 3 117 3 77 redSUEPbdc ET 3 118 3 77 1 Description see Sees es oma be ee Sek BGS 3 118 3 77 2 Our 3 118 3 77 3 NEUTER EAE 3 118 3 71 4
8. 3 T 3 50 6 lS MA PE 3 77 3 51 SC Proc hal MGCL teste ct UE 3 78 3 51 1 Description uenerat eot ione n ea DETUR OOo berum 3 78 3 51 2 DD VAR 3 78 3 51 3 Parameter 3 78 3 51 4 Return 3 78 3 51 5 itae eU ead esti ai b op et naa 3 79 3 51 6 FEET OMS EE LIII UD 3 79 3 52 sc procPpidGet ones RR RERO HERRERA ERE ERE 3 80 3 52 1 3 80 3 52 2 cames i E renim mieten epe 3 80 3 52 3 cece 3 80 3 52 4 3 80 3 52 5 BX AUP Ges 3 80 3 52 6 lusu sees Fist H E E 3 81 3 53 SC DIOGPHOGTEdle eiecti perte adeste eei en EN 3 82 3 53 1 s ROBERT NUR E ees 3 82 3 53 2 unn c r 3 82 3 53 3 Paraimeter ince DoD E 3 82 3 53 4 ISUWBEU CRRRRMMMMMMMMMMMEMMMMMMMEMMMEEMMMMMMEMMMMEMMMMMMMMMMMMMMMEMMMMMMMMMMMN 3 83 3 53 5 oun e RERO eite Uu 3 83 3 53 6 lo
9. 3 71 SC uie e WEGE 4 3 SC TOC N amMeGrel rm 3 73 SC PROCNAMEGETMSOQG REPLY 3 73 3 78 SC_PROCOBSERVE 4 4 SE PTOCO DSERVE 3 75 5 2200 2 2 0122 2 0 tasas sette asa e ranas esee 4 4 5 qe H 3 77 SC 0 cccccccccccsssccccecsssececcecesnececcecsensseceeceesssecesesessaeeeseseseseeseceseseesececeseaaeeeeceseaaeseccecenseaeeeeees 4 4 s procPathGet 3 78 SC_PROCPPIDGET 0 cccccccccsssssccccecssssccececssseceececeessaeceecesnsaesecesenseeeecesesessuececesenseecececessnaeececessnaeaesceceesaaeececns 4 3 sc procPpIdGetz ii nU ees ee agi eos Re 3 80 SC PROCPRIOGET o eceecccccccccccsccccsesssecececesessececcesensseccecesuaaececceessaeseccecssaeseceecseseeceecseseaesecesessaeceeecesenseaeeeeees 4 3 SE PrOCPrOGEl es 3 85 SC_PROCPRIOSET E 4 3 SG procPrioSet ehe 3 87 SC_PROCSCHEDLOCK cccccssccccecssssseececsenseeceeceessaececeseseeseseseseseececeseseeeeeecesaaeeeeceseaaeaeccecenseaeeeeees 4 4 s procScehedLoGK sarrerea oni E aN AE epe
10. 3 31 2 p ERE 3 31 3 ParaMeter cccecccccecessscecccesesssececesesesseccesessnececesesssseeecesesseeeceseseaeccecesssaeceeceessueaeecs 3 31 4 3 31 5 loculi M M 3 31 6 ETERNI 3 32 3 32 1 Description i ia ertet eund rtr itn 3 32 2 un D A 3 32 3 3 324 IUBE CERRRRRRRRREMMEMMMMMMMEMMMEMMMMEMMMMMMMM 3 32 5 Example unpaid ti irae eb OR 3 32 6 iecit eere EORR REIR 3 33 SCAMS SEK E EE 3 33 1 b eap 3 33 2 Muri nns 3 33 3 I zio RRRRRRRRRRRRRRRRRRRRRRMEEEMEMMMMMMMMMMM 3 33 4 Anio lE 3 33 5 3 33 6 3 34 SC TS OM RAMI AS 3 34 1 Descriptions oae Recs He eee UO RU RIS ieee 3 34 2 DD VIMAR d 3 34 3 Paramieter ic 3 344 Return 3 34 5 3 34 6 dieci annuit ut
11. 3 47 4 Return 3 47 5 Iocund c EE 3 47 6 OMG E EI UD 3 48 sc procNameGet 2 eee RE Gud ane ees nan O 3 48 1 eui 3 48 2 de EE 3 48 3 ParaMeter cccccccccscsssscccecesssscececesesseaeecesessnececesensaecececessaaeececesensuaeccecesaaeeeecsessaeaeess 3 48 4 Value Pe eee 3 48 5 BEX AU Gogo M 3 48 6 3 49 SC DIOCODSGEVE td E er Eee 3 49 1 Descriptions jaded EE 3 49 2 3 49 3 Parameter uc esteso a e ia eat 3 49 4 Return 3 49 5 Gl E DRIED EROR RE 3 49 6 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 5 em VII SC IOPTA Table of Contents a 3 50 procPathCheck reete rie I stack vac derer Leto e Eb be e EE PEERS EROR 3 77 3 50 1 leg 3 77 3 50 2 3 77 3 50 3 Parameter cese eere tette ert Cre rt ie tee evi 3 77 3 50 4 e UO 3 77 3 50 5 locum
12. 132 req SC MAX NUM BUFFERSIZES No requests for a spec size u32 cnt alloc SC MAX NUM BUFFERSIZES No allocation of a spec size u32 cnt free SC NUM BUFFERSIZES No releases of a spec size u32 cnt wait SC MAX NUM BUFFERSIZES No unfullfilled allocations sc bufsize t maxalloc SC MAX NUM BUFFERSIZES largest wanted size pool stat t 3 39 8 Structure Members cnt req Number of buffer requests for a specific size cnt alloc Number of buffer allocations of a specific size cnt free Number of buffer releases of a specific size cnt wait Number of unfullfilled buffer allocations of specific size maxalloc Largest wanted size SCIOPTA Real Time Kernel 3 58 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 39 9 Example Sc poolid t pl Sc pool cb t pool info int check pl sc poolIGGet my pool check poolInfo pl amp pool info 3 39 10 Errors Error Code i Error Type Extra Value KERNEL ENIL PTR SC ERR PROCESS FATAL Illegal pointer to info structure KERNEL EILL POOL ID SC ERR MODULE FATAL Illegal pool ID Pool ID KERNEL EILL MODULE i SC ERR MODULE FATAL Illegal module Module ID SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 59 SC 3 System Calls Reference 3 40 sc 3 40 1 Description This system call
13. 3 32 3 25 s Msg M 3 33 3 25 1 Ib eap M M 3 33 3 25 2 oinnia cinia t rona edis itte 3 33 3 25 3 C 3 33 3 25 4 Value aet REGERE D EHE 3 33 3 25 5 c 3 33 3 25 6 lusu c 3 34 3 26 SC_IMSPHOOKRESISLER wz dos E M 3 35 3 26 1 Description niu ERREUR eee 3 35 3 26 2 uu c M 3 35 3 26 3 cientes NoD EE 3 35 3 26 4 Return 3 35 3 26 5 I ODER ERE RUE Ren HERODIS tH 3 35 3 26 6 SRI ee 3 36 3 27 OWnerGet nice iet riter REC REPE iere re eee 3 37 3 27 1 MDGS CHIP UL OM M M 3 37 3 27 2 c 3 37 3 27 3 Parameter 0 cccccccccessssscecesessnseccecesssseececcsesnececesensaececesessnseececesesseecececeseaeececesaaeseccecssaeeeecessaeaesecces 3 37 3 27 4
14. T 3 26 3 21 3 Parameter ccn ERE ERA REESE RE dense 3 26 3 21 4 3 26 3 21 5 lus m 3 27 3 22 Scomise ACL 3 28 3 22 1 iunge is Beech ete kd eta eases ee DERNIER EORR DE 3 28 3 22 2 unc ae si 3 28 3 22 3 pet 3 28 3 22 4 3 28 3 22 5 Example sin N es UNE UR ER oe 3 28 3 22 6 EE E 3 28 3 23 MEI 3 29 3 23 1 lesu 3 29 3 23 2 3 29 3 23 3 Para meteno R AE E E EREA 3 29 3 23 4 Valenssin e AE 3 30 3 23 5 A 3 30 3 23 6 ls Mm 3 31 3 24 ScemseATOCC TE tetuer DRE EEUU 3 32 3 24 1 Description tenti ne n EHE E E 3 32 3 24 2 3 32 3 24 3 low cs P Q 3 32 3 24 4 IUBE EEES OERE TSA 3 32 3 24 5 bxample estia dine ete tert de 3 32 3 24 6 ULP EET
15. o re ebbe ie ert System Tick Calls 4 reiner creta ttes tesi beet System TICKS rea eR OR ses Hee dees lesa es T The Systeri 5 trit ertet tende reet thread scusa os eH REED OU nen Eat Timing Transmitt a Message E U Unlock the Scheduler emerit Unregister a Process Daemon Wait on the Process Trigger sess Wanted Array in Receive Call Windows CE SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 d SCIOPTA 6 Index Yield the CPU H 3 112 3 129 3 130 SCIOPTA Real Time Kernel 6 10 Manual Version 4 1 Reference Manual
16. 3 37 3 21 5 locu 3 37 3 27 6 lus MM E 3 37 3 28 SCS POO MG Ge RE 3 38 SCIOPTA Real Time Kernel IV Manual Version 4 1 Reference Manual Table of Contents 3 28 1 TEE 3 28 2 3 28 3 E 3 28 4 IUBE CERE 3 28 5 uem Rn e ttti idea bae he aes 3 28 6 3 29 NEA qc 3 29 1 I up MH 3 29 2 M 3 29 3 S REPETIT TIL TU eE EE EREEREER 3 29 4 3 29 5 I cung e 3 29 6 3 30 SCams9 SIZe Ge det ier ertet 3 30 1 Descriptions ate wie 3 30 2 VIMAR 3 30 3 Parameter c etre iate eat eere 3 30 4 Return 3 30 5 3 30 6 HUI EHI 3 31 msgSizeSet 3 31 1 MDGS euo
17. CEDERE e bee TER REPE Ue 4 6 KERNEL EILL POOL 4 6 KERNEE SIZE RES EC EE UE E 4 6 KERNEL EILL PRIORITY 4 6 KERNEL BILE PROG 4 6 KERNEL EILL PROC 4 7 KERNEL BILL 4 6 KERNEL EILL SLICE esses 4 6 KERNEL BILE STACKSIZE dte ee Pate eS 4 6 KERNEL EILL SYSCALL sera aate etate nass stern nana 4 6 KERNEL TARGET NAME 4 6 KERNEL _EILL VALUE 4 7 KERNEL BILE VECTOR terere etre ra rete 4 6 KERNEL ELOCKED russ vori r6 SSS VESS 4 6 KERNEL EMODULE TOO SMALL 4 6 KERNEL EMSG ENDMARK CORRUPT 4 6 KERNEL EMSG HD CORRUPT tex eet odes Eo Canet e Cr ee EE REESE EE DARE PCT MEE pe Tob 4 6 KERNEL EMSG PREV ENDMARK CORRUPT nennen trennen 4 6 KERNEL ENIL PTR 4 6 KERNEL_ENO_KERNELD cccccccccccscssssceecec
18. 3 89 SC PROCSCHEDUNLOGONR on ceeecccccccccccccccccssssseececsensaeceececnsaececesesesssecescseseesecesesaesececessaasececessaasseceeceeaeeeeees 4 3 56 Du bero e CE 3 90 SC PROCSLICEQGET sese 4 3 s ProcS Ce Geet e 3 91 SC_PROCSLICESET RR 4 3 SC PrOCShCe Set 3 92 ae a EERE EEROR 4 3 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 6 7 SCIOPTA lt gt ORDINI Dnm 3 94 SC PROCSTOP 4 3 SCH POC SLOP t Oe E A RN OE 3 96 SCODIOCUTIODSEEVO 3 101 SC 4 4 demise c 3 103 SC 5 4 4 SCDIOC V ArGe eree ae 3 104 SC PROCVARINIT iet ote bie UP rro eb tere e cope E erbe 4 3 PROC e efe tere bere mU Eee arteries ieu 3 105 SC 4 4 SCSDIOC 3 107
19. st 4 6 KERNEL EUNLOCK WO LOCK fica eR PRI RUE ate 4 6 ISUEWIE TI MCu 3 60 Kill Module reads 3 22 3 71 L Lock the Scheduler ER EE 3 89 O E E 1 3 Ipc24xx si eite eee ie RO EUR REDE ee nO a en ERES 1 3 M Manitial version 1 2 Pc 5 7 TCI P m 5 2 Message Ownersbip reete bb e EUER reae pe 3 29 3 29 3 38 UST Ro 3 50 Message Pool Call ssc C 2 4 Message Queue 3 39 lU PON e 3 43 Calls E 2 1 Miscellaneous and Error Calls 2 6 Modify a Process Variable ee ninien nene EEr EE EE EE EEE E E Eear 3 108 Mod le Control 3 19 Mod le Error Hook C c 4 1 Mod le Into
20. 5 1 K Daemon RM 3 10 3 22 3 71 Kernel Error Codes e e Ee E te ecu E Tee E CP 4 1 Kernel Tick Counter cc cccccccccccccccssssceccecsesececcecsesesececesessseseccsesssseeeecesesseeeececeseaseceeceseaaeseccecesaesecesceensaeeeeeeenea 3 115 Trek 3 115 KERNEL EALREADY DEFINED 4 7 KBRNEL EENLARGE MSG eite etre eee ERE Lo eve EU o Eve ee E 4 6 KERNEL EILL BUF_SIZES nenne tnnt sesenta assis see ranas esser 4 6 KERNEL BILE BU BSIZBE FEE RETE 4 6 KERNEL 4 6 KERNEL BILE EXCEPTION einer torret eee Een ene EORR 4 6 KERNEL EILL INTERRUPT 2 00222222000000 0 0 00000000000 4 6 EILL MODULE ME 4 6 KERNEL EILL MODULE 4 6 EEUEEE 4 6 KERNEL EILL NESTING 20022222 2 0000010000000000000000000000000000000000 0 nasse ernannt 4 6 KERNEL EILL NUM SIZES 4 6 KERNEL EILL PARAMETER 4 7 KERNEL EILL PID
21. INE IE 3 89 3 57 rms 3 90 3 57 1 Description ERR ENSIS E E Ree RE REGE 3 90 3 57 2 DY TAK c M 3 90 SCIOPTA Real Time Kernel VIII Manual Version 4 1 Reference Manual Table of Contents 3 57 3 Parametern ns secciones eet deck pe ER e 3 57 4 Return 3 57 5 bxample sss ieee a ee ee ee ee ee 3 57 6 EEE OTS nie Ud EORUMDEM 3 58 5 D aE a 3 58 1 Description 3 58 2 3 58 3 ParamMeter cccscccccccsssscccecesesseececesesseaeecesessnececcsessecececessnseeeecesensnaecescessaaeeeecsesaaeaeess 3 58 4 Ret rn eni aep tei 3 58 5 locu 3 58 6 3 59 SC2PTOCS NCESEL 3 59 1 Descriptio pee m GEO PER E Eta 3 59 2 Xu C 3 59 3 H M 3 59 4 Return 3 59 5 Example censor maed eb RR 3 59 6 225 3 60 SC EC EE
22. 3 118 3 7 5 OS 3 118 3 77 6 eR E Le tue eI 3 118 378 SC CICK TICK 2M S mE 3 119 3 78 1 MDGS CHUL E 3 119 3 78 2 DUAR ce ETE 3 119 3 78 3 Parameter ever rm 3 119 3 78 4 Valie ves EE 3 119 3 78 5 BX AUP c 3 119 3 78 6 lusu lec 3 119 3 79 CIE 3 120 3 79 1 E 3 120 3 79 2 3 120 3 79 3 Parameter e MACH H P 3 120 3 79 4 nn HE 3 120 3 79 5 AEE retina oe dei uet tune 3 120 3 79 6 FEET REL EEE EEEE ET 3 121 3 80 a R AA A 3 122 3 80 1 97 aont a P E n 3 122 3 80 2 rar E d eene eet e ORO Pere ees 3 122 3 80 3 eee ete t tee tee ee ete Eie LEE e REALE EE ER EFE 3 122 3 80 4 Value REIHE ea REEDS 3 122 3 80 5 BX ATI Cos QR 3 122 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 Xl SC IOPTA Table of Cont
23. 4 3 ONE qe 3 39 SC_MSGRX_ALL 3 40 SC MSGRX BOTH tete idee 3 40 SC_MSGRX_MSGID 3 40 SC GJ H 3 40 Sa MSGRX PID ERR 3 40 SC IMSGSIZEGET Pe ERES 4 3 P SIZE Je 3 42 SC IMSGSIZESET MEET 4 3 SC 3 43 SC MSGSNDGET 2 4 3 SComisP SDOGeL 3 45 IMIS E D eck ideas aan Res aT 4 3 Combs 3 46 SCIOPTA Real Time Kernel 6 6 Manual Version 4 1 Reference Manual e 6 Index SCIOPTA a SC MSGTXALUKS tiit ene Rr t E cerva etes PU e PIE 4 3 SG TS OU KA AS Tm 3 48 er ere eee eee 3 30 3 39 X 4 3 SC POOECRENXTE 65 E seuss ieee Ses sauces cosh Guedes oo c Ea Eee EE IND uv EE E Pe ub E E 4 3 EIL I RN EE 3 50 SC 555 4 3
24. aE ER AES Nes ee BE eee 3 55 3 38 2 DD YUAN e 3 55 3 38 3 Parameter cese petet 3 55 3 38 4 U UOM P P MRBEM 3 55 3 38 5 Example e E 3 55 3 38 6 MEET TG i 22 Iu d 3 55 3 39 meu 3 56 3 39 1 MDGS CHIU OM A 3 56 3 39 2 EE 3 56 3 39 3 3 56 3 39 4 Value nee rer Ert epe PI sunbed cess eerie editi 3 56 3 39 5 Pool Info Structure ccc cc ccccsssecccesessseccecsessseceeceessaeceeceenssesecesenesseceseseaeececeseseeseeecesaaeeeecessaaeeeeeeees 3 57 3 39 6 struct re Members cete te ERU sweet 3 57 3 39 7 Pool Statistics Info Structure 1 3 58 3 39 8 iet ttt 3 58 3 39 9 locuni cM 3 59 3 39 10 CUR EE eee ore eee 3 59 3 40 SC x POON MIM e M M 3 60 3 40 1 Description i etie ite erre hU emen asi dh Siena aed ars 3 60 3 40 2 DD VIMAR c 3 60 3 40 3
25. 3 13 3 11 2 LEE 3 13 3 11 3 e r E E R RA ended te E ES 3 13 3 11 4 Valene iE AEE TE E EEE E R E RE E 3 13 3 11 5 FEET OMS fM 3 13 3 12 scmoduleEriendA ll ue 3 14 3 12 1 MDGS COUP OM 3 14 3 12 2 EUER 3 14 3 12 3 Parameter 0 cccccccccsssssscecesesenscececesenseececesessnececesensaececesessassececeseaseecececesseaeececessnaeaeccecssaeececessaaeaesecns 3 14 3 12 4 Ret rn V1 1 reer eres 3 14 3 12 5 BITORS E 3 14 SCIOPTA Real Time Kernel il Manual Version 4 1 Reference Manual Table of Contents 3 13 sc moduleFriendGet 3 13 1 3 13 2 3 13 3 ParamMeter cccccccccscsssscececesssseececesesseaeecesessnececesessnecececessnseececesenseaeceecessaaeeeeceessaeaeecs 3 13 4 Valie 3 13 5 ETOT RETO DU UM 3 14 sc 3 14 1 PE 3 14 2 M ms 3 14 3 Parameter esee e e HR UE FEX 3 14 4 Valie 3 14 5 TEE OT
26. ERR PROCESS FATAL Illegal pid e0 pid SCIOPTA Real Time Kernel 3 76 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 50 sc procPathCheck 3 50 1 Description This call is used to check if the construction of a path is correct It checks the lengths of the system module and process names and the number of slashes 3 50 2 Syntax Sc errcode t procPathCheck char path 3 50 3 Parameter path Pointer to the path with the name of the process path process name Process resides within the caller s module path z process name Process resides in the system module of the caller s target path z system name process name Process resides in the system module of an exter nal target path z module name process name Process resides in another than the system module of the caller s target path z system name module name process name If the process resides in another than the system module of an external target 3 50 4 Return Value 0 if the path is correct 0 if the path is wrong 3 50 5 Example if procPathCheck target0 targetl module slave sc miscError 0x1002 0 3 50 6 Errors Error Code i Error Type Extra Value KERNEL PTR SC ERR SYSTEM FATAL Illegal path pointer to path 0 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 77 SC 3 System Ca
27. testet s re e EI Uie 3 19 5 MODULEKILL 4 4 se END UMEN e ELI EE LP UU 3 22 SC MODULENAMEGET cesset dass tests assess tee tasa aeter teras asse 4 4 sc moduleNameGet 3 24 SC MODULEPRIOGET e etra 4 4 sc moduleProGet n RH UERBO ERG E a eee 3 25 SC_MSGACQUIRE ERR 4 3 SG MMS PA CQUMC ete DEED re REO 3 26 SC MSGADDRQGET ense nnns esee teda sss estis dass esse 4 3 aru niC REC HC 3 28 SC MSGALLOC eei 4 3 rcd HM 3 29 rudes ll ER 3 32 SC NISI 6 UC H 4 3 SC MS PEIEE aeea 3 33 sc mspllookRegIster 3 35 5 MERE 4 3 56 9 3 37 SC MSGPOOLIDGET gases essetis se neta 4 3 s msgPoolldGet eei ee eese sese E EE ads Men Eee eee 3 38 v
28. 4 arp t NEARPTR to support SCIOPTA 16 Bit systems e Allipv4 route t changed to ipv4 route t NEARPTR to support SCIOPTA 16 Bit systems AR support added in the kernel e Web server modifiied TFTP server added in addition to client e DHCP server added in addition to client e DRUID System Level Debugger added SCIOPTA Real Time Kernel 5 10 Manual Version 4 1 Reference Manual e 6 Index SCIOPTA a 6 Index A Activate a PROCESS TIS COR P AMAA 3 124 Add a Friend Module Higa ees aed ee ESPERE PARE eee 3 13 Add a Time Out Request etae ROS IEEE E hesterno due rust da 3 120 Addressee of a Message eee etaim o eee asl IUe dese es 3 28 Allocate Message 3 29 Allocate a Message and Clear Content 2 entente nennen 3 32 Allocate a Message with Time Out treten tentent nete 3 29 Allocate Joco deae eR erp eon eddie iid En e Gates 3 29 Wenn E 1 3 ii 1 3 1 3 EE 1 3 Calculate a 16 BItCRQ iae eee 3 4 Calculates an Additional CRC eeeesscessccessecsseesececeneecseceenecsceesseseneecseeeeseeeseeesseceseecuaeecsseeeeeenseeesseeeeneeeeees 3 5 Call Kernel qu pc DEM 3 115 Call the Error Hook with a User Error ne
29. em 3 23 6 Errors Error Code i Error Type Extra Value KERNEL EOUT OF MEMORY i SC ERR MODULE FATAL Request for number of bytes could not be fulfilled Requested size KERNEL ELOCKED ERR MODULE FATAL Process would swap but interrupts and or scheduler are is locked KERNEL POOL ID SC ERR MODULE FATAL Pool index is not available Pool index KERNEL EILL BUFSIZE ERR MODULE FATAL Illegal message size was requested Requested size KERNEL EILL DEFPOOL ID SC ERR PROCESS WARNING Illegal default pool index This is a warning and will continue with pool 0 upon return from error hook Pool index KERNEL EILL MODULE SC ERR SYSTEM FATAL Illegal module CB pointer possible corruption of module table Pointer to module CB KERNEL EPROC NOT PRIO SC ERR MODULE FATAL Illegal process type Process type KERNEL EILL VALUE i SC ERR MODULE FATAL tmo flag with wrong value Likely system is corrupt tmo flag SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 31 SC 3 System Calls Reference 3 24 sc msgAllocCIr 3 24 4 Description This system call works exactly the same as sc msgAlloc but it will initialize the data area of the message to 3 24 2 Syntax Sc msg t sc msgAllocClr sc bufsize t size sc msgid t id sc poolid t plidx sc_ticks_t tmo 3 24 3 Parameter Parameter values the same as in chapter 3 23 msgAlloc on page 3 29 3 24 4 Return Value
30. SCIOPTA e High Performance Real Time Operating Systems Real Time Kernel Reference Manual Copyright Copyright C 2010 by SCIOPTA Systems AG rights reserved No part of this publication may be re produced transmitted stored in a retrieval system or translated into any language or computer language in any form or by any means electronic mechanical optical chemical or otherwise without the prior writ ten permission of SCIOPTA Systems AG The Software described in this document is licensed under a soft ware license agreement and maybe used only in accordance with the terms of this agreement Disclaimer SCIOPTA Systems AG makes no representations or warranties with respect to the contents hereof and spe cifically disclaims any implied warranties of merchantability of fitness for any particular purpose Further SCIOPTA Systems AG reserves the right to revise this publication and to make changes from time to time in the contents hereof without obligation to SCIOPTA Systems AG to notify any person of such revision or changes Trademark SCIOPTA is a registered trademark of SCIOPTA Systems AG Headquarters SCIOPTA Systems AG Fiechthagstrasse 19 4103 Bottmingen Switzerland Tel 41 61 423 10 62 Fax 41 61 423 10 63 email sales sciopta com WWW sciopta com Document 506354611 Table of Contents Table of Contents 1 1 1 1 1 1 1 1 2 1 1 3 1 2 1 3 1 3 1 1 3 2 2 2 1 2 2 2
31. H 3 83 3 54 procPrioGet etie tulit e IR E REPE iere eie ce bas ce rete erbe eee 3 85 3 54 1 edge 3 85 3 54 2 Munro EE 3 85 3 54 3 Parameter RRRRRRRRRRRRRRRRRRRRRRREMEEEMMEEMMEMMMMMEMEMMMMMMMMMMMMMMM 3 85 3 54 4 ionmoRZ cM UU 3 85 3 54 5 lacune 3 85 3 54 6 luus MA EN 3 86 3 55 SC DIOC PMO Cl 3 87 3 55 1 Description etse itte rere hU eiie aste ec hein be net pena oid dye 3 87 3 55 2 unc D E 3 87 3 55 3 Parameter E ERE vague 3 87 3 55 4 ESRB CREME 3 87 3 55 5 Example 4 ote sires meon p eoo eee tiene us ie aac pres ERREUR Rede itae 3 87 3 55 6 is M 3 88 3 56 se procSchedLock ette tere irte eA Eee eee A 3 89 3 56 1 b gespuoi M 3 89 3 56 2 3 89 3 56 3 LP 3 89 3 56 4 r 3 89 3 56 5 3 89 3 56 6
32. bietet 3 52 SC POOLEHOOKREGISTER 4 3 9 elasecullsee D 3 53 SC POOLIDGE D Nec 4 3 s deese Pittura c hee 3 55 Neqae olio 4 3 3 56 4 3 deos mem 3 60 6 019 4 10 MEE 4 3 SG E E 3 61 duis ILI EE 3 68 3 82 3 98 SCL PLOCIACMONRE BISUER e 3 62 sc procDaemonUhregister riae nec cete eee tie beac caves eek itte tee oai th Abas Oi pete Sots 3 63 SC tates asse 4 4 sc procHookRegister GERI et agian Ne ERE DRE ae 3 64 PROC TD GE T 4 3 56 procldGEt m EUER 3 66 procIdGet in Interrupt Processes sccsscssesssssssssscsusesevsonsceestessosesssvogeneescusstesessesousesessusesevses aene serie 3 67 SC uuere qn p 4 4 SC Prock M
33. Current module ID module ID of the caller Module kill flags 0 SC MODULEKILL KILL 3 18 4 Return Value None 3 18 5 Example sc moduleid t mid A cleaning up will be executed No cleaning up will be done sc moduleInfo t usr info int check mid sc moduleIdGet 3 22 user 01 sc moduleKill mid 0 SCIOPTA Real Time Kernel Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA 3 18 5 1 Errors Error Code i Error Type Extra Value KERNEL ENO KERNELD ERR PROCESS FATAL There is no kernel daemon defined in the system KERNEL EILL MODULE SC ERR SYSTEM FATAL Module to be killed is the system module mid MID is not valid mid gt SC MAX MODULE MID is not valid mcb SC_NIL KERNEL EUNLOCK WO LOCK SC ERR MODULE FATAL Tried to unlock not locked scheduler SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 23 SC 3 System Calls Reference 3 19 sc moduleNameGet 3 19 1 Description This system call is used to get the name of a module The name will be returned as a terminated string 3 19 2 Syntax const char sc moduleNameGet sc moduleid t mid 3 19 3 Parameter mid Module ID mid Module ID SC CURRENT MID Current module ID module ID of the caller 3 19 4 Return Value Name string of the module if the module was found 0 if the module was not
34. The caller can only set the trigger value of its own trigger 3 83 2 Syntax void sc triggerValueSet sc triggerval t value 3 83 3 Parameter value Trigger value The new trigger value to be stored 3 83 4 Return Value None 3 83 5 Example sc triggerValueSet 1 sc triggerWait 1 SC ENDLESS TMO 3 83 6 Errors Error Code i Error Type Extra Value KERNEL EILL VALUE SC PROCESS FATAL Illegal trigger value Trigger value SCIOPTA Real Time Kernel 3 126 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em 3 84 sc triggerWait 3 84 1 Description This system call is used to wait on the process trigger The sc triggerWait call will wait on the trigger of the callers process The trigger value will be decremented by the value dec of the parameters If the trigger value becomes negative or equal zero the calling process will be suspended and swapped out The process will become ready again if the trigger value becomes positive This occurs if another process has activated the trigger a sufficient number of times or with a sufficient trigger value The caller can also specify a timeout value tmo The caller will not wait longer than the specified time for the trig ger If the timeout expires the process will be swapped in again The activation time is saved for sc triggerWait in prioritized processes The activation time is the absolute time tick cou
35. e Chapter 4 10 4 Error Hook Declaration Syntax Parameter user user User error System call sc procRegisterDaemon changed to sc DaemonRegister and sc procUnregisterDaemon changed to sc procDaemonUnregister System call sc miscErrorHookRegister return values better specified System call sc moduleCreate parameter size value code added in Formula e System call moduleNameGet return value NULL added System call sc msgAcquire condition modified System Call sc msgAlloc SC DEFAULT POOL better specified e Systme Call sc msgHookRegister description modified and return value better specified System call sc msgRx parameters better specified System call sc poolHookRegister return value better specified System call sc procHookRegister return value better specified System call sc procIdGet last paragraph in Description added e System calls sc procVarDel sc procVarGet and procVarSet return value 0 introduced Chapter 7 3 Function Codes errors 0x38 to 0x3d added System call sc procUnobserve added e Chapters 2 5 2 System Module and 4 3 Modules the following sentence was removed The system module runs always on supervisor level and has all access rights e Chapter 2 5 3 Messages and Modules third paragraph rewritten e Chapter 6 31 sc msgTx fifth paragraph rewritten SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 5 7 SCIOPTA 5 Manual Versions 5 9 7 Manua
36. sc tmoid t sc tmoAdd sc ticks t tmo sc msgptr t msgptr 3 79 3 Parameter tmo Timeout Number of system tick after which the message will be sent back by the kernel msgptr Timeout message Pointer to the message pointer of the message which will be sent back by the kernel after the elapsed time 3 79 4 Return Value Timeout ID 3 79 5 Example sc tmoid t tmoid msg sco msgAlloc sizeof ctrl poll t TCS POLL 0 SC FATAL IF tmoid sc tmoAdd sc ticks tickMs2Tick 1000 amp msg SCIOPTA Real Time Kernel 3 120 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 79 6 Errors Error Code i Error Type Extra Value KERNEL EILL PROCTYPE SC ERR PROCESS FATAL Caller is not a prioritized process Process type KERNEL EILL VALUE 5 ERR PROCESS FATAL Illegal timeout value Time out value KERNEL 5 ERR PROCESS FATAL Either pointer to message or pointer to message pointer are Zero KERNEL ENOT OWNER SC ERR MODULE FATAL Process does not own the message Process ID of owner SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 121 SC 3 System Calls Reference 3 80 sc tmoRm 3 80 1 Description This system call is used to remove a timeout before it is expired If the process has already received the timeout message and the user still tries to cancel the timeout with the sc tmoRm call the kernel will generate a f
37. 16 Pool index MODULE MAXPOOLS SCIOPTA Real Time Kernel 3 52 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em 3 37 poolHookhRegister 3 37 1 Description This system call will register a pool create or pool kill hook There can be one pool create and one pool kill hook per module If sc poolHookRegister is called from within a module a module pool hook will be registered A global pool hook will be registered when sc poolHookRegister is called from the start hook function which is called before SCIOPTA is initialized Each time a pool is created or killed depending on the setting of parameter type the pool hook of the caller will be called if such a hook exists 3 37 2 Syntax Sc poolHook t sc poolHookRegister int type SC poolHook t newhook 3 37 3 Parameter type Defines the type of registered CONNECTOR SC SET POOLCREATE HOOK Registers a pool create hook Every time a pool is created this hook will be called SC SET POOLKILL HOOK Registers a pool kill hook Every time a pool is killed this hook will be called newhook Pool hook function pointer lt funcptr gt Function pointer to the hook NULL The pool hook will be removed and unregistered 3 37 4 Return Value Function pointer to the previous pool hook if the pool hook was registered NULL if no pool hook was registered 3 37 5 Example sc_poolHook_t oldPoolHook oldPoolHook sc_poolHookReg
38. 3 45 3 Parameter path Pointer to the path with the name of the process path process name Process resides within the caller s module path z process name Process resides in the system module of the caller s target path z system name process name Process resides in the system module of an exter nal target path z module name process name Process resides in another than the system module of the caller s target path z system name module gt name If the process resides in another than the system module of an external target tmo Time to wait for a response in ticks This parameter is not allowed if asynchronous timeout is disabled at system con figuration SCONF SC NO TMO No timeout returns immediately 0 tmo SC TMO MAX Timeout value in system ticks 3 45 4 Return Value Process ID of the found process if the process was found within the tmo time period Current process ID process ID of the caller if parameter path is NULL and parameter tmo is SC NO TMO SC ILLEGAL PID if process was not found within the tmo time period SCIOPTA Real Time Kernel 3 66 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 45 5 sc procldGet in Interrupt Processes The sc procIdGet system call can also be used in an interrupt process The process daemon sends a reply message to the interrupt process interrupt process src parameter 1
39. 3 60 1 b eui 3 60 2 Muri M 3 60 3 ParaMeter cccscccccccsssscccecesesscececesesseaeecesessnececesessaecececessnaeeeecesenscaeececesseaeececsessueaeess 3 60 4 Value 3 60 5 3 60 6 E ete an RR 3 61 SC PLO SLOP rimerr aiene naenin chess 3 61 1 Descriptions a eS ces ERE EHE AE i 3 61 2 DD VIMAR M 3 61 3 Parameter 3 61 4 Return 3 61 5 3 61 6 3 62 SC proc TimC reate CET 3 62 1 Ib eap E 3 62 2 usque EA RERO WEBER 3 62 3 ParamMeter cccccccccecsssscccecesssseececesesseacecesessnececesensnecececessnseeeecesesuaeececessaaeeeecsessaeaeess 3 62 4 Ret rn Valie eene tee MEO Feet gere ie vete Ebenso 3 62 5 BX AMP cl 3 62 6 eee RR RR ERHEBEN ER IMRT RT eS 3 63 Se PrOCUNODSETVE P ii 3 63 1 Description isede ee pP as E EAE Renn eds 3 63 2 P M 3 63 3 Parameter MC aden 3 63 4 Return Value cc
40. The reply message is defined as follows 1 SC PROCIDGETMSG REPLY SC_MSG_BASE 0x10d typedef struct sc procIdGetMsgReply s sc msgid t id Sc pid t pid Sc errorcode t error int more sc procIdGetMsgReply t 3 45 6 Example SC pid t slave pig slave pid procIdGet slave SC NO 3 45 7 Errors Error Code i Error Type Extra Value KERNEL EILL PROC 5 ERR PROCESS FATAL Illegal path Pointer to path SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 67 SC 3 System Calls Reference 3 46 sc procintCreate 3 46 1 Description This system call is used to request the kernel daemon to create an interrupt process The standard kernel daemon sc kerneld needs to be defined and started at system configuration The interrupt process will be of type Sciopta Interrupt processes of type Sciopta are handled by the kernel and may use not blocking system calls The process will be created within the callers module The maximum number of processes for a specific module is defined at module creation 3 46 2 Syntax SC pid t sc procIntCreate const char name void entry int sc bufsize t stacksize int vector Sc prio t prio int state sc poolid t plid 3 46 3 Parameter name Pointer to process name The name is represented by a ASCII character string terminated be 0 The string can have up to 31 characters Recommen
41. e Architecture CPU Family Description arch cpu coldfire mcf521x Freescale Coldfire MCF521x V2 MCF5213 and all other derivatives of the Freescale ColdFire MCF521x family mcf523x Freescale Coldfire MCF523x V2 MCF5235 and all other derivatives of the Freescale ColdFire MCF523x family mcf525x Freescale Coldfire MCF525x V2 MCF5253 and all other derivatives of the Freescale ColdFire MCF525x family mcf532x Freescale Coldfire MCF532x V3 MCF5329 and all other derivatives of the Freescale ColdFire MCF532x family mcf548x Freescale Coldfire MCF548x V4e 5485 and all other derivatives of the Freescale ColdFire MCF548x family mcf5223 Freescale Coldfire MCF5223x V2 MCFS52233 and all other derivatives of the Freescale ColdFire MCF5223x family mcf5272 Freescale Coldfire MCF527x V2 5272 and all other derivatives of the Freescale ColdFire MCF527x family mcf5282 Freescale Coldfire MCF528x V2 5282 and all other derivatives of the Freescale ColdFire MCF528x family mcf54455 Freescale Coldfire MCF54455x V4 54455 and all other derivatives of the Freescale ColdFire MCF54455x family win32 For Windows based PCs and workstations SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 1 5 SCIOPTA lt gt 1 6 1 SCIOPTA System SCIOPTA Real Time Kernel Manual Version 4 1 Reference Manual 2 System Calls Overview 5 em 2 Syste
42. it will not be possible to return from an error hook If there are no error hooks present the kernel will enter an infinite loop When the error hook is called from the kernel all information about the error are transferred in 32 bit error word parameter Please consult the SCIOPTA Kernel User s Manual for detailed information about the SCIOPTA error handling When the error hook is called from the kernel all information about the error are transferred in 32 bit error word parameter There is also an additional 32 bit extra error word available to the user Function Code Error Code Error Type La 8 Bits NE 12 Bits 4 12 Bits d 32 Bits Figure 4 1 32 bit Error Word The Function Code defines from what SCIOPTA system call the error was initiated The Error Code contains the specific error information and the Error Type informs about the severeness of the error SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 4 1 SCIOPTA 4 Kernel Error Codes 4 2 Include Files The error codes are defined in the err h include file File location lt install_folder gt sciopta lt version gt include kernel The error descriptions are defined in the errtxt h include file File location lt install_folder gt sciopta lt version gt include ossys SCIOPTA Real Time Kernel 4 2 Manual Version 4 1 Reference Manual 4 Kernel Error Codes SCIOPTA e 4 3 Function Codes
43. lt 8000 dev ips devGetByName ethO NULL SC sleep sc tickMs2Tick tmo tmo 2 3 77 6 Errors None SCIOPTA Real Time Kernel 3 118 Manual Version 4 1 Reference Manual 3 System Calls Reference 3 78 sc tickTick2Ms 3 78 1 Description This system call is used to convert a time from system ticks into milliseconds The calculation is based on tick length and limited to 32 bit 3 78 2 Syntax 132 sc tickTick2Ms ticks t t 3 78 3 Parameter t Time in system ticks 5 em 3 78 4 Return Value Time in milliseconds 3 78 5 Example tO sc tickGet for ent 0 cnt lt 1000000 cnt sc procYield tl sc tickGet t2 tickTick2Ms t1 t0 3 78 6 Errors None SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 119 SC 3 System Calls Reference 3 79 sc tmoAdd 3 79 1 Description This system call is used to request a timeout message from the kernel after a defined time The caller needs to allocate a message and include the pointer to this message in the call The kernel will send this message back to the caller after the time has expired This is an asynchronous call the caller will not be blocked The registered timeout can be cancelled by the sc tmoRm call before the timeout has expired This system call returns the timeout ID which could be used later to cancel the timeout 3 79 2 Syntax
44. msgOwnerGet on page 3 37 Returns the pool ID of a message Chapter 3 28 msgPoolIdGet on page 3 38 Returns the size of the message buffer Chapter 3 30 msgSizeGet on page 3 42 Modifies the size of a message buffer Chapter 3 31 msgSizeSet on page 3 43 Returns the process ID of the sender of the message Chapter 3 32 msgSndGet on page 3 45 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 2 1 2 System Calls Overview wu SCIOPTA em 2 3 Process System Calls sc procPrioCreate procIntCreate procTimCreate sc procDaemonRegister sc procDaemonUnregister sc procHookRegister procIdGet procKill sc procNameGet procObserve sc procPathCheck procPathGet sc procPpidGet sc procPrioGet procPrioSet procSchedLock sc procSchedUnlock procSliceGet procSliceSet 2 2 Requests the kernel daemon to create a prioritized process Chapter 3 53 procPrioCreate page 3 82 Requests the kernel daemon to create a interrupt process Chapter 3 46 procIntCreate page 3 68 Requests the kernel daemon to create a timer process Chapter 3 62 procTimCreate on page 3 98 Registers a process daemon which is responsible for pidGet request Chapter 3 42 procDaemonRegister on page 3 62 Unregisters a process daemon Chapter 3 43 procDaemonUnreg
45. procTimCreate and 6 62 sc procUsrIntCreate information about sc kerneld are given Chapter 4 10 5 Example added 5 9 5 Manual Version 1 3 Chapter 6 26 sc msgPoolIdGet return value SC DEFAULT POOL defined SCIOPTA Real Time Kernel 5 6 Manual Version 4 1 Reference Manual 5 Manual Versions SC IOPTA d e Chapter 6 33 sc poolCreate pool size formula added e Chapter 2 4 4 Message Pool maximum number of pools for compact kernel added Chapter 4 8 SCIOPTA Memory Manager Message Pools added e Chapter 6 9 sc moduleCreate modul size calculation modified e Chapter 6 40 sc procCreate 6 45 sc procIntCreate 6 51 sc procPrioCreate 6 60 sc procTim Create stacksize calculation modified 5 9 6 Manual Version 1 2 cover back side Address of SCIOPTA France added e Chapter 2 6 Trigger second paragraph At process creation the value of the trigger is initialized to one e Chapter 2 6 Trigger third paragraph sc triggerWait call decrements the value of the trigger and the calling process will be blocked and swapped out if the value gets negative or equal zero e Chapter 2 7 Process Variables second paragraph The tag and the process variable have a fixed size large enough to hold a pointer e Chapter 2 7 Process Variables third paragraph Last sentence rewritten e Chapter 4 5 3 1 Interrupt Process Declaration Syntax src is of type int added e Chapter 4 5 6 Idle Process added
46. void sc procKill sc pid t pid flags t flag 3 47 3 Parameter pid Process ID pid Process ID of the process to be killed SC CURRENT PID Current running caller process flag Process kill flag 0 A cleaning up will be executed SC PROCKILL KILL No cleaning up will be requested 3 47 4 Return Value None 3 47 5 Example sc procKill SC CURRENT PID 0 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 71 3 System Calls Reference 2 1 SCIOPTA em 3 47 6 Errors Error Code i Error Type Extra Value KERNEL ENO KERNELD i SC ERR SYSTEM FATAL There is no kernel daemon defined in the system KERNEL EILL ERR MODULE FATAL pid pid SC ILLEGAL PID mid too large process index too large Process ID SCIOPTA Real Time Kernel 3 72 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em 3 48 sc procNameGet 3 48 1 Description This call is used to get the full name of a process The name will be returned inside a SCIOPTA message buffer which is allocated by the kernel The kernel sets the caller as owner of the message The user must free the message after use If the process pid does not exist or does not exist any more and the pid has a valid value between min and max the kernel calls the error hook if it exists and generates a warning After returning from the error hook the system call sc procNameGet returns zero
47. 2 System Calls Overview Sc procStart procStop sc procUnobserve sc procVarDel sc procVarGet sc_procVarInit sc procVarRm sc procVarSet sc procVectorGet sc procWakeupEnable procWakeupDisable procYield 5 em Starts a process Chapter 3 60 procStart on page 3 94 Stops a process Chapter 3 61 procStop on page 3 96 Cancels the observation of a process Chapter 3 63 procUnobserve on page 3 101 Deletes a process variable Chapter 3 64 procVarDel on page 3 103 Returns a process variable Chapter 3 65 procVarGet on page 3 104 Initializes a process variable area Chapter 3 66 sc procVarlInit on page 3 105 Removes a process variable area Chapter 3 67 procVarRm on page 3 107 Sets a process variable Chapter 3 68 procVarSet on page 3 108 Returns the interrupt vector of an interrupt process Chapter 3 69 proc VectorGet on page 3 109 Enabes the wakeup of a timer or interrupt process Chapter 3 70 procWakeupEnable on page 3 110 Disables the wakeup of a timer or interrupt process Chapter 3 71 procWakeupDisable on page 3 111 Yields the CPU to the next ready process within the current process s priority group Chapter 3 72 procYield on page 3 112 2 4 Module System Calls sc moduleCreate sc moduleIdGet sc moduleI
48. 22 sc msgAddrGet 3 22 4 Description This system call is used to get the process ID of the addressee of a message The kernel will examine the message buffer to determine the process to which the message was originally trans mitted This system call is mainly used in communication software of distributed multi CPU systems using connector processes It allows to store the original addressee when you are forwarding a message by using the sc msgTxAlias system call 3 22 2 Syntax Sc pid t sc msgAddrGet sc msgptr t msgptr 3 22 3 Parameter msgptr Pointer to message pointer 3 22 4 Return Value Process ID of the addressee of the message 3 22 5 Example Get original addressee of a message sc msg t msg Sc pid t addr msg sc msgRx SC ENDLESS TMO SC MSGRX ALL SC MSGRX MSGID addr msgAddrGet amp msg 3 22 6 Errors Error Code i Error Type Extra Value KERNEL PTR SC ERR MODULE FATAL Either pointer to message o pointer to message pointer are zero Pointer ot message or NIL SCIOPTA Real Time Kernel 3 28 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em 3 23 sc msgAlloc 3 23 1 Description This system call will allocate a memory buffer of selectable size from a message pool SCIOPTA supports ownership of messages The new allocated buffer is owned by the caller process The owner of the message will change to the receiver pr
49. 3 31 sc msgSizeSet 3 31 1 Description This system call is used to decrease the requested size of a message buffer The originally requested message buffer size is smaller or equal than the SCIOPTA internal used fixed buffer size If the need of message data decreases with time it is sometimes favourable to decrease the requested message buffer size as well Some internal operation are working on the requested buffer size The fixed buffer size for the message will not be modified The system does not support increasing the buffer size 3 31 2 Syntax Sc bufsize t sc msgSizeSet sc msgptr t msgptr sc bufsize t newsz 3 31 3 Parameter msgptr Pointer to message pointer newsz New requested size of the message buffer 3 31 4 Return Value New requested buffer size if call without error condition Old requested buffer size if it was a wrong request such as requesting a higher buffer size as the old one 3 31 5 Example Change size of a message msg t msg msg sc msgRx SC ENDLESS TMO SC MSGRX ALL SC MSGRX MSGID do something sc msgSizeSet amp msg sizeof reply msg t reduce size before returning sc msgTx amp msg sc msgSndGet amp msg 0 return to sender ACK SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 43 SC 3 System Calls Reference 3 31 6 Errors Error Code i Error Type Extra Value KERNEL PTR S
50. 3 33 1 Description This system call is used to transmit a SCIOPTA message to a process the addressee process Each SCIOPTA process has one message queue for messages which have been sent to the process The sc msgTx system call will enter the message at the end of the receivers message queue The caller cannot access the message buffer any longer as it is not any more the owner The receiving process will become the owner of the message NULL is loaded into the caller s message pointer msgptr to avoid unintentional message access by the caller after transmitting The receiving process will be swapped in if it has a higher priority than the sending process If the addressee of the message resides not in the callers module and this module is not registered as a friend module the message will be copied before the transmit call will be executed Messages which are transmitted across mod ules boundaries are always copied except if the modules are friends To copy such a message the kernel will al locate a buffer from the pool of the module where the receiving process resides big enough to fit the message and copy the whole message Message buffer copying depends on the friendship settings of the module where the buffer was originally allocated If the receiving process is not within the same target CPU as the caller the message will be sent to the connector process where the distributed receiving process is registered 3 33 2 Syntax void
51. 3 41 3 Parameter plid ID of the pool to reset 3 41 4 Return Value None 3 41 5 Example Sc poolid t pl pl sc poolIGGet my pool sc poolReset pl 3 41 6 Errors Error Code i Error Type Extra Value KERNEL EPOOL IN USE SC ERR MODULE FATAL Pool is in use and no reset can be performed Pool cb KERNEL EILL POOL ID SC ERR MODULE FATAL Illegal pool ID Pool ID SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 61 SC 3 System Calls Reference 3 42 sc procDaemonRegister 3 42 1 Description This system call is used to register a process daemon The process daemon manages process names in a SCIOPTA system If a process calls sc procIdGet the kernel will send a sc procIdGet message to the process daemon The process daemon will search the process name list and return the corresponding process ID to the kernel if found There can only be one process daemon per SCIOPTA system The standard process daemon procd is included in the SCIOPTA kernel This process daemon needs to be de fined and started at system configuration as a static process 3 42 2 Syntax int procRegisterDaemon void 3 42 3 Parameter None 3 42 4 Return Value if the process daemon was successfully installed 1 0 if the process daemon could not be installed 3 42 5 Errors None SCIOPTA Real Time Kernel 3 62 Manual Version 4 1 Reference Manual 3 System Calls Reference SC
52. Atmel 915 75 915 75 AT91SAM7X AT91SAM7A3 and all other derivatives of the Atmel AT91SAM7 family at91sam9 Atmel AT91SAM9 ARM9 Atmel AT91SAM9260 915 9261 915 9263 and all other de rivatives of the Atmel 915 family 1 21 NXP LPC21xx 22xx ARM7 NXP LPC21xx and NXP LPC22xx and all other derivatives of the NXP LPC21xx 22xx family 24 23 NXP LPC23xx 24xx ARM7 NXP LPC21xx and NXP LPC22xx and all other derivatives of the NXP LPC21xx 22xx family str7 STMicroelectronics STR710 ARM7 STMicroelectronics STR71x and all other derivatives of the STMicroelec tronics STR710 family str9 STMicroelectronics STR910 ARM9 STMicroelectronics STR91x and all other derivatives of the STMicroelec tronics STR910 family stm32 STMicroelectronics STM32 ARM Cortex M3 All derivatives of the STMicroelectronics STM32 family SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 1 3 1 SCIOPTA System a gt SCIOPTA lt gt Architecture CPU Family lt arch gt lt cpu gt Description arm imx27 imx35 stellaris tms570 stm32 pxa270 pxa320 ppc mpx5xx mpc5500 mpc8xx mpc82xx mpc83xx mpc52xx ppc4xx 1 4 Freescale i MX2x ARM9 Freescale 1 21 1 MX23 1 MX25 i MX27 and all other derivatives of the Freescale i MX2x family Freescale i MX3x ARM1136JF Freescale 1 1 MX35 1 MX37 and all other derivatives of
53. Calls PROCESS WICKS onte ote ROS Eden VI e E a erii Read a Process Variable ceteri e R cetye MeSSaPe eite te totes tete iut Receive a Message with Time Out 000 Register a CONNECTOR Process Register a Message Register a Pool HOOK eese ener nennen enne enne ene Register a Process Register a Process Register an Error Hook Remove a CONNECTOR Process Remove a Module from Friends Remove a Process Variable sess Remove a Time Out Request Remove a Whole Process Variable Area Reset a Message eerte tee ette rire ER Ebert Retuma M S SC CONNECTORREGISTER SC_COMNNECTOFRE 1S ER SC CONNECTORUNREGISTER eere sc connectorUnregister SC DEFAULT POOL SC DISPATCHER oder hag seek eben eee ete SC ENDLESS nensis SC ERR MODULE FATAL SC ERR MODULE ener nennen SC ERR PROC WARNING nennen nin SC ERR PROCESS FATAL ener nennen nennen enne SC ERR TARGET FATAL SC TARGET W
54. Frees cale i MX3x family Texas Instrument Stellaris ARM Cortex M3 derivatives of the Texas Instrument Stellaris family Texas Instrument TMS570 ARM Cortex 4 derivatives of the Texas Instrument TMS570 family STMicroelectronics STM32 ARM Cortex M3 derivatives of the STMicroelectronics STM32 family Marvell PXA270 XScale derivatives of the Marvell PXA270 family Marvell PXA320 XScale derivatives of the Marvell PXA320 family Freescale PowerPC MPC500 MPC53x MPC55x MPC56x and all other derivatives of the Freescale 500 family Freescale PowerPC MPC55xx MPC5516 MPC5534 MPC5554 MPC5567 and all other derivatives of the Freescale MPC55xx family Freescale PowerPC PowerQUICC I MPC823 MPC850 MPC852T MPC855T MPC857 MPC859 MPC860 MPC862 MPC866 and all other derivatives of the Freescale MPC8xx fam ily Freescale PowerPC PowerQUICC II MPC8250 MPC8255 MPC8260 MPC8264 MPC8265 MPC8266 and all other derivatives of the Freescale MPC82xx family Freescale PowerPC PowerQUICC II Pro MPC8313 MPC8314 MPC8315 and all other derivatives of the Freescale MPC83xx family Freescale PowerPC MPC5200 MobileGT MPC5200 and all other derivatives of the Freescale MPC52xx and 51xx family AMCC PowerPC 4xx PowerPC 405 440 460 and all other derivatives of the AMCC PowerPC 4xx family SCIOPTA Real Time Kernel Manual Version 4 1 Reference Manual 1 SCIOPTA System SCIOPTA
55. IOPTA e 3 43 procDaemonUnregister 3 43 1 Description This call is used by a process daemon to unregister The name list of the daemon will be removed and messages still owned by the daemon will be freed A statically installed process daemon cannot be unregistered 3 43 2 Syntax void sc procUnregisterDaemon void 3 43 3 Parameter None 3 43 4 Return Value None 3 43 5 Errors None SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 63 SC 3 System Calls Reference 3 44 procHookRegister 3 44 1 Description This system call will register a process hook of the type defined in parameter type The type can be a create hook kill hook or swap hook Each time a process will be created the create hook will be called if there is one installed Each time a process will be killed the kill hook will be called if there is one installed Each time a process swap is initiated by the kernel the swap hook will be called if there is one installed 3 44 2 Syntax Sc procHook t sc procHookRegister int type SC procHook t newhook 3 44 3 Parameter type Type of process hook SC SET PROCCREATE HOOK Registers a process create hook Every time a process is created this hook will be called SC SET PROCKILL HOOK Registers a process kill hook Every time a process is killed this hook will be called SC SET PROCSWAP HOOK Registers a process swap hook Every time a process
56. Inter Module settings added 5 8 3 Manual Version 1 6 Configuration chapter added moved from the target manuals 5 8 4 Manual Version 1 5 Allunion sc msg changed to sc msg t to support SCIOPTA 16 Bit systems NEAR pointer All union sc msg changed to sc msgptr t to support SCIOPTA 16 Bit systems NEAR pointer Manual now splitted into a User s Guide and Reference Manual 5 8 5 Manual Version 1 4 e Chapter 4 7 3 2 Example OS INT PROCESS changed into correct SC INT PROCESS e Chapter 2 3 4 4 Init Process rewritten e Chapter 4 5 Processes former chapters 4 5 6 Idle Process 4 5 7 Supervisor Process removed e Chapter 4 5 1 Introduction last paragraph about supervisor processes added Chapter 4 5 5 Init Process rewritten SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 5 3 SCIOPTA 5 Manual Versions Chapter 6 8 sc_miscErrorHookRegister syntax corrected Chapter 6 21 sc_mscAlloc timeout parameter tmo better specified Chapter 6 27 sc_msgRx timeout parameter tmo better specified Chapter 4 10 4 Error Hook Declaration Syntax user 0 user error Chapter 4 9 SCIOPTA Daemons moved from chapter 2 9 and rewritten Chapter 6 41 sc_procDaemonRegister last paragraph of the description rewritten Chapters 6 45 sc_procIntCreate 6 46 sc_procKill 6 51 sc_procPrioCreate 6 60 sc_procTimCreate and 6 62 sc_procUsrIntCreate information about sc_kerneld are given Chapter 4 10 5 Exam
57. KERNEL_EOUTSIDE_POOL 0 008 Message outside pool KERNEL EMSG HD CORRUPT 0x009 Message header corrupted KERNEL ENIL PTR 0x00A NIL pointer KERNEL EENLARGE MSG 0 00 Message enlarged KERNEL ENOT OWNER Ox00C Notowner of the message KERNEL EOUT OF MEMORY 0 000 of memory KERNEL EILL VECTOR OxOOE Illegal interrupt vector KERNEL EILL SLICE OxOOF Illegal time slice KERNEL ENO KERNELD 0x010 gt kernel daemon started KERNEL EMSG CORRUPT 0x011 Message endmark corrupted KERNEL EMSG PREV CORRUPT 0x012 Previous message s endmark corrupted KERNEL EILL DEFPOOL ID 0x013 Illegal default pool ID KERNEL ELOCKED 0 014 Illegal system call while scheduler locked KERNEL EILL PROCTYPE 0 015 Illegal process type KERNEL EILL INTERRUPT 0 016 Illegal interrupt KERNEL EILL EXCEPTION 0 017 Illegal unhandled exception KERNEL EILL SYSCALL 0x018 Illegal syscall number KERNEL NESTING 0 019 Illegal interrupt nesting KERNEL EUNLOCK WO LOCK OxOIF Unlock without lock KERNEL 0x020 Illegal process ID KERNEL ENO MORE PROC 0x021 gt more processes KERNEL TOO SMALL 0x022 Module size too small KERNEL ESTART NOT STOPPED 0x023 Starting of a not stopped process KERNEL PROC 0 024 Illegal process KERNEL EILL 0x025 Illegal name KERNEL EILL TARGET NAME 0x025 Illegal target name KERNEL EILL MODULE NAME 0x025 Illegal module name KERNEL EILL MODU
58. PIENE 3 15 sc 3 15 1 tit 3 15 2 Muri 3 15 3 Parameter cccccccccecsssscecccesesssececesesesaeccesessaececesesssseeecesenseeeceseeaecceceaaeceeceessueaeess 3 15 4 V ALU tete Dec e 3 15 5 TEED OI t REED UELLE ELEM 3 16 eee EINE EE eR 3 16 1 Ib eap 3 16 2 Mur 3 16 3 Iu REEL LU LODS 3 16 4 Value UE Tes 3 16 5 316 2 e eter EE 3 17 Scmodulelnfo eoe ettooco 3 17 1 Description aae eee aue dne ui HO ORDRE Rides 3 17 2 uui 3 17 3 Parameter ert iie ten 3 17 4 3 17 5 Module Info Structure erret a acces ash oa ede S REEF RE SERES 3 17 6 Structure SIT Example usage une ote Ses ees 3 17 8 3 18 8
59. Possible pool id corruption Pointer to message header KERNEL EMSG ENDMARK CORRUPT SC ERR MODULE FATAL Message endmark is corrupt Pointer to message KERNEL EMSG PREV ENDMARK CORRUPT i SC ERR MODULE FATAL Endmark of previous message is corrupt Pointer to previous message SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 47 SC 3 System Calls Reference 3 34 sc msgTxAlias 3 34 14 Description This system call is used to transmit a SCIOPTA message to a process by setting a process ID as sender The usual sc msgTx system call sets always the calling process as sender If you need to set another process ID as sender you can use this sc msgTxAlias call This call is mainly used in communication software such as SCIOPTA connector processes where processes on other CPU s are addressed CONNECTOR processes will use this system call to enter the original sender of the other CPU Otherwise sc msgTxAlias works the same way as sc msgTx 3 34 2 Syntax void sc msgTxAlias sc msgptr t msgptr Sc pid t addr flags t flags pid t alias 3 34 3 Parameter msgptr Pointer to message pointer addr The process ID of the addressee pid Valid SCIOPTA PID SC CURRENT PID The caller himself flags Pointer to message pointer 0 Normal sending SC MSGTX RTN2SNDR Return message if addressee does not exist or if there is no memory to copy it into the addressee s module alias The proc
60. Return values are the same as in chapter 3 23 msgAlloc on page 3 29 3 24 5 Example Allocate TEST MSG from default pool and clear its content sc msg t msg msg sc msgAllocClr sizeof test msg t size TEST MSG message id SC DEFAULT POOL pool index SC FATAL IF TMO timeout 3 24 6 Error same as in chapter 3 23 6 Errors on page 3 31 SCIOPTA Real Time Kernel 3 32 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em 3 25 sc msgFree 3 25 1 Description This system call is used to return a message to the message pool if the message is no longer needed Message buff ers which have been returned can be used by other processes Only the owner of a message is allowed to free it by calling sc msgFree It is a fatal error to free a message owned by another process If you have for example transmitted a message to another process it is the responsibility of the receiving process to free the message Another process actually waiting to allocate a message of a full pool will become ready and therefore the caller process pre empted on condition that 1 thereturned message buffer of the caller process has the same fixed size as the one of the waiting process and 2 the priority of the waiting process is higher than the priority of the caller and 3 the waiting process waits on the same pool as the caller will return the message 3 25 2 Syntax
61. SC 4 4 SCSDfOC V ASEE 3 108 56 M 3 109 SC PROCWAKEUPDISABLLE 1 4 3 procWakeupbDisabl terere at HER P D ten ice nce A aie 3 111 SC PROCWAKEUPENABLE nenne tnn nnne 4 3 procWakeupEnable his A ee IEEE 3 110 SCoPROGCYIBDD T ette 4 4 s procYield bead 3 112 3 129 3 130 SC SET MSGRX cccccccccccsssssceccecesnsaeececeessaececceensaeeeceecseeseceecsesueececesesaeeeeeceseaaeeeeceseaeaeeeeees 3 35 SC SET MSGTX HOOK nugae e EE HRS eee 3 35 SC SET POOLCREATE ne enne 3 53 POOLKIEL HOONK incite 3 53 SC SET PROCCREATE 3 64 5 5 PROCKILL eure A ere Er S 3 64 SC SET PROCSWAP HOOK 3 64 SC SLEEP
62. SC MODULEFRIENDALL 0 4 moduleFriendAIl SC TRIGGERVALUESET 0 50 triggerValueSet SC TRIGGERVALUEGET 0x51 sc triggerValueGet SC TRIGGER 0x52 sc trigger SC TRIGGERWAIT 0x53 sc triggerWait SC TICK 0x57 tick SC TMOADD 0x58 sc tmoAdd SC TMO 0x59 Obsolete SC SLEEP Ox5A sc sleep SC TMORM OxSB tmoRm SC TICKGET Ox5C tickGet SCIOPTA Real Time Kernel 4 4 Manual Version 4 1 Reference Manual 4 Kernel Error Codes SCIOPTA e Name Number Error Source SC TICKLENGTH Ox5D sc tickLength SC TICKMS2TICK OxSE sc tickMs2Tick SC TICKTICK2MS Ox5F tickTick2Ms SC CONNECTORREGISTER 0x60 connectorRegister SC CONNECTORUNREGISTER 0x61 sc connectorUnregister SC DISPATCHER 0x62 Internal SC SC PRIVATEI 0x63 SC PROCREGISTERIRQCALLBACK 0x64 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 4 5 wu SCIOPTA em 4 Kernel Error Codes 4 4 Error Codes Name Number Description KERNEL EILL POOL ID 0 001 Illegal pool ID KERNEL ENO MOORE POOL 0x002 more pool KERNEL EILL POOL SIZE 0x003 Illegal pool size KERNEL EPOOL IN USE 0 004 Pool still in use KERNEL EILL NUM SIZES 0x005 Illegal number of buffer sizes KERNEL EILL BUF SIZES 0 006 buffersizes KERNEL EILL BUFSIZE 0x007 buffersize
63. Version 3 0 e Manual restructured and rewritten 5 6 Manual Version 2 1 e Chapter 2 4 Installation Procedure Windows Hosts now modified for customer specific deliveries e Chapter 2 4 5 SCIOPTA HOME Environment Variable UNIX Shell versions removed 5 7 Manual Version 2 0 The following manuals have been combinded in this new SCIOPTA ARM Kernel User s Guide e SCIOPTA Kernel User s Guide Version 1 8 SCIOPTA Kernel Reference Manual Version 1 7 SCIOPTA Real Time Kernel 5 2 Manual Version 4 1 Reference Manual 5 Manual Versions SC IOPTA d SCIOPTA ARM Target Manual 5 8 Former SCIOPTA Kernel User s Guide Versions 5 8 1 Manual Version 1 8 e Back front page Litronic AG became SCIOPTA Systems AG e Chapter 2 3 4 1 Prioritized Process icon now correct e Chapter 2 3 4 2 Interrupt Process last paragrpah added e Chapter 2 3 4 5 Supervisor Process rewritten Chapter 2 5 2 System Module rewritten Chapter 4 11 1 Start Sequence added e Chapter 4 11 3 C Startup rewritten Chapter 4 11 5 INIT Process added Chapter 4 11 6 Module Start Function added Chapter 4 7 2 6 Example in system call msg SC ENDLESS TMO replaced by SC DEFAULT POOL 5 8 2 Manual Version 1 7 e Chapter 3 9 1 Configuring ARM Target Systems Inter Module settings added e Chapter 3 9 2 Configuring Coldfire Target Systems Inter Module settings added e Chapter 3 9 3 Configuring PowerPC Target Systems
64. Version 4 1 3 37 SC 3 System Calls Reference 3 28 sc msgPoolldGet 3 28 1 Description This system call is used to get the pool ID of a message When you are allocating a message with sc msgAlloc you need to give the ID of a pool from where the message will be allocated During run time you sometimes need to this information from received messages 3 28 2 Systax Sc poolid t msgPoolIdGet sc msgptr t msgptr 3 28 3 Parameter msgptr Pointer to message pointer 3 28 4 Return Value Pool ID where the message resides if the message is in the same module than the caller SC DEFAULT POOL if the message is not in the same module than the caller 3 28 5 Example Retrieve the pool index of a message sc msg t msg sc poolid t idx msg msgRx SC ENDLESS SC MSGRX ALL SC MSGRX idx sc msgPoolIdGet amp msg 3 28 6 Errors Error Code i Error Type Extra Value KERNEL PTR SC ERR MODULE FATAL Either pointer to message or pointer to message pointer are Zero Pointer to message pointer SCIOPTA Real Time Kernel 3 38 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em 3 29 sc msgRx 3 29 1 Description This system call is used to receive messages The receive message queue of the caller will be searched for the de sired messages If a message matching the conditions is received the kernel will return to
65. end 3 85 1 Description This function ends a SCIOPTA WIN32 Kernel Simulator application The control is returned to the Windows operating system This system call is only available in the SCIOPTA WIN32 Kernel Simulator 3 85 2 Syntax void sciopta end void 3 85 3 Parameter None 3 85 4 Return Value None 3 85 5 Errors None SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 129 SC 3 System Calls Reference 3 86 sciopta start 3 86 1 Description This function starts a SCIOPTA WIN32 Kernel Simulator application It must be placed in the startup code of your Windows application This system call is only available in the SCIOPTA WIN32 Kernel Simulator 3 86 2 Syntax int sciopta start char cmdline sciopta t psciopta sc pcb t connectors sc pcb t pirq vectors sc module cb t modules void start hook void void TargetSetup void void sysPutchar int void idle hook void 3 86 3 Parameter cmdline Command line of the application This parameter is not used so far psciopta Pointer to the SCIOPTA kernel control block connectors Pointer to the connector PCB pointer array vectors Pointer to the interrupt PCB pointer array modules Pointer to the module CB pointer array start hook Function pointer to the start hook TargetSetup Function pointer to the target system setup function sysPutchar Functio
66. is used to kill a message pool A message pool can only be killed if all messages in the pool are freed returned The killed pool memory can be reused later by a new pool if the size of the new pool is not exceeding the size of the killed pool Every process inside a module can kill a pool 3 40 2 Syntax void sc poolKill sc poolid t plid 3 40 3 Parameter plid ID of the pool to be killed 3 40 4 Return Value None 3 40 5 Example sc poolid t pl pl sc poolIGGet my pool 1 111 pl 3 40 6 Errors Error Code i Error Type Extra Value KERNEL EPOOL IN USE SC ERR MODULE FATAL Pool is in use and cannot be killed Pool cb KERNEL EILL POOL ID SC ERR MODULE FATAL Illegal pool ID Pool ID KERNEL EILL MODULE i SC ERR MODULE FATAL Illegal module Module ID SCIOPTA Real Time Kernel 3 60 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 41 sc poolReset 3 41 1 Description This system call is used to reset a message pool in its original state messages in the pool must be freed and returned before a sc poolReset call can be used The structure of the pool will be re initialized The message buffers in free lists will be transformed back into un used memory This fresh memory can now be used by sc msgAlloc to allocate new messages Each process in a module can reset a pool 3 41 2 Syntax void poolReset sc poolid t plid
67. maintains a scheduler lock counter If the counter is 0 scheduling is activated Each time a process calls procSchedLock the counter will be incremented Interrupts are not blocked if the scheduler is blocked by procSchedLock 3 56 2 Syntax int sc procSchedLock void 3 56 3 Parameter None 3 56 4 Return Value Internal scheduler lock counter Number of times the scheduler has been locked 3 56 5 Example count instances sc procSchedLock counter Sc procSchedUnlock 3 56 6 Errors Error Code i Error Type Extra Value KERNEL EPROC NOT SC ERR MODULE FATAL Caller is not a prioritized process SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 89 SC 3 System Calls Reference 3 57 sc procSchedUnlock 3 57 1 Description This system call will unlock the scheduler SCIOPTA maintains a scheduler lock counter Each time a process calls sc procSchedUnlock the counter will be decremented If the counter reaches a value of 0 the SCIOPTA scheduler is called and activated The ready process with the highest priority will be swapped in It is illegal to unlock a not blocked scheduler 3 57 2 Syntax void procSchedUnlock void 3 57 3 Parameter None 3 57 4 Return Value None 3 57 5 Example count instances sc procSchedLock ttcounter sc procSchedUnlock 3 57 6 Errors Error Code i Error Type Extra Value KERNEL NOT P
68. of chapter System Design New chapter 4 6 Addressing Processes e Chapter 7 Kernel Error Codes new sequence of sub chapters Smaller font used Chapter 4 10 Error Hook completely rewritten New chapter 4 11 System Start 5 8 9 Manual Version 1 0 Initial version 5 9 Former SCIOPTA Kernel Reference Manual Versions 5 9 1 Manual Version 1 7 e Back front page Litronic AG became SCIOPTA Systems AG e Chapter 3 24 sc msgHookRegister text There can be one module message hook per module replaced by There can be one module message hook of each type transmitt receive per module e Chapter 3 27 sc msgRx flag parameter SC MSGRX text An array of messages is given which will be excluded from receive replaced by An array of message ID s is given which will be excluded from receive e Chapter 3 47 sc procNameGet and chapter 3 49 procPathGet chapter Return Value rewritten SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 5 5 SCIOPTA 5 Manual Versions 5 9 2 Manual Version 1 6 Chapter 3 27 msgRx tmo parameter SC NONE replaced by SC NO Parameter better spec ified Chapter 3 27 msgRx wanted parameter NULL replaced by SC MSGRX ALL Chapter 3 7 sc miscError err parameter bits 0 1 and 2 documented Chapter 3 44 sc procIdGet if paramter path is NULL and parameter tmo is SC NO TMO this system call returns the callers process ID 5 9 3 Manual Version 1
69. regular inter vals If the processor contains an on chip timer the kernel uses it by default The on chip timer is set up by the kernel automatically at start up and all parameters are defined in the SCIOPTA configuration utility In this case the user does not need to call sc tick If the processor does not have an on chip timer or the user does not want to use it sc tick must be called explicitly by the user from within an user interrupt process The user is responsible to write the user interrupt process and to setup the timer chip to define the requested tick interval This system call is only allowed in hardware activated interrupt processes and is not allowed to be used in interrupt processes which have been activated by trigger message sent process creation and killing 3 74 2 Syntax void sc tick void 3 74 3 Parameter None 3 74 4 Return Value None 3 74 5 Example SC INT PROCESS sysTick src if src sc tick Handle timer irq 3 74 6 Errors None SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 115 SC 3 System Calls Reference 3 75 sc tickGet 3 75 1 Description This call is used to get the actual kernel tick counter value The number of system ticks from the system start are returned 3 75 2 Syntax sc time t sc tickGet void 3 75 3 Parameter None 3 75 4 Return Value Current value of the tick timer 3 75 5 Example
70. sc msgTx sc msgptr t msgptr Sc pid t addr flags t flags 3 33 3 Parameter msgptr Pointer to message pointer addr The process ID of the addressee pid Valid SCIOPTA PID SC CURRENT PID The caller himself flags Pointer to message pointer 0 Must be set to 0 SCIOPTA Real Time Kernel 3 46 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em 3 33 4 Return Value None 3 33 5 Example Send TEST MSG to addr msg t msg Sc pid t addr E o msg sc msgAlloc sizeof test msg t TEST MSG SC DEFAULT POOL SC FATAL IF sc msgTx amp msg sndr 0 3 33 6 Errors Error Code i Error Type Extra Value KERNEL PTR SC ERR MODULE FATAL Either pointer to message or pointer to message pointer are zero Pointer to message pointer of NIL KERNEL EILL PID SC ERR MODULE FATAL Process ID is wrong Process ID KERNEL ENOT OWNER SC ERR MODULE FATAL Process does not own the message Pointer to message header KERNEL EILL MODULE SC ERR MODULE FATAL Module in message header has an illegal value Pointer to message header KERNEL EILL POOL ID SC ERR MODULE FATAL Pool index in message header has an illegal value Pointer to message header KERNEL EMSG HD 5 ERR MODULE FATAL Either pool ID or buffersize index are corrupted Pointer to message header KERNEL EOUTSIDE POOL i SC ERR MODULE FATAL The pointer is outside the pool
71. swap is initiated by the kernel this hook will be called newhook Process hook function pointer lt funcptr gt Function pointer to the process hook NULL Removes and unregisters the process hook 3 44 4 Return Value Function pointer to the previous process hook if pProcess hook was registered 0 if no process hook was registered SCIOPTA Real Time Kernel 3 64 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 44 5 Example druidHook sc procHookRegister 5C SET PROCSWAP swapHook 3 44 6 Errors Error Code i Error Type Extra Value KERNEL EILL VALUE 5 ERR SYSTEM FATAL Illegal process hook type Type SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 65 SC 3 System Calls Reference 3 45 sc procldGet 3 45 1 Description This call is used to get the process ID of a process by providing the name of the process In SCIOPTA processes are organized in systems CPUs and modules within systems There is always at least one module called system module module 0 Depending where the process resides system module not only the process name needs to be supplied but also the including system and module name This call forwards the request to the process daemon The standard process daemon sc procd needs to be defined and started at system configuration 3 45 2 Syntax SC pid t sc procIdGet const char path sc ticks t tmo
72. tickGet for i 0 i lt 100 i cache flush range char 0x3000000 0x8000 memcpy32B char 0x2000000 char 0x3000000 0x100000 tickGet t kprintf 0 Copy in 100MB in ms n sc_tickTick2Ms t 3 75 6 Errors None SCIOPTA Real Time Kernel 3 116 Manual Version 4 1 Reference Manual 3 System Calls Reference 3 76 sc tickLength 3 76 1 Description This system call is used to set the current system tick length in micro seconds 3 76 2 Syntax u32 tickLength 3032 ticklength 3 76 3 Parameter ticklength Tick length 5 em 0 The current tick length will just be returned without modifying it tick length The tick length in micro seconds 3 76 4 Return Value Tick length in microseconds 3 76 5 Example kprintf 0 Setting up system timer pit_init 200 0 200Hz 5ms sc_tickLength 4999 irqEnable SRC kprintf 0 done n 3 76 6 Errors None SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 117 SC 3 System Calls Reference 3 77 sc tickMs2Tick 3 77 1 Description This system call is used to convert a time from milliseconds into system ticks 3 77 2 Syntax sc time t sc tickMs2Tick 132 ms 3 77 3 Parameter ms Time in milliseconds 3 77 4 Return Value Time in system ticks 3 77 5 Example int tmo 1000 while tmo
73. to previous message SCIOPTA Real Time Kernel 3 34 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em 3 20 sc msgHookhRegister 3 26 1 Description This system call will register a global or module message hook There can be one module message hook of each type transmit receive per module If sc msgHookRegister is called from within a module a module message hook will be registered A global message hook will be registered when sc msgHookRegister is called from the start hook function which is called before SCIOPTA is initialized Each time a message is sent or received depending on the setting of parameter type the module message hook of the caller will be called if such a hook exists First the module and then the global message hook will be called 3 26 2 Syntax sc msgHook t sc msgHookRegister int type sc msgHook t newhook 3 26 3 Parameter type Defines the type of registerred CONNECTOR SC SET MSGTX HOOK Registers a message transmit hook Every time a message is sent this hook will be called SC SET MSGRX HOOK Registers a message receive hook Every time a message is received this hook will be called newhook Message hook function pointer lt funcptr gt Function pointer to the message hook NULL Removes and unregisters the message hook 3 26 4 Return Value Function pointer to the previous message hook if the message hook was registered 0 if no message hook
74. variable could not be defined or modified 0 if the process variable was successfully defined or modified 3 68 5 Errors Error Code i Error Type Extra Value KERNEL 5 ERR PROCESS FATAL No proc Var set SCIOPTA Real Time Kernel 3 108 Manual Version 4 1 Reference Manual 3 System Calls Reference 5 em 3 69 sc procVectorGet 3 69 1 Description This system call is used to get the interrupt vector of the caller The interrupt vector will only be returned if sc procVectorGet is called from an interrupt process Itis not an error to call sc procVectorGet from other process types but the return value will be meaningless 3 69 2 Syntax int sc procVectorGet void 3 69 3 Parameter None 3 69 4 Return Value Interrupt vector if called within an interrupt process 3 69 5 Errors Error Code i Error Type Extra Value KERNEL EILL PID SC ERR MODULE WARNING Process Module disappeared KERNEL EILL PID SC ERR MODULE FATAL Illegal pid SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 Process ID Process ID 3 109 SC 3 System Calls Reference 3 70 sc procWakeupEnable 3 70 1 Description This system call is used to enable the wakeup of a timer or interrupt process 3 70 2 Syntax void procWakeupEnable void 3 70 3 Parameter None 3 70 4 Return Value None 3 70 5 Errors Error Code i Error Type Extra Value K
75. was registered 3 26 5 Example sc_msgHook_t oldMsgHook oldMsgHook sc_msgHookRegister SC_SET_MSGRX_HOOK rxHook oldMsgHook sc msgHookRegister SC SET MSGTX HOOK txHook SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 35 3 System Calls Reference SCIOPTA e 3 26 6 Errors Error Code i Error Type Extra Value KERNEL EILL VALUE SC ERR SYSTEM FATAL Wrong type unknown or not active Requested message hook type SCIOPTA Real Time Kernel 3 36 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 27 sc msgOwnerGet 3 27 1 Description This system call is used to get the process ID of the owner of a message The kernel will examine the message buffer to determine the process who owns the message buffer 3 27 2 Syntax Sc pid t sc msgOwnerGet sc msgptr t msgptr 3 27 3 Parameter msgptr Pointer to message pointer 3 27 4 Return Value Process ID of the owner of the message 3 27 5 Example Get owner of received messag will be caller 5 msg t msg SC pid t owner msg sc msgRx SC ENDLESS TMO SC MSGRX ALL SC MSGRX MSGID owner msgOwnerGet amp msg 3 27 6 Errors Error Code i Error Type Extra Value KERNEL PTR SC ERR MODULE FATAL Either pointer to message or pointer to message pointer are zero Pointer to message pointer SCIOPTA Real Time Kernel Reference Manual Manual
76. 0 5 5 3 Version 1 9 5 3 Manual Version 14 5 3 Manual Version l3 eee et Fecerunt sen 5 4 Manual Version 1 2 cccccccccsssscccesessececesesssseececenssseecesenssasececeseaaeeeececesueseceecesueaeceeceasseccecesseeeecesenees 5 4 Version 5 5 Manual Version 1 0 00222002 0 60000000000 000000000000 5 5 Former SCIOPTA Kernel Reference Manual 5 5 Manual Version 1 7 A 5 5 Manual Version 1 6 te eR 5 6 Manual Version 1 5 cccccccccsssccccesesssececesessneececeseaaeecesensausececeseaueeeececesusaeccecesueaeceecesasseccecesnseeeeesenees 5 6 Mangal Version 1 4 uie e ete Fete ro Rt rH E a E 5 6 Manual Version 1 3 ccccccccccsssecccesesssececesessseececessaseecesensassececeseaeeeececesaeaeceecesseseseecesasseccecesseeesenenees 5 6 Mangal Version 12 ERE 5 7 Manual Version 1 1 ERR 5 8 Maniial Version mST 5 8 Former SCIOPTA ARM Target Manual 5 8 Manual Version 2 2 ere 5 8 Manual AS I O 1A 5 9 Manual Version 2 0 ecce etu eter treten ite t ai iege 5 9 Manual Version 1 7 2 cccccccccsssssccecesssssecesessseececesesseecccecesasseccecesuececeecesusaeccecesueseseeceensseseecessseeecesenees 5 9 Manual Version EAE 5 9 Inn AE
77. 15 2 Eclipse rewritten e Chapter 5 2 5 Priorities upper limit effective priority of 31 described e Chapter 6 Application Programming Interface e Chapter 6 3 6 sc msgRx and chapter 6 3 1 sc msgAlloc parameter tmo value modified e Chapter 6 4 1 poolCreate parameter size pool calculation value n better defined Parameter name Valid characters modified to Recommended characters e Chapter 6 4 3 sc poolIdGet return value 0 of default pool added e Chapter 6 5 6 procPrioSet paragraph If there are already existing processes at the same priority the proc ess which has just moved to that priority will be put at the end of the list and swapped out added e Chapter 6 6 1 sc procPrioCreate Parameter name Valid characters modified to Recommended charac ters e Chapter 6 6 2 procIntCreate User interrupt process type removed Parameter name Valid characters modified to Recommended characters SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 5 1 SCIOPTA 5 Manual Versions e Chapter 6 6 3 sc procTimCreate Parameter name Valid characters modified to Recommended charac ters e Chapter 6 10 1 sc moduleIdGet parameter name text or zero for current module appended at description and return value for parameter name NULL added Return value SC NOSUCH MODULE modified to SC ILLEGAL MID if Module name was not found e Chapter 6 11 1 sc mo
78. 3 2 4 25 2 6 2 7 2 8 2 9 2 10 2 11 2 12 3 3 1 32 3 2 1 3 22 3 2 3 3 2 4 3 2 5 3 2 6 3 3 1 3 3 2 3 3 3 3 3 4 3 3 5 3 3 6 3 4 1 3 4 2 3 4 3 3 4 4 3 4 5 3 4 6 3 5 3 5 1 SCIOPTA cru ES The SCIOPTA SYS tenn iss s ettet eerta ee teret ves A eed 1 2 ee eee ue nte een Ee ete eres 1 2 SCIOPTA Real Time 1 2 SCIOPTA for Windows and 1 2 About This 1 2 Supported PEOCESSOIS ipni rt e ee Pe e e ero t p 1 3 1 3 eue PETER 1 3 lione 2 1 Message System SP 2 1 Process Systemi Calls uerbo et eio de ue oerte ja 2 2 Module System Cals E 2 3 Module 9 1 6 2 2 eE EKE 2 4 Message Pool Calls icr 2 4 Timing Cas PIC 2 4 System TICK Calls 2 5 Process Trigger uerit tereti 2 5 CONNECTOR Process Calls re
79. 5 union sc msg changed to sc msg t to support SCIOPTA 16 Bit systems NEAR pointer union sc msg changed to sc msgptr t to support SCIOPTA 16 Bit systems NEAR pointer Chapter 6 System Call Reference page layout for all system calls modified Chapter 6 81 sc triggerWait third paragraph rewritten Chapters 6 9 sc moduleCreate and 6 17 sc moduleKill information about sc kerneld are given Chapter 6 44 procIdGet added text this parameter is not allowed if asynchronous timeout is disabled at system configuration sconf Manual split into a User s Guide and a Reference Manual 5 9 4 Manual Version 1 4 Chapter 4 7 3 2 Example OS INT PROCESS changed into correct SC INT PROCESS Chapter 2 3 4 4 Init Process rewritten Chapter 4 5 Processes former chapters 4 5 6 Idle Process and 4 5 7 Supervisor Process removed Chapter 4 5 1 Introduction last paragraph about supervisor processes added Chapter 4 5 5 Init Process rewritten Chapter 6 8 sc miscErrorHookRegister syntax corrected Chapter 6 21 sc mscAlloc timeout parameter tmo better specified Chapter 6 27 sc msgRx timeout parameter tmo better specified Chapter 4 10 4 Error Hook Declaration Syntax user 0 user error Chapter 4 9 SCIOPTA Daemons moved from chapter 2 9 and rewritten Chapter 6 41 sc procDaemonRegister last paragraph of the description rewritten Chapters 6 45 procIntCreate 6 46 procKill 6 51 sc procPrioCreate 6 60
80. ARNING reete SC FATAL TE TMO SC SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 85 3 64 3 66 HN ENIM 2 2 SCIOPTA lt gt SCOBISEG TC cactus MI 3 4 SC MISC Cie CONTA 3 5 eE aaO E Nr 3 6 SC misc ENOS ET 3 7 SC BEEOE ien 3 8 9 66 du skene aoea EEEE EEEE EE EAEE 3 9 SC MODULECREATE este cete eue Y YER LEHRER 4 4 5 3 10 5 Ve E 3 13 _ 1 3 14 se modulebriendGet 2 3 15 sc 2 3 16 e 3 17 SC MODULEIDGEST s etate aas 4 4 se moduleldGet E 3 18 SC_MODULEINFO 4 4 SO MOGULS IMFO
81. BITORSa cetera eec RI cue er eH LE EIE 3 106 3 67 Ee 3 107 3 67 1 DOS CHIPUOM asses 3 107 3 67 2 En 3 107 3 67 3 heic 3 107 3 67 4 hicnuBl lE 3 107 3 67 5 D DU LLL UU 3 107 3 68 s proc ENIM 3 108 3 68 1 MDGS 3 108 3 68 2 e 3 108 3 68 3 rund M 3 108 3 68 4 Value nro RR ESPERE ree 3 108 3 68 5 MED OS uei ITE 3 108 3 69 S proc VectOrGet 5 eter tt Ice RUD eee ete 3 109 3 69 1 bes 3 109 3 69 2 EE 3 109 3 69 3 Parameters mma 3 109 3 69 4 Value iere rr REM IRE Y peter pee ut rate EE RN ERE EO sees Ee EE PESE dU 3 109 3 69 5 ligo e r PR 3 109 3 70 sc procWakeupEnable e nean HEREDES ee ee ee 3 110 3 70 1 MDGS CHA OM 3 110 3 70 2 Enni D 3 110 3 70 3 leui 3 110 3 70 4 PH n pEE
82. C ERR MODULE FATAL Either pointer to message or pointer to message pointer are Zero Pointer to message pointer KERNEL EILL VALUE SC ERR MODULE FATAL Parameter size is smaller than the size of a message id Buffer size KERNEL EENLARGE MSG SC ERR MODULE FATAL Message would be enlarged Buffer size SCIOPTA Real Time Kernel 3 44 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 32 sc msgSndGet 3 32 1 Description This system call is used to get the process ID of the sender of a message The kernel will examine the message buffer to determine the process who has transmitted the message buffer 3 32 2 Syntax pid t sc msgSndGet sc msgptr t msgptr 3 32 3 Parameter msgptr Pointer to message pointer 3 32 4 Return Value Process ID of the sender of the message if the message was sent at least once Process ID of the owner of the message if the message was never sent 3 32 5 Example Get the sender of a message sc msg t msg SC pid t sndr msg sc msgRx SC ENDLESS TMO SC MSGRX ALL SC MSGRX MSGID sndr sc msgSndGet amp msg 3 32 6 Errors Error Code i Error Type Extra Value KERNEL PTR SC ERR MODULE FATAL Either pointer to message or pointer to message pointer are zero Pointer to message pointer SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 45 SC 3 System Calls Reference 3 33 sc msgTx
83. E E AROE IEEE SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 XIII SC IOPTA Table of Contents e SCIOPTA Real Time Kernel XIV Manual Version 4 1 Reference Manual 1 SCIOPTA System 1 SCIOPTA System a gt SCIOPTA e SCIOPTA System SCIOPTA Real Time Kernel SCSIM SCIOPTA Simulator SCAPI SCIOPTA API Scheduler Windows Windows SCIOPTA SCIOPTA and Windows High Performance Windows Hard Real Time Fully Preemptive TCP IP Network SCIOPTA IPS IPSsock API Windows Winsock Windows Winsock API USBH USB Host USBD USB Device USB Host Device Driver USB Host Functions File Systems SCIOPTA File Systems Windows File System Windows File System SFATFS FAT SFFS Flash File System USB SCIOPTA USB Windows USB System Software Windows USB System Software USB Host Device Driver USB Host Functions Embedded GUI SCEG SCIOPTA Embedded GUI PEG GDI Graphics Device Interface GDI Graphics Device Interface IEC 61508 up to SIL3 Additional CONNECTOR Multi CPU Support CONNECTOR Multi CPU Support CONNECTOR Multi CPU Support Products DRUID System Level Debugger Safety Certification YES NO NO Figure 1 1 The SCIOPTA System SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 1 SCIOPTA System gt SCIOPTA em 1 1 The SCI
84. ER 3 110 3 70 5 BITOIS 3 110 3 71 sc procWakeupbDnisable esce eere net ood en nO e PRINS 3 111 3 71 1 beau 3 111 3 71 2 Munro 3 111 3 71 3 Parameter 3 111 3 71 4 hi moBRTu c M m 3 111 3 71 5 lui fM 3 111 3 72 c proe Yield iere 3 112 3 72 1 Ib euis n 3 112 3 72 2 niente reser tnis de e iteram a ER 3 112 3 72 3 Parameter ye LT R R 3 112 3 72 4 Val e rH RR 3 112 3 72 5 BEX AU M M 3 112 3 72 6 ls ETT 3 112 3 73 sass 3 113 3 73 1 lb ego EE 3 113 3 73 2 DD YUAN e 3 113 SCIOPTA Real Time Kernel X Manual Version 4 1 Reference Manual Table of Contents SC IOPTA d 3 73 3 TREE 3 113 3 73 4 3 113 3 73 9 Gisele eis E RI REIR ut RH RU 3 113 3 73 6 uir 3 114 3 74 3 115 3 74 1 leu ME 3 115 3 74 2 SYMA SS secs clas a RU ERU DET
85. ERE 3 127 Scheduler Lock Counter 1 2 11 221 2 0 202 4 22400 2 06 60 eene eene eene en tenente nennen nenne 3 89 3 90 SCIOPTA Real Time Kernel 6 8 Manual Version 4 1 Reference Manual 6 Index SCIOPTA for LINUX 3 aov e PH eei SCIOPTA fOor tti ttti itr tesis esee uns SCIOPTA Real Time Kernel SCIOPTA System Framework eese senda Message eerie ipio e ere ebd e erede Sender Of D Set a Message Pool as Default Set a Process Error Number esee nennen Set all Module as No Friends Set the Priority of a Set the Size of a Set the Tick Length ttti re oe acest Set the Time Slice of Timer Process eere Value Of rigger Setup a Process Variable Area seen S126 0 St rt a Process o RE UR Start Stop COUNTE ME M Starting a SCIOPTA WIN32 Kernel Simulator eese IJ aeter E E EI NIMM Supervise a PLOCESS 224 R Supported 30 8 System call reference 1 e caer Ege System Calls Overview epe etus apes
86. ERNEL EILL PROCTYPE SC ERR MODULE FATAL Caller is not an interrupt or timer process Process type SCIOPTA Real Time Kernel 3 110 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 71 sc_procWakeupDisable 3 71 1 Description This system call is used to disable the wakeup of a timer or interrupt process 3 71 2 Syntax void procWakeupDisable void 3 71 3 Parameter None 3 71 4 Return Value None 3 71 5 Errors Error Code i Error Type Extra Value KERNEL EILL PROCTYPE SC ERR MODULE FATAL Caller is not an interrupt or timer process Process type SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 111 SC 3 System Calls Reference 3 72 sc procYield 3 72 1 Description This system call is used to yield the CPU to the next ready process within the current process s priority group 3 72 2 Syntax void procYield void 3 72 3 Parameter None 3 72 4 Return Value None 3 72 5 Example sc procYield 3 72 6 Errors Error Code i Error Type Extra Value KERNEL NOT SC ERR MODULE FATAL Caller is not a prioritized process Process type SCIOPTA Real Time Kernel 3 112 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 73 sc sleep 3 73 1 Description This call is used to suspend the calling process for a defined time The requested time must be given in number of system ti
87. GERE HERE ERI O EO 3 127 3 84 1 b euism 3 127 3 84 2 Sunset eene mE Or nte dee i 3 127 3 84 3 Parameter 0 cccccccccsssssececesssscececessscececessnseececessseececesenseaeececeseaaeeeccsessaesecesessaeeesesessneaesescsaaaaesecens 3 127 3 84 4 V alle essea E 3 127 3 84 5 BEX AUN Gigs caus 3 128 3 84 6 ls c 3 128 3 85 SCIOPTA a 3 129 3 85 1 peuple En 3 129 3 85 2 DS YUAN c 3 129 3 85 3 mm 3 129 3 85 4 Return 3 129 3 85 5 lUo m PET 3 129 3 86 SOM ICI E 3 130 3 86 1 Description ete en ec d Oi Eu rp en Eus 3 130 3 86 2 uu ds 3 130 3 86 3 C 3 130 3 86 4 IUBE CRRRRRRREMMMMMMMMMMMMEMMMMEEMMMMMMEMMMMMEMMMMMMEMMMMMMMMMMMMMMMMF 3 131 3 86 5 luu Lc ERE 3 131 4 Kernel Error OOS aeta ERREUR ID NI ADU DUREE a 4 1 TntrOductiOn cccccccccesssccccecesssseececessssececcecesuececeeceessseceecsessaeceeesesesseceecesaeseceecsessaesecesesseseceeeneaa
88. IOPTA e 3 49 sc procObserve 3 49 1 Description This system call is used to supervise a process The sc procObserve system call will request the message to be sent back if the given process dies process super vision If the supervised process disappears from the system process ID the kernel will send the requested and registered message to the supervisor process The process to supervise can be external in another CPU 3 49 2 Syntax void sc procObserve sc msgptr t msgptr Sc pid t pid 3 49 3 Parameter msgptr Pointer to the observe message pointer Pointer to the message which will be returned if the supervised process disappears The message must be of the following type struct err msg sc msgid t id errcode t rror user defined data Process ID of the process which will be supervised 3 49 4 Return Value None SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 75 SC 3 System Calls Reference 3 49 5 Example struct dead s sc msgid t ig Sc errcode t errcode union sc_msg sc msgid t ig struct dead s dead sc msg t msg msg sc msgAlloc sizeof struct dead s 0xdead 0 SC FATAL IF sc procObserve amp msg slave pid 3 49 6 Errors Error Code Error Type Extra Value KERNEL 5 ERR PROCESS FATAL Either pointer to message or pointer to message pointer are Zero KERNEL EILL
89. If the pid has no valid value out of scope the kernel calls the error hook with a fatal error If there is no error hook he system loops at the error label 3 48 2 Syntax Sc msg t sc procNameGet Sc pid t pid 3 48 3 Parameter pid Process ID pid Process ID of the process where the name is requested SC CURRENT PID Current running caller process 3 48 4 Return Value Message owned by the caller if the process exists If the return value is nonzero the returned message buffer is owned by the caller and the message is of type sc procNameGetMsgReply t and the message ID is SC PROCNAMEGETMSG REPLY The message data contains the 0 terminated ASCII name string of the process The message is defined in the sciopta msg include file typedef struct sc procNameGetMsgReply s sc msgid t id Sc errcode t error char target SC MODULE SIZE 1 char module SC MODULE NAME SIZE 1 char process SC PROC NAME SIZE 1 procNameGetMsgReply t SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 73 3 System Calls Reference SCIOPTA em 3 48 5 Example sc msg t senderName senderName sc procNameGet sender 3 48 6 Errors Error Code i Error Type Extra Value KERNEL EILL i SC ERR PROCESS FATAL Illegal pid 3 74 Process ID SCIOPTA Real Time Kernel Manual Version 4 1 Reference Manual 3 System Calls Reference SC
90. LE 0x027 Illegal module ID KERNEL EILL PRIORITY 0 028 Illegal priority KERNEL EILL STACKSIZE 0x029 Illegal stacksize KERNEL ENO MORE MODULE 0x02A No more modules available 4 6 SCIOPTA Real Time Kernel Manual Version 4 1 Reference Manual 4 Kernel Error Codes 5 Name Number Description KERNEL EILL PARAMETER OxO2B 1 parameter KERNEL EILL PROC NAME 0 02 Illegal process name KERNEL EPROC NOT PRIO 0 020 Nota prioritized process KERNEL ESTACK OVERFLOW 0 02 Stack overflow KERNEL UNDERFLOW OxO2F Stack underflow KERNEL EILL VALUE 0x030 Illegal value KERNEL EALREADY DEFINED 0 031 Already defined KERNEL ENO MORE CONNECTOR 0x032 more connectors available KERNEL EPROC TERMINATE OxFFF Process terminated 4 5 Error Types Name Bit Description SC ERR SYSTEM FATAL 0x01 This type of error will stop the whole target SC ERR MODULE FATAL 0 02 This type of error results in killing the module if an error hook returns a value of 0 SC ERR PROCESS FATAL 0x04 This type of error results in killing the process if an error hook returns a value of 0 SC ERR SYSTEM WARNING 0x10 Warning on target level The system continues if an error hook is installed SC ERR MODULE WARNING 0x20 Warning on module level The system continues if an e
91. LI 3 4 Su MMISCCHC COM m 3 5 91 3 5 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 SC IOPTA Table of Contents a 3 5 2 EE 3 5 3 5 3 3 5 3 5 4 3 5 355 BX AUP lc 3 5 3 5 6 luis dc TERR 3 5 3 6 SC this C BETBOGIGL ierit oed eee dee 3 6 3 6 1 Description aii ees eae 3 6 3 6 2 un A 3 6 3 6 3 UE RD odes icti tini deco eec t RH 3 6 3 6 4 3 6 3 6 5 Example 3 6 3 6 6 HEMET OS se 3 6 3 7 SCthlSs CBEEDOS eL 3 7 3 7 1 leds ES 3 7 3 7 2 EE 3 7 3 7 3 3 7 3 7 4 hi nmoRT N E mT 3 7 3 7 5 BX AUP nesena E E 3 7 3 7 6 lu
92. MEMORY i SC ERR MODULE FATAL No more memory in module for pool Requested pool size KERNEL EILL POOL SIZE SC ERR MODULE FATAL Size is not 4 byte aligned Requested pool size KERNEL MORE POOL SC ERR MODULE FATAL Maximum number of pools for module reached Number of pools in module cb SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 51 SC 3 System Calls Reference 3 36 sc poolDefault 3 36 1 Description This system call sets a message pool as default pool The default pool will be used by the sc msgAlloc system call if the parameter for the pool to allocate the message from is defined as SC DEFAULT POOL Each process can set its default message pool by sc poolDefault The defined default message pool is stored inside the process control block The initial default message pool at process creation is 0 The default pool is also used if a message sent from another module needs to be copied 3 36 2 Syntax Sc poolid t sc poolDefault int idx 3 36 3 Parameter idx Pool ID Zero or positive Pool ID 1 Request to return the ID of the default pool 3 36 4 Return Value Pool ID of the default pool 3 36 5 Example pl sco 1 fs pool if pl SC ILLEGAL POOLID sc poolDefault pl 3 36 6 Errors Error Code i Error Type Extra Value KERNEL EILL POOL ID SC ERR PROCESS WARNING Pool index not valid Requested pool index Pool index
93. OPTA System 1 1 1 SCIOPTA System SCIOPTA System is the name for a SCIOPTA framework which includes design objects such as SCIOPTA mod ules processes messages and message pools SCIOPTA is designed on a message based architecture allowing di rect message passing between processes Messages are mainly used for interprocess communication and synchronization SCIOPTA messages are stored and maintained in memory pools The kernel memory pool man ager is designed for high performance and memory fragmentation is avoided Processes can be grouped in SCI OPTA modules which allows you to design a very modular system Modules can be static or created and killed during run time as a whole SCIOPTA modules can be used to encapsulate whole system blocks such as a com munication stack and protect them from other modules in the system 1 1 2 SCIOPTA Real Time Kernels SCIOPTA System Framework together with specific SCIOPTA scheduler results in very high performance real time operating systems for many CPU architectures The kernels and scheduler are written 100 in assembler SCIOPTA is the fastest real time operating system on the market The SCIOPTA architecture is specifically de signed to provide excellent real time performance and small size Internal data structures memory management interprocess communication and time management are highly optimized SCIOPTA Real Time kernels will also run on small single chip devices without MMU 1 1 3 SCIOPTA
94. RIO SC ERR MODULE FATAL Caller is not a prioritized process KERNEL EUNLOCK WO 8 ERR MODULE FATAL Lockcounter 0 SCIOPTA Real Time Kernel 3 90 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 58 sc procSliceGet 3 58 1 Description This call is used to get the time slice of a prioritized or timer process The time slice is the period of time between calls to the timer process in ticks or the time slice of prioritized proc esses if round robin scheduled on the same priority 3 58 2 Syntax Sc ticks t sc procSliceGet SC pid t pid 3 58 3 Parameter pid Process ID pid Process ID of the process to get the time slice SC CURRENT PID Current running caller process 3 58 4 Return Value Period of time between calls to any given timer process in ticks 3 58 5 Example Sc ticks t new ticks new ticks procSliceGet SC CURRENT PID 3 58 6 Errors Error Code i Error Type Extra Value KERNEL PID SC ERR MODULE WARNING Process Module disappeared Process ID KERNEL EILL PID SC ERR MODULE FATAL Illegal pid Process ID SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 91 SC 3 System Calls Reference 3 59 sc procSliceSet 3 59 1 Description This call is used to set the time slice of a prioritized or timer process The modified time slice will become active after the current time slice expired or if the timer gets start
95. Simulator and API for Windows The SCIOPTA System is available on top of Windows SCSIM is a SCIOPTA simulator including SCIOPTA scheduling together with the Windows scheduler This allows realistic system behaviour in a simulated environ ment SCAPI is a SCIOPTA API allowing message passing in a windows system SCAPI is mainly used to design dis tributed systems together with CONNECTOR processes Scheduling in SCAPI is done by the underlying operating system 1 2 About This Manual This SCIOPTA Real Time Kernel Reference Manual contains a complete description of all system calls and error messages Also the SCIOPTA SCSIM Simulator product is covered in this manual Please consult also the SCIOPTA Kernel User s Manual for detailed information about the SCIOPTA installa tion technologies and methods SCIOPTA Real Time Kernel 1 2 Manual Version 4 1 Reference Manual 1 SCIOPTA System a gt SCIOPTA e 1 3 Supported Processors 1 3 1 Architectures SCIOPTA supports the following processor architectures Architectures are referenced in this document as lt arch gt arm e ppc power pc coldfire win32 SCSIM Simulator and SCAPI SCIOPTA Windows Host 1 3 2 CPU Families SCIOPTA Kernel supports the following CPU families CPU families are referenced in this document as lt gt Architecture CPU Family Description arch cpu arm at91sam7 Atmel AT91SAM7 ARM7
96. TAL No process variable set SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 103 SC 3 System Calls Reference 3 65 sc procVarGet 3 65 1 Description This system call is used to read a process variable 3 65 2 Syntax int sc procVarGet sc tag t tag _ 132 value 3 65 3 Parameter tag Process variable tag User defined tag of the process variable which was set by the procVarSet call value Process variable Pointer to the variable where the process variable will be stored 3 65 4 Return Value if the system call fails and the process variable could not be read 0 if the process variable was successfully read 3 65 5 Errors Error Code i Error Type Extra Value KERNEL 5 ERR PROCESS FATAL No procVar set or value NULL SCIOPTA Real Time Kernel 3 104 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 66 sc procVarlnit 3 66 1 Description This system call is used to setup and initialize a process variable area The user needs to allocate a message with the size of sizeof sc varpool t n sizeof sc local t which holds the process variables 3 66 2 Syntax void sc procVarInit sc msgptr t varpool unsigned int n 3 66 3 Parameter varpool Process variable buffer Pointer to the message buffer holding the process variables n Size of process variables Maximum number of proce
97. alue CRC 16 CCITT over a specified memory range The start value of the CRC is OxFFFF 3 4 2 Syntax 116 miscCrc 18 data unsigned int len 3 4 3 Parameter data Pointer to the memory range len Number of bytes 3 4 4 Return Value The 16 bit CRC value 3 4 5 Example typedef struct ips socket s sc msgid t id ulg srcPort ule dstPort ips addr t srcIp ips addr t dstIp dbl t list 1 socket t 116 ips socket t ref cre sc miscCrc ref srcPort 4 3 4 6 Errors None SCIOPTA Real Time Kernel 3 4 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 5 sc miscCrcContd 3 5 1 Description This function calculates a 16 bit cyclic redundancy check value CRC 16 CCITT over an additional memory range The variable start is the CRC start value 3 5 2 Syntax __ul6 sc miscCrcContd __us data unsigned int len __ 16 start 3 5 3 data Pointer to the memory range len Number of bytes start CRC start value 3 5 4 Return Value The 16 bit CRC value 3 5 5 Example crc2 sc miscCrcContd refl gt srcPort 4 crc 3 5 6 Errors None SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 5 SC 3 System Calls Reference 3 6 sc miscErrnoGet 3 6 1 Description This system call is used to get the process error number errno variable Each SCIOPTA proc
98. an just give the name as parameter and not a path 3 16 2 Syntax sc moduleid t sc moduleIdGet const char name 3 16 3 Parameter name Module name name Pointer to the 0 terminated name string NULL Current module 3 16 4 Return Value Module ID if the module name was found Current module ID module ID of the caller if parameter name is NULL SC ILLEGAL MID if the module name was not found 3 16 5 Example sc moduleid t mid mid sc moduleIdGet user 01 sc moduleStop mid 3 16 5 1 Errors Error Code i Error Type Extra Value KERNEL EILL MODULE 5 ERR PROCESS WARNING String pointed to by name too long name SCIOPTA Real Time Kernel 3 18 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 17 modulelnfo 3 17 1 Description This system call is used to get a snap shot of a module control block mcb SCIOPTA maintains a module control block mcb per module and a process control block pcb per process which contains information about the module and process System level debugger or run time debug code can use this system call to get a copy of the control blocks The caller supplies a module control block structure in a local variable The kernel will fill the structure with the module control block data The structure content will reflect the module control block data at a certain moment which will be determined by the kernel It is therefo
99. atal error After the call the value of the timeout id is zero 3 80 2 Syntax sc msg t sc tmoRm tmoid t id 3 80 3 Parameter id Timeout ID Pointer to timeout ID which was given when the timeout was registered by the sc tmoAdd call 3 80 4 Return Value Pointer to the timeout message which was defined at registering it by the sc tmoAdd call 3 80 5 Example sc msg t tmomsg tmomsg sc tmoRm amp tmoid sc_msgFree amp tmomsg SCIOPTA Real Time Kernel 3 122 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 80 6 Errors Error Code i Error Type Extra Value KERNEL EILL VALUE 5 ERR PROCESS FATAL Timeout expired but not received not in the queue KERNEL PTR SC ERR MODULE FATAL Either pointer to message or pointer to message pointer are zero KERNEL ENOT ERR MODULE FATAL Process does not own the message Pointer to message SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 123 SC 3 System Calls Reference 3 81 sc trigger 3 81 1 Description This system call is used to activate a process trigger The trigger value of the addressed process trigger will be incremented by 1 If the trigger value becomes greater than zero the process waiting at the trigger will become ready and swapped in if it has the highest priority of all ready processes 3 81 2 Syntax void trigger Sc pid t pid 3 81 3 Param
100. be swapped in If a timer process will be stopped it will immediately removed from the timer list and the system will not wait until the current time slice expires The procStop call will clear a pending timeout 3 61 2 Syntax void procStop Sc pid t pid 3 61 3 Parameter pid Process ID pid Process ID of the process to be stopped SC CURRENT PID Current running caller process will be stopped 3 61 4 Return Value None 3 61 5 Example sc procStop SC CURRENT PID SCIOPTA Real Time Kernel 3 96 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 61 6 Errors Error Code i Error Type Extra Value KERNEL EILL PROC i SC ERR MODULE FATAL Caller is not a prioritized or timer process Process ID KERNEL EILL PID SC ERR MODULE WARNING Illegal pcb Process ID KERNEL EILL VALUE i SC ERR MODULE FATAL Stop counter overrun SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 97 SC 3 System Calls Reference 3 62 sc procTimCreate 3 62 1 Description This system call is used to request the kernel daemon to create a timer process The standard kernel daemon sc kerneld needs to be defined and started at system configuration The process will be created within the callers module The maximum number of processes for a specific module is defined at module creation 3 62 2 Syntax Sc pid t sc procTimCreate const char name void en
101. c miscErrorHookRegister sc errHook t newhook 3 9 3 newhook Function pointer to the hook lt gt Function pointer NULL Will remove and unregister the hook 3 9 4 Return Value Function pointer to the previous error hook if error hook was registered 0 if no error hook was registered 3 9 5 Example Sc errHook t error hook sc miscErrorHookRegister error hook 3 9 6 Errors None SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 9 SC 3 System Calls Reference 3 10 sc moduleCreate 3 10 1 Description This system call is used to request the kernel daemon to create a module The standard kernel daemon sc kerneld needs to be defined and started at system configuration SCIOPTA processes can be grouped into modules to improve system structure When creating a module the maximum number of pools and processes must be defined There is a maximum number of 128 modules per SCIOPTA system possible Each module has also a priority which can range between 0 highest to 31 lowest priority For process scheduling SCIOPTA uses a combination of the module priority and process priority called effective priority The kernel de termines the effective priority as follows Effective Priority Module Priority Process Priority This technique assures that process with highest process priority 0 cannot disturb processes in modules with low er module pri
102. cated 3 62 4 Return Value ID of the created process 3 62 5 Example hello pid sc procTimCreate process name SCI tick process func void void SCI tick stacksize 256 period 10 initdelay 0 state SC PDB STATE RUN pool id SC DEFAULT POOL 3 62 6 Errors Error Code i Error Type Extra Value KERNEL ENO KERNELD i SC ERR PROCESS FATAL There is no kernel daemon defined in the system KERNEL EILL PROC NAME SC ERR MODULE FATAL Parameter name not valid Pointer to process name KERNEL EILL PROCTYPE SC ERR MODULE FATAL Illegal process type Process type KERNEL EILL SLICE SC ERR MODULE FATAL Illegal period time Requested time period SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 99 SC 3 System Calls Reference Error Code i Error Type Extra Value KERNEL EILL STACKSIZE i SC ERR MODULE FATAL Stack not valid Requested stacksize KERNEL EILL MODULE 5 MODULE FATAL Module cb is not valid Module ID KERNEL MORE ERR MODULE FATAL Number of maximum processes reached No of processes KERNEL EOUT OF MEMORY i SC ERR MODULE FATAL Size does not fir into module memory SCIOPTA Real Time Kernel 3 100 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 68 sc procUnobserve 3 63 1 Description This system call is used to cancel an installed supervision of a proces
103. cccccccesscccecesssscececesssseececessnseeeececesasceccecesseseceecsessaesecesessaeseseseseeeeees 3 63 5 1 ES 3 63 6 FEET OG Sete EPOD 3 64 proc VarDel eee his Rent hh cenit sees 3 64 1 Ib up 3 64 2 DVM LAK n ee REED E DERE RS 3 64 3 I sro RR 3 64 4 Return IR EAR eR AREA Ae EUREN TREE 3 64 5 ETOS SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 5 em IX SC IOPTA Table of Contents 4 3 65 Otis 3 104 3 65 1 beau e 3 104 3 65 2 Iu En EUROPEE RETE 3 104 3 65 3 Cor te ete exe percipe yocp UN Doug 3 104 3 65 4 3 104 3 65 5 TEED ORS retest cece On 3 104 3 66 sc proc vos era e ERE 3 105 3 66 1 Ib CHILL OM so Ses ssc 3 105 3 66 2 eunte iae 3 105 3 66 3 Parameter 0 cccccccccsssssececesessescececessscececessscececessnseececesenseaeececessuaeeeccsessaeseccsessaecesesessnsaesescsaaaesecens 3 105 3 66 4 Value aee Hi ERES 3 105 3 66 5
104. cks The calling process will get into a waiting state and swapped out After the timeout has elapsed the process will become ready again and will be swapped in if it has the highest priority of all ready processes The process will be waiting for at least the requested time minus one system tick 3 73 2 Syntax sc time t sc sleep sc ticks t tmo 3 73 3 Parameter tmo Timeout Number of system ticks to wait 3 73 4 Return Value Activation time The absolute time tick counter value when the calling process became ready 3 73 5 Example void resetPHY Setup some I O pins sc sleep 2 Setup some other I O pins sc sleep 2 Setup last I O pins sc sleep 2 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 113 3 System Calls Reference SCIOPTA e 3 73 6 Errors Error Code i Error Type Extra Value KERNEL ELOCKED MODULE FATAL Scheduler is locked KERNEL EPROC NOT SC ERR MODULE FATAL Caller is not a prioritized process KERNEL EILL VALUE i SC ERR MODULE FATAL Illegal timeout value Time out value SCIOPTA Real Time Kernel 3 114 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em 3 74 sc tick 3 74 1 Description This function calls directly the kernel tick function and advances the kernel tick counter by 1 The kernel maintains a counter to control the timing functions The timer needs to be incremented in
105. control blocks and pool control blocks do not fit in module size Module size KERNEL EILL ERR SYSTEM FATAL Requested name does not comply with SCIOPTA naming rules or does already exist KERNEL MORE MODULE SC ERR SYSTEM FATAL Maximum number of modules reached Number of modules KERNEL VALUE SC ERR SYSTEM FATAL Module addresses or sizes not valid Start address size or initsize unaligned initsize gt size SCIOPTA Real Time Kernel 3 12 Manual Version 4 1 Reference Manual 3 System Calls Reference 3 11 sc moduleFriendAdd 3 11 1 Description 5 em This system call is used to add a module to the friends of the caller The caller accept the module in parameter mid as friend The module is entered in the friend set of the caller In SCIOPTA each module can select friend modules This has mainly consequences on whether messages will be copied or not 3 11 2 Syntax void sc moduleFriendAdd sc moduleid t mid 3 11 3 Parameter mid Module ID Module ID of the new friend to add 3 11 4 Return Value None 3 11 5 Errors Error Code i Error Type Extra Value KERNEL EILL MODULE SC ERR SYSTEM FATAL Module ID not valid mid gt SC MAX MODULE SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 Module ID 3 13 SC 3 System Calls Reference 3 12 sc moduleFriendAIl 3 12 1 Description This system call is use
106. d including own error codes and additional information This system call will not return if there is no error hook If an error hook is available the code of the error hook can decide to return or not 3 8 2 Syntax void sc_miscError sc_errcode_t err sc_extra_t misc 3 8 3 Parameter err User defined error code error User error code SC ERR SYSTEM FATAL Declares error to be system fatal Must be ored with error SC ERR MODULE FATAL Declares error to be module fatal Must be ored with error SC ERR PROCESS FATAL Declares error to be process fatal Must be ored with error misc Additional data to pass to the error hook 3 8 4 Return Value None 3 8 5 Example sc miscError MY ERR BASE MY 01 sc extra t SCP myproc 3 8 6 Errors None SCIOPTA Real Time Kernel 3 8 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 9 sc miscErrorHookRegister 3 9 1 Description This system call will register an error hook Each time a system error occurs the error hook will be called if there is one installed If the error hook is registered from within the system module it is registered as a global error hook In this case the error hook registering will be done in the start hook If the error hook is registered from within a module which is not the system module it will be registered as a module error hook 3 9 2 Syntax sc errHook t s
107. d to define all existing modules in a system as friend In SCIOPTA each module can select friend modules This has mainly consequences on whether messages will be copied or not 3 12 2 Syntax void sc moduleFriendAll void 3 12 3 Parameter None 3 12 4 Return Value None 3 12 5 Errors None SCIOPTA Real Time Kernel 3 14 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 13 sc_moduleFriendGet 3 13 1 Description This system call is used to inform the caller if a module is a friend The caller will be informed if the module in parameter mid is a friend It returns if the module is member of the friend set of the caller In SCIOPTA each module can select friend modules This has mainly consequences on whether messages will be copied or not 3 13 2 Syntax int sc moduleFriendGet sc moduleid t mid 3 13 3 Parameter mid Module ID The ID of the module which will be checked if it is a friend or not 3 13 4 Return Value 0 if the module is not a friend not included in friend set 1 0 if the mModule is a friend included in the friend set 3 13 5 Errors Error Code i Error Type Extra Value KERNEL EILL MODULE SC ERR SYSTEM FATAL Module ID not valid mid gt SC MAX MODULE Module ID SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 15 SC 3 System Calls Reference 3 14 moduleFriendNone 3 14 1 Description This system call
108. daemon defined in the system KERNEL EILL PROC 5 ERR MODULE FATAL Parameter name not valid Pointer to process name KERNEL EILL PRIORITY i SC ERR MODULE FATAL Illegal priority 2 231 Requested priority KERNEL EILL PROCTYPE SC ERR MODULE FATAL Illegal process type Process type KERNEL EILL SLICE SC ERR MODULE FATAL Illegal slice value Slice SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 83 SC 3 System Calls Reference Error Code i Error Type Extra Value KERNEL EILL STACKSIZE i SC ERR MODULE FATAL Stack not valid Requested stacksize KERNEL EILL MODULE 5 MODULE FATAL Module cb is not valid Module ID KERNEL MORE ERR MODULE FATAL Number of maximum processes reached No of processes KERNEL EOUT OF MEMORY i SC ERR MODULE FATAL Size does not fir into module memory SCIOPTA Real Time Kernel 3 84 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em 3 54 sc procPrioGet 3 54 1 Description This process is used to get the priority of a prioritized process In SCIOPTA the priority ranges from 0 to 31 0 is the highest and 31 the lowest priority 3 54 2 Syntax SC prio t sc procPrioGet SC pid t pid 3 54 3 Parameter pid Process ID pid Process ID of the process to be killed SC CURRENT PID Current running caller process 3 54 4 Return Value Priority of any given process if parameter pid wa
109. ded characters are A Z a z 0 9 and un derscore entry Pointer to process function This is the address where the created process will start execution stacksize Process stack size The kernel will use one of the fixed message buffer sizes from the message pool which is big enough to include the stack Add 128 bytes for the process control block pcb and 32 bytes for the process name to your process stack to calculate the minimum stacksize 160 bytes vector Interrupt vestor Interrupt vector connected to the created interrupt process This is CPU dependent prio N A Must be set to 0 reserved for later use SCIOPTA Real Time Kernel 3 68 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e state N A Must be set to O reserved for later use plid Pool ID Pool ID from where the message buffer which holds the stack and the pcb will be allocated 3 46 4 Return Value ID of the created process 3 46 5 Example hello pid sc procIntCreate process name SCI tick process func void void SCI tick stacksize 256 vector 25 priority xy state 0 pool id SC DEFAULT POOL 3 46 6 Errors Error Code i Error Type Extra Value KERNEL ENO KERNELD i SC ERR PROCESS FATAL There is no kernel daemon defined in the system KERNEL EILL PROC NAME SC ERR MODULE FATAL Parameter name not valid Pointer to proce
110. duleCreate parameter textsize renamed into initsize Parameter name Valid characters modified to Recommended characters e Chapter 6 12 3 sc moduleFriendGet return value 1 modified to e Chapter 6 13 2 tick last paragraph added e Chapter 6 15 2 sc triggerWait parameter tmo better described e Chapter 6 19 1 sc miscErrorHookRegister function and parameter newhook are of type pointer Global and Module error hook difference described Chapter 6 19 2 sc msgHookRegister function and parameter newhook are of type pointer e Chapter 6 19 3 sc poolHookRegister function and parameter newhook are of type pointer Global and Module pool hook difference described e Chapter 6 19 4 sc procHookRegister function and parameter newhook are of type pointer Global and Module process hook difference described e Chapter 7 7 2 7 Example system call sc procIdGet parameter corrected e Chapter 7 11 4 Error Hook Declaration Syntax return value 0 modified e Chapter 7 11 6 Error Hooks Return Behaviour added e Chapter 9 10 i MX27 System Functions and Drivers added Chapter 9 22 LOGIC i MX27 LITEKIT added e Chapter 13 3 Eclipse IDE and GNU GCC rewritten e Chapter 15 3 Function Codes code 0 0 Ox3E Ox3F 0x57 0 5 Ox5D 0 5 and Ox5F added Chapter 15 4 Error Codes code 0x016 0x017 and 0x018 added e Chapter 16 9 3 Debug Configuration Stack Check added to the list 5 5 Manual
111. ed It can only be activated after the old time slice has elapsed 3 59 2 Syntax void sc procSliceSet Sc pid t pid sc ticks t slice 3 59 3 Parameter pid Process ID pid Process ID of the process to set the time slice SC CURRENT PID Current running caller process slice New period of time between calls to the timer process in ticks 3 59 4 Return Value None 3 59 5 Example sc procSliceSet 5 CURRENT PID 5 SCIOPTA Real Time Kernel 3 92 Manual Version 4 1 Reference Manual 3 System Calls Reference 5 em 3 59 6 Errors Error Code i Error Type KERNEL EILL PROCTYPE SC ERR PROCESS FATAL Caller is not a prioritized or timer process KERNEL EILL PID SC ERR MODULE WARNING Process Module disappeared KERNEL EILL PID SC ERR PROCESS WARNING Illegal pid KERNEL EILL PID SC ERR MODULE FATAL Illegal pid SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 Extra Value Process type Process ID Process ID Process ID 3 93 SC 3 System Calls Reference 3 60 procStart 3 60 1 Description This system call will start a prioritized or timer process SCIOPTA maintains a start stop counter per process If the counter is gt 0 the process is stopped Each time a process calls sc procStart the counter will be decremented If the counter has reached the value of 0 the process will start If the started process is a prioritized
112. ei RE 3 35 e poolCr ate i eter etes ee 3 35 1 MDGS CHIUPULOM cages 3 35 2 aA eet Ree EE 3 35 3 See SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 5 em SC IOPTA Table of Contents 3 35 4 Val EM 3 51 3 35 5 Example ne 3 51 3 35 6 luo a 3 51 3 36 SCs POOMDC MAUI e 3 52 3 36 1 Description eret ere hei ente tec deti Senta penale 3 52 3 36 2 de 3 52 3 36 3 EE 3 52 3 36 4 Return 3 52 3 36 5 niea pies ERREUR RD irte 3 52 3 36 6 iss M Pe 3 52 3 37 sc poolHookRegister onion Rue ene rie DES E Ree RR OH ees 3 53 3 37 1 b espiy 3 53 3 37 2 ottiene Deae irte an dan de he Det ur eee 3 53 3 37 3 Paramete 3 53 3 37 4 Val e RR 3 53 3 37 5 BUX AUN e 3 53 3 37 6 ls EE 3 54 3 38 SC OOH AGEL os cers 3 55 3 38 1 Description iiu
113. ents 3 80 6 ls d Rm 3 123 3 81 3 124 3 81 1 Descriptions acne OD RR OR HER E RESO EE 3 124 3 81 2 DY TAK e 3 124 3 81 3 E EM 3 124 3 81 4 ioni cc M 3 124 3 81 5 Example 3 124 3 81 6 ete eie Isai nates 3 124 3 82 sc triggerValueGet eant eene ero Ent E IER sete ER di e eade 3 125 3 82 1 07 M 3 125 3 82 2 REIR 3 125 3 82 3 Parameter 3 125 3 82 4 V alte vz UEu aE 3 125 3 82 5 locuni m 3 125 3 82 6 lor me EE 3 125 3 83 5 Ix 3 126 3 83 1 ementi n eo OE E egos ew 3 126 3 83 2 uu es 3 126 3 83 3 EET 3 126 3 83 4 IUBE CRRRRMMMMMMMMEMMMMMMEMMEMMMMMEMMMMEMMMMMMMMMMMMEMMMMMMMMMMMMMMM 3 126 3 83 5 bxample cec ewm etie ean sc dii rec rere edere tpe Se 3 126 3 83 6 PED cece eeepc ee 3 126 3 84 tiere Walt iege aen ae DI ERES E Gee
114. er 3 8 miscError on page 3 8 sc miscErrorHookRegister Registers an Error Hook Chapter 3 9 miscErrorHookRegister on page 3 9 2 12 SCIOPTA Simulator SCSIM Calls sciopta start starts a SCIOPTA WIN32 Kernel Simulator application Chapter 3 86 sciopta start on page 3 130 sciopta end Terminates a SCIOPTA WIN32 Kernel Simulator application Chapter 3 85 sciopta end on page 3 129 SCIOPTA Real Time Kernel 2 6 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 System Calls Reference 3 1 Introduction This chapter contains a detailed description of all SCIOPTA kernel system calls in alphabetical order Please consult the SCIOPTA Kernel User s Manuals for more information on how to use the system calls and about the objects and behaviour of the SCIOPTA system 3 2 sc connectorRegister 3 2 1 Description This system call is used to register a connector process The caller becomes a connector process Connector processes are used to connect different target in distributed SCIOPTA systems Messages sent to exter nal processes residing on remote target or CPU are sent to the local connector processes 3 2 2 Syntax SC pid t sc connectorRegister int defaultConn 3 2 3 Parameter defaultConn Defines the type of registered CONNECTOR E The caller becomes a connector process The name of the process corresponds to the name of the target 0 The call
115. er 5 13 1 2 Module Sizes name is now module name size was module name free before Chapter 5 13 3 IAR Systems Embedded Workbench Linker Script added Chapter 5 14 Data Memory Map redesigned and now one memory map for all environments Chapter 5 14 4 IAR Systems Embedded Workbench added Chapter 6 Board Support Packages file lists modified for SCIOPTA ARM version 1 7 2 5 Chapter 6 3 ATMEL AT96SAM7S EK Board added Chapter 6 4 ATMEL AT96SAM7X EK Board added e Chapter 6 5 Systems STR711 SK Board added SCIOPTA Real Time Kernel 5 8 Manual Version 4 1 Reference Manual 5 Manual Versions SC IOPTA d 5 10 2 Manual Version 2 1 e Chapter 1 1 About this Manual SCIOPTA product list updated Chapter 2 4 1 Main Installation Window Third Party Products new version for GNU Tool Chain version 1 4 and MSys Build Shell version 1 0 10 Chapter 2 4 7 GNU Tool Chain Installation new GCC Installation version 1 4 including new gcc version 3 4 4 new binutils version 2 16 1 and new newlib version 1 13 1 The installer creates now two directories and not three e Chapter 2 4 8 MSYS Build Shell new version 1 0 10 e Chapter 3 Getting Started Equipment new versions for GNU GCC and MSys e Chapter 3 Getting Started List of copied files after executed copy files bat removed e Chapter 3 5 1 Description Web Server paragraph rewritten e Chapter 3 13 2 1 Equipment serial cable connection correc
116. er becomes the default connector for the system The name of the process corresponds to the name of the target 3 2 4 Return Value Process ID which is used to define the process ID for distributed processes 3 2 5 Example Sc pid t connid connid connectorRegister 1 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 1 3S stem Calls Reference SCIOPTA y e I mgesl 3 2 6 Errors Error Code i Error Type Extra Value KERNEL EALREADY DEFINED i SC ERR SYSTEM FATAL Default CONNECTOR is already defined pid Process is already CONNECTOR 0 KERNEL ENO MORE CONNECTOR The maximum number of CONNECTORS is reached SCIOPTA Real Time Kernel 3 2 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 3 sc connectorUnregister 3 3 1 Description This system call is used to remove a registered connector process The caller becomes a normal prioritized process 3 3 2 Syntax void sc connectorUnregister void 3 3 3 Parameter None 3 3 4 Return Value None 3 3 5 Example sc connectorUnregister 3 3 6 Errors Error Code i Error Type Extra Value PCB FLAGS gt 5 ERR SYSTEM FATAL Caller is not a connector process SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 3 SC 3 System Calls Reference 3 4 sc miscCrc 3 4 1 Description This function calculates a 16 bit cyclic redundancy check v
117. er file pool h struct sc pool cb s SC save poolid t poolid Sc save voidptr t start Sc save voidptr t eng Sc save voidptr t cur Sc save uint t lock SC save uint t nbufsizes Sc save plsize t size Sc save pid t creator Sc save bufsize t bufsizes SC NUM BUFFERSIZES idbl t freed SC MAX NUM BUFFERSIZES idbl t waiter SC MAX NUM BUFFERSIZES char name SC POOL NAME SIZE 1 dif SC MSG STAT SC pool stat t stat endif pool cb t 3 39 6 Structure Members 5 em poolid Pool ID start Start of pool data area end End of pool first byte not in pool cur First free byte inside pool lock Lock setting Not locked if 0 nbufsizes Number of buffer sizes size Complete pool size SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 57 SC 3 System Calls Reference creator Process which created the pool bufsizes Array of buffers freed List of free d buffers waiter List of processes waiting for a buffer name Pointer to pool name stat Statistics information See chapter 3 39 7 Pool Statistics Info Structure on page 3 58 3 39 7 Pool Statistics Info Structure The pool statistics info is a structure inside the pool control block containing containing pool statistics information It is included in the header file pool h struct sc pool stat s
118. ere tie leise rp vua 3 44 1 Description oos eue nie RH OH PEERS 3 44 2 DD VIMAR i 3 44 3 sene tier 3 44 4 Return 3 44 5 RT OE ERO RE RR ee 3 44 6 t LL T 3 45 3 45 1 Ib eap m 3 45 2 3 45 3 ParamMeter cccccccccscsssscccecesesscececesesseaeecesessnececesensecececessaseececesensnaeccecessaaeeeecsessaeaeecs 3 45 4 Pei rei dese 3 45 5 procIdGet in Interrupt 3 45 6 Example usse RERO aki 3 45 7 ls REL NL TIT 3 46 SC 3 46 1 ID eai 3 46 2 Muri 3 46 3 Parame niente 3 46 4 enatis i tico 3 46 5 Example 3 46 6 E E SERERE 3 47 Se Proc PH 3 47 1 IDeSCrIptIOn ecce ente ide e 3 47 2 d M 3 47 3 C C
119. eseceeees 4 1 4 2 Include Piles teer ere ERE EE PES 4 2 4 3 Function Codes 4 3 4 4 Error 4 6 4 5 Error 4 7 5 Manual AE EOI i KEE 5 1 Version MERERETUR 5 1 SCIOPTA Real Time Kernel XII Manual Version 4 1 Reference Manual Table of Contents SC IOPTA d 52 53 54 5 5 5 6 5 7 5 8 5 8 1 5 8 2 5 8 3 5 8 4 5 8 5 5 8 6 5 8 7 5 8 8 5 8 9 5 9 5 9 1 5 9 2 5 9 3 5 9 4 5 9 5 5 9 6 5 9 7 5 9 8 5 10 5 10 1 5 10 2 5 10 3 5 10 4 5 10 5 6 Manual VersiOm4 erret pe ripe Ee er Ee WS TEMPI Eee E AES 5 1 Manual Version 3 2 ccccccccecsssesecesesssececesesesseececesesaeeccseeaseececeseaaseeececesseaeccecesueaeceeceaeaeccecesseeeeesenees 5 1 Version NER E X 5 1 Manual Version 3 0 5 2 Mangal Version 2 1 5 5 2 Manual AE I O 1A O 5 2 Former SCIOPTA Kernel User s Guide 800 5 3 Manual Version 1 8 5 3 Mangal Version 1227 5 3 Manual Version 1 6 00220 00 00000000000
120. ess ID specified as sender 3 34 4 Return Value None SCIOPTA Real Time Kernel 3 48 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 34 5 Example Send TEST MSG to process addr as process other sc msg t msg SC pid t addr SC pid t other Qu f msg msgAlloc sizeof test msg t TEST MSG SC DEFAULT POOL SC FATAL IF sc msgTxAlias amp msg sndr 0 other 3 34 6 Errors Same errors as in chapter 3 33 6 Errors on page 3 47 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 49 SCIOPTA em 3 System Calls Reference 3 35 sc poolCreate 3 35 1 Description This system call is used to create a new message pool inside the callers module 3 35 2 Syntax Sc poolid t se poolCreate char start Sc plsize t size unsigned int nbufs sc bufsize t bufsize const char name 3 35 3 Parameter start Start address of the pool start 0 size Start address The kernel will automatically take the next free address in the module Size of the message pool nbufs The minimum size must be the size of the maximum number of messages which ever are allocat ed at the same time plus the pool control block pool cb The size of the pool control block pool cb can be calculated according to the following formula pool cb 68 n 20 stat n 20 n Maximum buffer sizes defined for the whole
121. ess has an errno variable This variable is used mainly by library functions to set the errno variable The errno variable will be copied into the observe messages if the process dies 3 6 2 Syntax Sc errcode t sc miscErrnoGet void 3 6 3 Parameter None 3 6 4 Return Value Process error code 3 6 5 Example if sc miscErrnoGet 104 kprintf 0 Can not connect d n sc_miscErrnoGet 3 6 6 Errors None SCIOPTA Real Time Kernel 3 6 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 7 sc miscErrnoSet 3 7 1 Description This system call is used to set the process error number errno variable Each SCIOPTA process has an errno variable This variable is used mainly by library functions to set the errno variable The errno variable will be copied into the observe messages if the process dies 3 7 2 gt Syntax void sc miscErrnoSet Sc errcode t 3 7 3 Parameter err User defined error code 3 7 4 Return Value None 3 7 5 Example sc miscErrnoSet ENODEV 3 7 6 Errors None SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 7 SC 3 System Calls Reference 3 8 sc miscError 3 8 1 Description This system call is used to call the error hooks with an user error The SCIOPTA error hooks is usually called when the kernel detects a system error But the user can also call the error hook an
122. eter pid Process ID ID of the process which trigger will be activated 3 81 4 Return Value None 3 81 5 Example Sc pid t slave pig slave pid procIdGet slave SC NO sc trigger slave pid 3 81 6 Errors Error Code Error Type Extra Value KERNEL EILL i SC ERR PROCESS FATAL Process is an init or external process Process ID SCIOPTA Real Time Kernel 3 124 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 82 sc triggerValueGet 3 82 1 Description This system call is used to get the value of a process trigger The caller can get the trigger value from any process in the system 3 82 2 Syntax Sc triggerval t triggerValueGet SC pid t pid 3 82 3 Parameter pid Process ID ID of the process which trigger is returned 3 82 4 Return Value Trigger value INT MAX if no valid process 3 82 5 Example SC pid t slave pig sc triggerval t slavetrig Slave pid sc procIdGet slave SC slave trig sc triggerValueGet slave pid 3 82 6 Errors Error Code i Error Type Extra Value KERNEL EILL PID SC ERR PROCESS FATAL Process is an init or external process e0 pid SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 125 SC 3 System Calls Reference 3 83 sc triggerValueSet 3 83 1 Description This system call is used to set the value of a process trigger to any positive value
123. file typedef struct sc procPathGetMsgReply s sc msgid t id Sc pid t pid Sc errcode t error char path 1 procPathGetMsgReply t SCIOPTA Real Time Kernel 3 78 Manual Version 4 1 Reference Manual 3 System Calls Reference 3 51 5 Example sc msg t msg msg procPathGet SC CURRENT PID 1 if strstr msg path path nodel remote node2 node2 echo else remote nodel nodel echo 3 51 6 Errors Error Code i Error Type Extra Value 5 em KERNEL EILL PID SC ERR MODULE FATAL Illegal pid Process ID SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 79 SC 3 System Calls Reference 3 52 sc procPpidGet 3 52 1 Description This call is used to get the process ID of the parent creator of a process 3 52 2 Syntax pid t sc procPpidGet Sc pid t pid 3 52 3 Parameter pid Process ID pid Process ID of the process to be killed SC CURRENT PID Current running caller process 3 52 4 Return Value Process ID of the parent process if the parent process exists Process ID of the parent process of the caller if parameter pid was SC CURRENT SC ILLEGAL PID if the parent process does no longer exist 3 52 5 Example typedef struct key s u8 scan 18 cntrl sckey t define KEYB MSG 0x30000001 typedef struct keyb msg 51 sc msgid t ig Sckey t data keyb msg t sc msg
124. found 3 19 5 Example sc_moduleid_t mid mid sc_moduleIdGet user_01 printf Module s n sc moduleNameGet mid 3 19 6 Errors Error Code i Error Type Extra Value KERNEL EILL MODULE ERR PROCESS FATAL Module ID not valid mid gt SC MAX MODULE mid SCIOPTA Real Time Kernel 3 24 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 20 sc modulePrioGet 3 20 1 Description This system call is used to get the priority of a module 3 20 2 Syntax Sc prio t sc modulePrioGet sc moduleid t mid 3 20 3 Parameter mid Module ID mid Module ID SC CURRENT MID Current module ID module ID of the caller 3 20 4 Return Value Module priority if the module was found and was valid SC ILLEGAL PRIO if the module was not valid mcb SC NIL 3 20 5 Example sc moduleid t mid mid sc moduleIdGet user 01 printf Module Priority u n sc modulePrioGet mid 3 20 6 Errors Error Code i Error Type Extra Value KERNEL EILL MODULE i SC ERR PROCESS FATAL Module ID not valid mid gt SC MAX MODULE mid SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 25 SC 3 System Calls Reference 3 24 sc msgAcquire 3 21 1 Description This system call is used to change the owner of a message The caller becomes the owner of the message The kernel will copy the message into a new message buffer allocated from the defa
125. he Owner Of a Message m M 3 37 Get the Parent PROCESS E E 3 80 Get the Path of Process ies 3 78 Get the Pool ID of a T 3 38 Get the Priority of a Process 3 85 Get the Process Error Number cccccccsssssccessessseceeceessaececeseseeseseeceeeseseceseaeseeecesenseececeseaueaeccecessaeceseeessaeeaees 3 6 Get the Requested Size of a Message 2 3 42 Get the Sender Of a Messag E 3 45 Get the Tick Counter Value uH E OWENS ties p iecit die pie n E 3 116 Get the Time Slice of a Timer Process esses ener eren nnne nente nnns nsns 3 0 Get the Value of a Process ener dit legere base dee ci 3 125 Global Error HOOK ME E Tm T 4 Global Message Hook ag ee edere tige ios E RR e Yo Blog rk 3 35 I unc 1 4 P 1 4 Initialize Process Variable Area 3 105 SCIOPTA Real Time Kernel 6 2 Manual Version 4 1 Reference Manual e 6 Index SCIOPTA a IC
126. he absolute time tick counter value when the process became ready 3 29 2 Syntax msg t sc msgRx sc ticks t tmo void wanted int flag 3 29 3 Parameter tmo Timeout parameter SC ENDLESS TMO Blocks and waits endless until the message is received SC NO TMO No timeout returns immediately Must be set for interrupt and timer processes 0 lt tmo lt SC_TMO_MAX X Timeout value in system ticks Receive with timeout Blocks and waits a specified maximum number of ticks to receive the message If the timeout expires the proc ess will be made ready again and msgRx will return with NULL SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 39 SC 3 System Calls Reference wanted Pointer to the message or pid array ptr Pointer to the message or process ID array SC MSGRX ALL messages will be received flag Receive flag More than one value can be defined and must be separated by OR instructions SC MSGRX MSGID An array of wanted message IDs is given SC MSGRX PID An array of process 5 from where sent messages are received is given SC MSGRX NOT An array of message ID s is given which will be excluded from receive SC MSGRX BOTH An array of pairs of message ID s and process ID s are given to receive specific messages from specific transmitting processes 3 29 4 Return Value Pointer to the received message if the message has been received The caller becomes owner
127. icks Chapter 3 77 sc_tickMs2Tick on page 3 118 Converts a time from ticks into milliseconds Chapter 3 78 ticKTick2Ms on page 3 119 2 9 Process Trigger Calls sc trigger sc triggerValueGet sc triggerValueSet sc triggerWait Signals a process trigger Chapter 3 81 sc trigger on page 3 124 Returns the value of a process trigger Chapter 3 82 sc triggerValueGet on page 3 125 Sets the value of a process trigger Chapter 3 83 sc triggerValueSet page 3 126 Waits on its process trigger Chapter 3 84 sc triggerWait on page 3 127 2 10 CONNECTOR Process Calls sc_connectorRegister sc_connectorUnregister Register Registers a connector process Chapter 3 2 sc connectorRegister on page 3 1 Removes a registered connector process Chapter 3 3 sc_connectorUnregister page 3 3 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 2 5 SC OPTA 2 System Calls Overview 2 11 Miscellaneous and Error Calls sc miscCrc Calculates a CRC over a specified memory range Chapter 3 4 miscCrc on page 3 4 sc miscCrcContd Calculates a CRC over an additional memory range Chapter 3 5 miscCrcContd on page 3 5 sc miscErrnoGet Returns the error code Chapter 3 6 miscErrnoGet on page 3 6 sc miscErrnoSet Set Sets the error code Chapter 3 7 miscErrnoSet on page 3 7 sc miscError Error call Chapt
128. is used to remove all modules as friends of the caller All modules are removed in the friend set of the caller In SCIOPTA each module can select friend modules This has mainly consequences on whether messages will be copied or not 3 14 2 Syntax void sc moduleFriendNone void 3 14 3 Parameter None 3 14 4 Return Value None 3 14 5 Errors None SCIOPTA Real Time Kernel 3 16 Manual Version 4 1 Reference Manual 3 System Calls Reference 3 15 sc moduleFriendRm 3 15 1 Description 5 em This system call is used to remove a module of the friends of the caller The caller removes the module in parameter mid as friend The module is removed in the friend set of the caller In SCIOPTA each module can select friend modules This has mainly consequences on whether messages will be copied or not 3 15 2 Syntax void sc moduleFriendRm sc moduleid t mid 3 15 3 Parameter mid Module ID Module ID of the old friend to remove 3 15 4 Return Value None 3 15 5 Errors Error Code i Error Extra Value KERNEL EILL MODULE SC ERR SYSTEM FATAL Module ID not valid mid gt SC MAX MODULE SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 Module ID 3 17 SC 3 System Calls Reference 3 16 sc moduleldGet 3 16 1 Description This system call is used to get the ID of a module In contrast to the call sc procIdGet you c
129. ister SC_SET_POOLCREATE_HOOK plHook SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 53 3 System Calls Reference SCIOPTA e 3 37 6 Errors Error Code i Error Type Extra Value KERNEL EILL VALUE SC ERR SYSTEM FATAL Pool hook type not defined Pool hook type SCIOPTA Real Time Kernel 3 54 Manual Version 4 1 Reference Manual 3 System Calls Reference 3 38 sc poolldGet 3 38 1 Description This system call is used to get the ID of a message pool In contrast to the call sc poolldGet you can just give the name as parameter and not a path 3 38 2 Syntax Sc poolid t poolIdGet const char name 3 38 3 Parameter 5 em name Pool name name Pointer to 0 terminated name string NULL Default pool SC Default pool Empty string Default pool 3 38 4 Return Value Pool ID if pool was found SC ILLEGAL POOLID if pool was not found 3 38 5 Example Sc poolid t pl pl poolIdGet fs pool if pl SC ILLEGAL POOLID Sc poolDefault pl 3 38 6 Errors Error Code i Error Extra Value KERNEL EILL NAME SC ERR MODULE FATAL Illegal pool name Pointer to pool name SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 55 SC 3 System Calls Reference 3 39 sc poollnfo 3 39 1 Description This system call is used to get a snap shot of a pool control b
130. ister on page 3 63 Registers a process hook Chapter 3 44 procHookRegister on page 3 64 Returns the process ID of a process Chapter 3 45 procIdGet on page 3 66 Requests the kernel daemon to kill a process Chapter 3 47 sc on page 3 71 Returns the full name of a process Chapter 3 48 procNameGet page 3 73 Request a message to be sent if the given process pid dies process supervision Chapter 3 49 sc procObserve on page 3 75 Checks if the construction of a path is correct Chapter 3 50 procPathCheck on page 3 77 Returns the path of a process Chapter 3 51 sc_procPathGet on page 3 78 Returns the process ID of the parent of a process Chapter 3 52 procPpidGet on page 3 80 Returns the priority of a process Chapter 3 54 procPrioGet on page 3 85 Sets the priority of a process Chapter 3 55 procPrioSet on page 3 87 Locks the scheduler and returns the number of times it has been locked before Chapter 3 56 sc procSchedLock on page 3 89 Unlocks the scheduler by decrementing the lock counter by one Chapter 3 57 procSchedUnlock on page 3 90 Returns the time slice of a timer process Chapter 3 58 sc procSliceGet on page 3 91 Sets the time slice of a timer process Chapter 3 59 procSliceSet page 3 92 SCIOPTA Real Time Kernel Manual Version 4 1 Reference Manual
131. l Version 1 1 System call sc moduleInfo has now a return parameter New system call procPathGet e System call sc moduleCreate formula to calculate the size of the module parameter size added e Chapter 4 12 SCIOPTA Design Rules moved at the end of chapter System Design New chapter 4 6 Addressing Processes Chapter 7 Kernel Error Codes new sequence of sub chapters Smaller font used Chapter 4 10 Error Hook completely rewritten New chapter 4 11 System Start 5 9 8 Manual Version 1 0 Initial version 5 10 Former SCIOPTA ARM Target Manual Versions 5 10 1 Manual Version 2 2 e Back front page Litronic AG became SCIOPTA Systems AG Chapter 2 2 The SCIOPTA ARM Delivery and chapter 2 4 1 Main Installation Window tiny kernel added Chapter 3 Getting Started in the example folder additional directories for boards have been introduced e Chapter 3 Getting Started the Eclipse project files and the file files bat are now stored in the phyCore2294 board sub directory of the example folder Chapter 3 Getting Started the SCIOPTA SCONF configuration file is now called hello xml was hello phyCore2294 xml before Chapter 5 8 3 Assembling with IAR Systems Embedded Workbench added Chapter 5 10 3 Compiling with IAR Systems Embedded Workbench added e Chapter 5 12 3 Linking with Systems Embedded Workbench added Chapter 5 13 1 1 Memory Regions last paragraph added e Chapt
132. lls Reference 3 51 sc procPathGet 3 51 1 Description This call is used to get the full path of a process The path will be returned inside a SCIOPTA message buffer which is allocated by the kernel The kernel sets the caller as owner of the message The user must free the message after use If the process pid does not exist or does not exist any more and the pid has a valid value between min and max the kernel calls the error hook if it exists and generates a warning After returning from the error hook the system call sc procNameGet returns zero If the pid has no valid value out of scope the kernel calls the error hook with a fatal error If there is no error hook he system loops at the error label 3 51 2 Syntax Sc msg t sc procPathGet pid t pid flags t flags 3 51 3 Parameter pid Process ID of the process where the path is requested flags procPathGet flags 0 The full path is returned system name module name process name The short path is returned lt name process name 3 51 4 Return Value Message owned by the caller if the process exists If the return value is nonzero the returned message buffer is owned by the caller and the message is of type sc procPathGetMsgReply t and the message ID is SC PROCPATHGETMSG REPLY The message data contains the 0 terminated ASCII name string of the process The message is defined in the sciopta msg include
133. lock SCIOPTA maintains a pool control block per pool which contains information about the pool System level debug ger or run time debug code can use this system call to get a copy of the control block The caller supplies a pool control block structure in a local variable The kernel will fill the structure with the con trol block data The structure content will reflect the pool control block data at a certain moment which will be determined by the kernel It is therefore a data snap shot of which the exact time cannot be retrieved You cannot directly access the pool control blocks The structure of the pool control block is defined in the pool h include file 3 39 2 Syntax int sc poolInfo sc moduleid t mid sc poolid t plid sc pool cb t info 3 39 3 Parameter mid Module ID where the pool resides of which the control block will be returned plid ID of the pool of which the pool control block data will be returned info Pointer to a local structure of a pool control block This structure will be filled with the pool control block data 3 39 4 Return Value 0 if the pool control block data was successfully retrieved 0 if the pool control block could not be retrieved SCIOPTA Real Time Kernel 3 56 Manual Version 4 1 Reference Manual 3 System Calls Reference 3 39 5 Pool Info Structure The pool info is a structure containing a snap shot of the pool control block It is included in the head
134. m Calls Overview 2 1 Introduction This chapter list all SCIOPTA system calls in functional groups Please consult chapter 3 System Calls Reference on page 3 1 for an alphabetical list 2 2 Message System Calls sc msgAlloc sc msgAllocClr sc msgTx sc msgTxAlias sc msgRx sc msgFree sc msgAcquire sc msgAddrGet sc msgHookRegister sc msgOwnerGet sc msgPoolIdGet sc msgSizeGet sc msgSizeSet sc msgSndGet Allocates a memory buffer of selectable size from a message pool Chapter 3 23 msgAlloc on page 3 29 Allocates a memory buffer of selectable size from a message pool and initializes the message data to 0 Chapter 3 24 msgAllocClr on page 3 32 Sends a message to a process Chapter 3 33 msgTx on page 3 46 Sends a message to a process by setting any process ID Chapter 3 34 msgTxAlias on page 3 48 Receives one ore more defined messages Chapter 3 29 msgRx on page 3 39 Returns a message to the message pool Chapter 3 25 sc msgFree page 3 33 Changes the owner of the message The caller becomes the owner of the message Chapter 3 21 msgAcquire on page 3 26 Returns the process ID of the addressee of the message Chapter 3 22 msgAddrGet on page 3 28 Registers a message hook Chapter 3 26 msgHookRegister page 3 35 Returns the process ID of the owner of the message Chapter 3 27
135. n pointer to a put character function This is used by the kernel internal debug functions idle hook Function pointer to the idle hook SCIOPTA Real Time Kernel 3 130 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 86 4 Return Value None 3 86 5 Errors None SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 131 SC 3 System Calls Reference SCIOPTA Real Time Kernel 3 132 Manual Version 4 1 Reference Manual 4 Kernel Error Codes SCIOPTA e 4 Kernel Error Codes 4 1 Introduction SCIOPTA has many built in error check functions Contrary to most conventional real time operating systems SCIOPTA uses a centralized mechanism for error re porting called Error Hook In traditional real time operating systems the user needs to check return values of sys tem calls for a possible error condition In SCIOPTA all error conditions will end up in the Error Hook This guarantees that all errors are treated and that the error handling does not depend on individual error strategies which might vary from user to user There are two error hooks available A Module Error Hook B Global Error Hook If the kernel detect an error condition it will first call the module error hook and if it is not available call the global error hook Error hooks are normal error handling functions and must be written by the user Depending on the type of error fatal or non fatal
136. ne all Modules as 3 14 Delete Process c GS 3 103 Disable wakeup of a timer or interrupt process 3 111 E Embedded LA 1 2 Enable wakeup of a timer or interrupt process 3 110 Ending SCIOPTA WIN32 Kernel Simulator essent eene enne nre 3 129 E 4 2 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 6 1 SCIOPTA lt gt erno Variable eret ete ace e hich apes 3 6 3 7 Error CHECK dq 4 1 Code pM P S 4 1 Err r Code OT 4 6 Error Punction incessere ERE EEE iva E E 4 3 Error HOOK 3 8 3 9 Include Files e m 4 2 Error EM 3 6 3 7 Error Typ PEU 4 1 Eitor Wy e o AEN 4 7 E E EA 4 2 External Process esas RN ERE EVEN 3 1 F Former SCIOPTA Kernel Reference Manual Versions 5 5 Former SCIOPTA Kernel User s Guide Versions 2 5 3 Former SCIOPTA ARM Target Manual 5 8 Frega Message
137. nfo sc moduleKill sc moduleNameGet sc modulePrioGet Creates a module Chapter 3 10 sc_moduleCreate page 3 10 Returns the ID of a module Chapter 3 16 moduleIdGet on page 3 18 Returns a snap shot of a module control block Chapter 3 17 sc_moduleInfo on page 3 19 Kills a module Chapter 3 18 moduleKill on page 3 22 Returns the full name of a module Chapter 3 19 moduleNameGet on page 3 24 Returns the priority of a module Chapter 3 20 modulePrioGet on page 3 25 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 2 3 wu SCIOPTA em 2 System Calls Overview 2 5 sc moduleFriendAdd sc moduleFriendAIl sc moduleFriendGet sc moduleFriendNone sc moduleFriendRm 2 6 sc poolCreate sc poolDefault sc poolHookRegister sc poolIdGet sc poolInfo sc poolKill sc poolReset 2 7 Timing Calls sc sleep sc tmoAdd sc_tmoRm 2 4 Module Friends System Calls Adds a module to the friends of the caller Chapter 3 11 sc_moduleFriendAdd on page 3 13 Defines all existing modules in a system as friend Chapter 3 12 sc_moduleFriendAll on page 3 14 Informs the caller if a module is a friend Chapter 3 13 sc_moduleFriendGet on page 3 15 Removes all modules as friends of the caller Chapter 3 14 moduleFriendNone on page 3 16 Removes a module of the friends of the calle
138. nt datasize Size of module data segment max process Maximum defined number of processes in the module nprocess Actual number of processes max pools Maximum defined number of pools in the module npools Actual number of pools SCIOPTA Real Time Kernel 3 20 Manual Version 4 1 Reference Manual 3 System Calls Reference 3 17 7 Example sc moduleid t mid sc moduleInfo t usr info int check mid sc moduleIdGet user 01 check sc moduleInfo mid amp usr info 3 17 8 Errors Error Code i Error Type Extra Value 5 em KERNEL SC ERR PROCESS FATAL Parameter info not valid info 0 KERNEL EILL MODULE i SC ERR PROCESS FATAL Module ID not valid mid gt SC MAX MODULE SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 mid 3 21 SC 3 System Calls Reference 3 18 sc 3 18 1 Description This system call is used to dynamically kill a whole module The standard kernel daemon sc kerneld needs to be defined and started at system configuration processes and pools in the module will be killed and removed The system call will return when the whole kill process is done The system module cannot be killed 3 18 2 Syntax void sc moduleKill sc moduleid t mid flags t flags 3 18 3 Parameter mid Module ID mid Module ID of the module to be killed and removed SC CURRENT MID flags
139. nter value when the process became ready 3 84 2 Syntax int sc triggerWait sc triggerval t dec sc ticks t tmo 3 84 3 Parameter dec Decrease value The number to decrease the process trigger value tmo Timeout SC ENDLESS TMO Timeout is not used Blocks and waits endless until trigger SC NO TMO Generates a system error SC FATAL IF TMO Generates a system error O0 tmo SC Timeout value in system ticks Waiting on trigger with timeout Blocks and waits the specified number of ticks for trigger 3 84 4 Return Value SC TRIGGER TRIGGERED if the trigger occurred SC TRIGGER NO WAIT if the process did not swap out SC TRIGGER TMO if a timeout occurred SC TRIGGER WAKEUP if the kernel will wakeup a timer or interrupt process SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 127 SC 3 System Calls Reference 3 84 5 Example sc triggerValueSet 1 sc triggerWait 1 SC ENDLESS 3 84 6 Errors Error Code i Error Type Extra Value KERNEL NOT PRIO SC ERR PROCESS FATAL Illegal process type Process type KERNEL ELOCKED SC ERR MODULE FATAL Interrupts and or scheduler are is locked KERNEL EILL VALUE SC ERR PROCESS FATAL Illegal trigger decrement value lt 0 Time out value tmo value not valid SCIOPTA Real Time Kernel 3 128 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 85 sciopta
140. ntes entere nen 3 8 Cancela Process Observation 3 101 Cancel a Process SupervisiOD ee eter etr teer ee PECES RIDERE Rene FR Loin bera EL Red das 3 101 Change the Owner of a Message 3 26 Change the Sender of Message nce itte ttp ca ee Ir erat epe ERREUR EE EE EEEE EE EE EERU ii 3 48 Check the Path of Process 3 77 Clear a Message Pool 3 61 COMETS nescence NECEM ME 1 3 CONNECTOR Process EE ERR 3 1 CONNECTOR Process 2 5 Convert Milliseconds in System Ticks esses eren rernm rene nennen 3 118 Convert System Ticks in Milliseconds essere eerte ense nennen nennen 3 119 CPU 1 3 S lo 3 4 3 5 Create a Message ree EB o Eur TE seek ab Lane 3 50 Create a MEL E 3 10 C reates a PTOCESS ert ERE Re ko es Ferre Td 3 68 3 82 3 98 D Default POON ptc 3 52 Process 3 108 Deti
141. ntre rite ttbi iine Een tdg Einki ERS EEE 2 5 Miscellaneous and Error Calls set eese teer is bee epe E ca Ele ca p ree tete ca 2 6 SCIOPTA Simulator SCSIM Calls renti tetti rette bebe t epe bant ope ik 2 6 THO GUC EIGN teeth eO eee bote buena 3 1 50 connectorR6glSter aeS Ee 3 1 Ib espe p 3 1 3 1 Parame cedere I DM 3 1 Return AIS M 3 1 D 3 1 los MEE 3 2 eXennuir2eredlincTati c EE 3 3 3 3 ee 3 3 Parame tet NEN UN m 3 3 tete RR existe itte etin E 3 3 Example c P 3 3 RICO RHEINE MI 3 3 3 4 07 3 4 EC 3 4 Parameter T 3 4 Return Ciso EU e EEs 3 4 Example C O 3 4 EO seni Eum
142. ocess if the message is sent to another process If you need to define a new owner without sending the message you could use the sc msgAcquire system call The call sc msgAcquire must be used very carefully as this will pass messages around in a disorderly manner SCIOPTA is not returning the exact amount of bytes requested but will select one of a list of fixed buffer sizes which is large enough to contain the requested number of bytes This list can contain 4 8 or 16 fixed sizes which will be defined when a message pool is created The content of the allocated message buffer is not initialized and can have any random value As SCIOPTA supports multiple pools the caller has to state the pool ID plid from where to allocate the message The pool can only be in the same module as the caller process The caller can define how the system will respond to some limiting system states such as memory shortage in mes sage pools and reply delays due to dynamic system behaviour tmo 3 23 2 Syntax sc msg t sc msgAlloc sc bufsize t size sc msgid t id Sc poolid t plid ticks t tmo 3 23 3 Parameter size The requested size of the message buffer id Message ID The message ID which will be placed at the beginning of the data buffer of the message plid Pool ID from where the message will be allocated pool id Pool ID from where the message will be allocated SC DEFAULT POOL Message will be allocated from the default
143. of the received mes sage NULL if timeout expired The process will be made ready again 3 29 5 Examples wait max 1000 ticks for TEST MSG sc msg t msg sc msgid t sel 2 TEST MSG 0 msg sc msgRx 1000 timeout in ticks sel selection array here message IDs SC MSGRX MSGID type of selection wait endless for a message from processes other than sndr pid sc msg t msg SC pid t sel 2 sel 0 sndr pid sel 1 0 msg sc_msgRx SC_ENDLESS_TMO timeout in ticks here endless sel selection array here process IDs SC_MSGRX_PID SC_MSGRX_NOT type of selection inverted SCIOPTA Real Time Kernel 3 40 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em wait for message from a certain process sc msg t msg sc msgrx t sel 3 sel 0 msgid TEST MSG sel 0 pid testerA pid sel 1 msgid TEST MSG sel 1 pid testerB pid sel 2 msgid 0 sel 2 pid 0 msg msgRx SC ENDLESS timeout in ticks here endless sel selection array here process IDs SC MSGRX PID SC MSGRX MSGID type of selection Wait for any message sc msg t msg msg msgRx SC ENDLESS SC MSGRX ALL SC MSGRX MSGID 3 29 6 Errors Error Code i Error Type Extra Value KERNEL EPROC NOT PRIO SC ERR MODULE FATAL The calling
144. ority module protection Each module contains an init process with process priority 0 which will be created automatically If the module priority of the created module is higher than the effective priority of the caller the init process of the created module will be swapped in The start address of dynamically created modules must reside in RAM 3 10 2 Syntax sc moduleid t sc moduleCreate const char name void init void sc bufsize t stacksize Sc prio t moduleprio char start sc modulesize t size sc modulesize t initsize unsigned int max pools unsigned int max procs SCIOPTA Real Time Kernel 3 10 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 10 3 Parameter name init Pointer to the module name The name is represented by a ASCII character string terminated be 0 The string can have up to 31 characters Recommended characters are A Z a z 0 9 and underscore Function pointer to the init process function stacksize moduleprio This is the address where the init process of the module will start execution Stacksize of the INIT process in bytes Module priority size The priority of the module which can be from 0 to 31 0 is the highest priority Size of the module in bytes initsize The minimum module size can be calculated according to the following formula bytes size mod p 256 stack pools mcb initsize p Number of
145. ple added 5 8 6 Manual Version 1 3 Chapter 6 26 sc msgPoolIdGet return value SC DEFAULT POOL defined Chapter 6 33 sc poolCreate pool size formula added Chapter 2 4 4 Message Pool maximum number of pools for compact kernel added Chapter 4 8 SCIOPTA Memory Manager Message Pools added Chapter 6 9 sc moduleCreate modul size calculation modified Chapter 6 40 sc procCreate 6 45 sc procIntCreate 6 51 sc procPrioCreate and 6 60 sc procTim Create stacksize calculation modified 5 8 7 Manual Version 1 2 Top cover back side Address of SCIOPTA France added Chapter 2 6 Trigger second paragraph At process creation the value of the trigger is initialized to one Chapter 2 6 Trigger third paragraph The triggerWait call decrements the value of the trigger and the calling process will be blocked and swapped out if the value gets negative or equal zero Chapter 2 7 Process Variables second paragraph The tag and the process variable have a fixed size large enough to hold a pointer Chapter 2 7 Process Variables third paragraph Last sentence rewritten Chapter 4 5 3 1 Interrupt Process Declaration Syntax irg src is of type int added Chapter 4 5 6 Idle Process added Chapter 4 10 4 Error Hook Declaration Syntax Parameter user user 0 User error System call sc procRegisterDaemon changed to sc DaemonRegister and sc procUnregisterDaemon changed to sc procDaemonUnregister System call sc miscErrorHookRegiste
146. pool The default pool can be set by the system call sc poolDefault SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 29 3 System Calls Reference 5 em tmo SC ENDLESS TMO SC NO TMO SC FATAL IF TMO 0 tmo lt SC TMO MAX 3 23 4 Return Value Pointer to the allocated buffer if NIL pointer if 3 23 5 Example Allocate TEST MSG from default pool sc msg t msg Allocation timing parameter Timeout is not used Blocks and waits endless until a buffer is available from the message pool A NIL pointer will be returned if there is memory shortage in the message pool A fatal kernel error will be generated if a message buffer of the requested size is not available Timeout value in system ticks Alloc with timeout Blocks and waits the specified number of ticks to get a message buffer tmo SC ENDLESS TMO tmo SC NO TMO and if a buffer of the requested size is available or tmo gt 0 and the system responds within the timeout period tmo SC NO TMO and if a buffer of the requested size is not available or tmo gt 0 and the system does not respond within the timeout period msg msgAlloc sizeof test msg t TEST MSG P SC DEFAULT POOL SC FATAL 3 30 size message id pool index timeout SCIOPTA Real Time Kernel Manual Version 4 1 Reference Manual 3 System Calls Reference SC
147. priority will be put at the end of the list and swapped out Init processes are treated specifically An init process is the first process in a module and does always exist An init process can set its priority on level 32 this is the only process which can have a priority of 32 This will redefine the process and it becomes an idle process The init process should always set its priority to 32 after it has accom plished its initialization work The idle process will be called by the kernel if there are no processes ready for get ting the CPU all are in a waiting state 3 55 2 Syntax void procPrioSet Sc prio t prio 3 55 3 Parameter prio Process priority The new priority of the caller s process 0 31 3 55 4 Return Value None 3 55 5 Example Switch caller to lowest priority sc procPrioSet 31 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 87 3 System Calls Reference SCIOPTA e 3 55 6 Errors Error Code i Error Type Extra Value KERNEL NOT PRIO SC ERR MODULE FATAL Caller is not a prioritized process Process type KERNEL EILL PRIORITY SC ERR PROCESS FATAL Illegal priority SCIOPTA Real Time Kernel 3 88 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 56 sc procSchedLock 3 56 1 Description This system call will lock the scheduler and return the number of times it has been locked before SCIOPTA
148. process and its priority is higher than the priority of the currently running proc ess it will be swapped in and the current process swapped out If the started process is a timer process it will be entered into the timer list with its time slice It is illegal to start a process which was not stopped before 3 60 2 Syntax void procStart pid t pid 3 60 3 Parameter pid Process ID pid Process ID of the process to be started 3 60 4 Return Value None 3 60 5 Example sc procStart proc A pid SCIOPTA Real Time Kernel 3 94 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 60 6 Errors Error Code i Error Type Extra Value KERNEL EILL ERR MODULE WARNING Illegal pcb Process ID KERNEL EILL SC ERR MODULE FATAL Process is caller Process ID Process is init process KERNEL ESTART NOT STOPPED i SC ERR MODULE FATAL Stop counter already 0 Process ID SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 95 SC 3 System Calls Reference 3 601 sc procStop 3 61 1 Description This system call will stop a prioritized or timer process SCIOPTA maintains a start stop counter per process If the counter is gt 0 the process is stopped Each time a process calls sc procStop the counter will be incremented If the stopped process is the currently running prioritized process it will be halted and the next ready process will
149. process uses a timeout and is not a prioritized process KERNEL EILL VALUE SC ERR MODULE FATAL tmo flag with wrong value Likely system is corrupt tmo flag KERNEL EILL PARAMETER i SC ERR MODULE WARNING The flag parameter is wrong This is a warning Upon return the kernel chooses SC MSGRX MSGID KERNEL ELOCKED ERR MODULE FATAL Process would swap but interrupts and or scheduler are is locked SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 41 SC 3 System Calls Reference 3 30 sc msgSizeGet 3 30 1 Description This system call is used to get the requested size of a message The requested size is the size of the message buffer when it was allocated The actual kernel internal used fixed size might be larger 3 30 2 Syntax sc bufsize t sc msgSizeGet sc msgptr t msgptr 3 30 3 Parameter msgptr Pointer to message pointer 3 30 4 Return Value Requested size of the message 3 30 5 Example Get the size of a message msg t msg bufsize t size msg sc msgRx SC ENDLESS TMO SC MSGRX ALL SC MSGRX MSGID size sc msgSizeGet amp msg 3 30 6 Errors Error Code Error Type Extra Value KERNEL PTR SC ERR MODULE FATAL Either pointer to message or pointer to message pointer are Zero 0 Pointer to message pointer SCIOPTA Real Time Kernel 3 42 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em
150. r Chapter 3 15 moduleFriendRm on page 3 17 Message Pool Calls Creates a message pool Chapter 3 35 poolCreate on page 3 50 Sets a message pool as default pool Chapter 3 36 poolDefault on page 3 52 Registers a pool hook Chapter 3 37 poolHookRegister on page 3 53 Returns the ID of a message pool Chapter 3 38 poolIdGet on page 3 55 Returns a snap shot of a pool control block Chapter 3 39 sc poolInfo on page 3 56 Kills a whole message pool Chapter 3 40 sc_poolKill on page 3 60 Resets a message pool in its original state Chapter 3 41 poolReset on page 3 61 Suspends a process for a defined time Chapter 3 73 sc sleep on page 3 113 Request a time out message after a defined time Chapter 3 79 sc tmoAdd on page 3 120 Remove a time out job Chapter 3 80 tmoRm on page 3 122 SCIOPTA Real Time Kernel Manual Version 4 1 Reference Manual 2 System Calls Overview SC IOPTA e 2 8 System Tick Calls sc tick sc tickGet sc tickLength sc tickMs2Tick sc tickTick2Ms Calls the kernel tick function Advances the kernel tick counter by 1 Chapter 3 74 tick on page 3 115 Returns the actual kernel tick counter value Chapter 3 75 tickGet on page 3 116 Returns sets the current system tick length Chapter 3 76 sc tickLength on page 3 117 Converts a time from milliseconds into t
151. r return values better specified System call sc moduleCreate parameter size value code added in Formula System call moduleNameGet return value NULL added System call sc msgAcquire condition modified System Call sc msgAlloc SC DEFAULT POOL better specified SCIOPTA Real Time Kernel 5 4 Manual Version 4 1 Reference Manual 5 Manual Versions SC IOPTA d e Systme Call sc msgHookRegister description modified and return value better specified System call sc msgRx parameters better specified System call sc poolHookRegister return value better specified System call sc procHookRegister return value better specified System call sc procIdGet last paragraph in Description added System calls sc procVarDel sc procVarGet and procVarSet return value 0 introduced e Chapter 7 3 Function Codes errors 0x38 to 0x3d added System call sc procUnobserve added e Chapters 2 5 2 System Module and 4 3 Modules the following sentence was removed The system module runs always on supervisor level and has all access rights e Chapter 2 5 3 Messages and Modules third paragraph rewritten e Chapter 6 31 sc msgTx fifth paragraph rewritten 5 8 8 Manual Version 1 1 e System call sc moduleInfo has now a return parameter New system call procPathGet System call sc moduleCreate formula to calculate the size of the module parameter size added Chapter 4 12 SCIOPTA Design Rules moved at the end
152. re a data snap shot of which the exact time cannot be retrieved You cannot directly access the module control blocks The structure of the module control block is defined in the module h include file 3 17 2 Syntax int sc moduleInfo sc moduleid t mid sc moduleInfo t info 3 17 3 Parameter mid Module ID mid mid SC CURRENT MID Current module ID module ID of the caller info Pointer to a local structure of a module control block See chapter 3 17 5 Module Info Structure on page 3 20 3 17 4 Return Value 1 if the module was found In this case the info structure is filled with valid data 0 if the module was not found SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 19 SC 3 System Calls Reference 3 17 5 Module Info Structure The module info is a structure containing a snap shot of the module control block It is included in the header file modules h typedef struct sc moduleInfo s sc moduleid t mid char name SC MODULE NAME SIZE 1 char text sc modulesize t textsize char data sc modulesize t datasize unsigned int max process unsigned int nprocess unsigned int max pools unsigned int npools moduleInfo t 3 17 6 Structure Members mid Module ID name Name of the module text Current address into module text segment textsize Size of module text segment data Current address into module data segme
153. rror hook is installed SC ERR PROC WARNING 0 40 Warning on process level The system continues if an error hook is installed SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 4 7 SCIOPTA em 4 8 4 Kernel Error Codes SCIOPTA Real Time Kernel Manual Version 4 1 Reference Manual 5 Manual Versions SC IOPTA d 5 Manual Versions 5 1 Manual Version 4 1 Chapter 1 The SCIOPTA System Rewritten 5 2 Manual Version 4 0 e SCIOPTA Manual system restructured and rewritten e Splitted into a Kernel Reference Manual and User s Manual e No target specific manuals Target specific information are included in the Kernel Reference Manual and User s Manual 5 3 Manual Version 3 2 Chapter 2 4 9 GNU Tool Chain Installation rewritten due to CodeSourcery GCC tool chain support e Chapter 3 2 1 Class Diagram replaces old block diagram e Chapter 3 2 3 1 Equipment CodeSourcery GCC tool chain now used e Chapter 6 6 4 sc procKill sc procKill system calls returns before the cleaning work begins removed from the last paragraph e Chapter 13 2 1 Tools CodeSourcery GCC tool chain now used Chapter 13 3 2 Tools CodeSourcery GCC tool chain now used e Chapter 13 4 2 Tools CodeSourcery GCC tool chain now used 5 4 Manual Version 3 1 Chapter 2 4 10 Eclipse Development Tooling rewritten e Chapter 3 Getting Started rewritten Chapter 4
154. s The message given by the sc procObserve system call will be freed by the kernel 3 63 2 Syntax void sc procUnobserve SC pid t pid pid t observer 3 63 3 Parameter pid Supervised process ID pid Process ID of the process which is supervised observer Observer process ID pid Process ID of the observer process SC CURRENT PID Current process is observer 3 63 4 Return Value None 3 63 5 Example procUnobserve slave SC CURRENT PID SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 101 3 System Calls Reference SCIOPTA e 3 63 6 Errors Error Code i Error Type Extra Value KERNEL EILL PID i SC ERR MODULE FATAL Process is caller Process ID Process is init process SCIOPTA Real Time Kernel 3 102 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 60 sc procVarDel 3 64 1 Description This system call is used to remove a process variable from the process variable data area 3 64 2 Syntax int sc procVarDel tag t tag 3 64 3 Parameter tag Process variable tag User defined tag of the process variable which was set by the sc procVarSet call 3 64 4 Return Value if the system call fails and the process variable could not be removed 1 0 if the process variable was successfully removed 3 64 5 Errors Error Code i Error Type Extra Value KERNEL PTR SC ERR PROCESS FA
155. s PM HC OG 3 7 3 8 SCNT TE EET TOOLS 3 8 3 8 1 Description o sierra ete aea ci e VEEE Gee 3 8 3 82 D c 3 8 3 8 3 E 3 8 3 8 4 Return Value CRRERRRRNMMEMMMMMMMMMMMEMMMMEMMMMMEMMMMEMMMMMEMMMMMMMMMMMMMMMEMENHFYHHA 3 8 3 8 5 BEX AUP rem 3 8 3 8 6 lusu 3 8 3 9 sc imiscErrorHookRegister 3 9 3 9 1 3 9 3 9 2 E E cv e euenire ae assueti ni dene eed meine 3 9 3 9 3 P rametet E E 3 9 3 9 4 Return Val e ies re 3 9 3 9 5 M 3 9 3 9 6 3 9 3 10 se todule CEBate etae ses eee et Eee 3 10 3 10 1 Description aua DHT RERO RU RISE IER CUNEO OUR 3 10 3 10 2 e M 3 10 3 10 3 Parameter ceci pe vented cess pee Ea 3 11 3 10 4 Value O EPBRBBER 3 11 3 10 5 Example EE 3 12 3 10 6 eer 3 12 3 11 scmoduleEriendAdd 5 ettet 3 13 3 11 1 lg
156. s any process Priority of the callers process if parameter pid was SC CURRENT 3 54 5 Example Create process proc A with lower priority than caller SC pid t proc A pig SC prio t prio sc procPrioGet 5 CURRENT PID 1 static const sc pdbprio t pdb process type PCB TYPE STATIC PRI process name proc A function name proc A stacksize 1024 pcb 7 0 stack y 10 supervisor flag SC KRN FLAG TRUE FPU flag SC KRN FLAG FALSE spare 0 time slice 0 priority prio proc A pid sco ProcCreate2 const t amp pdb SC STATE 0 0 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 85 3 System Calls Reference SCIOPTA e 3 54 6 Errors Error Code i Error Type Extra Value KERNEL EILL ERR MODULE FATAL Illegal pid Process ID SCIOPTA Real Time Kernel 3 86 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em 3 55 sc procPrioSet 3 55 1 Description This call is used to set the priority of a process Only the priority of the caller s process can be set and modified If the new priority is lower to other ready processes the kernel will initiate a context switch and swap in the process with the highest priority If there are already existing processes at the same priority the process which has just moved to that
157. seececeeceesssececesesaececeseseaasececesesaeeeececessaaeccecessaaececceesaueaeecs 4 6 KBRNEL ENO MOORE POOL ete tites e repo sca Ee ERE 4 6 KBRNEL ENO MOREBE CONNECTOR eet ee oto ec teer tectorio ERE 4 7 KERNEL MORE MODULE ies ro EET eU Lo EE TRE UE 4 6 KERNEL MORE PROC 4 6 KERNEL ENOT OWNER 4 6 KERNEL sss 4 6 KERNEL BOUTSIDE POOL EE HESSE RE EE FEES eas eeu ERR ERE 4 6 KERNEL EPOOL IN USE 2 2 2 2 11 105 nasa stern ganan 4 6 KERNEL EPROC PRIO tel ee epo ea eee EC ERE EVER PER EFE EORR ORE 4 7 KERNEL EPROC 4 7 KERNEL ESTACK OVERFLOW 4 7 SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 6 3 SCIOPTA o madex lt gt KERNEL ESTACK UNDERFLOW 2240 000 ette eese iet tectae bens 4 7 KERNEL ESTART 5
158. ss name KERNEL EILL PROCTYPE SC ERR MODULE FATAL Illegal process type Process type KERNEL EILL PARAMETER SC ERR MODULE FATAL Illegal interrupt vector Interrupt vector SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 69 SC 3 System Calls Reference Error Code i Error Type Extra Value KERNEL EILL STACKSIZE i SC ERR MODULE FATAL Stack not valid Requested stacksize KERNEL EILL MODULE 5 MODULE FATAL Module cb is not valid Module ID KERNEL MORE ERR MODULE FATAL Number of maximum processes reached No of processes KERNEL EOUT OF MEMORY i SC ERR MODULE FATAL Size does not fir into module memory SCIOPTA Real Time Kernel 3 70 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 47 prockKill 3 47 1 Description This system call is used to request the kernel daemon to kill a process The standard kernel daemon sc kerneld needs to be defined and started at system configuration Any process type prioritized interrupt timer can be killed No external processes on a remote CPU can be killed If a cleaning up is executed depending on the flag parameter all message buffers owned by the process will be returned to the message pool If an observe is active on that process the observe messages will be sent to the ob serving processes significant time can elapse before a possible observe message is posted 3 47 2 Syntax
159. ss variables 3 66 4 Return Value None SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 105 3 System Calls Reference SCIOPTA e 3 66 5 Errors Error Code i Error Type Extra Value KERNEL 5 ERR PROCESS FATAL No procVar set or value NULL KERNEL EILL VALUE SC PROCESS FATAL Size too small KERNEL EALREADY DEFINED SC ERR PROCESS FATAL Process variable already set SCIOPTA Real Time Kernel 3 106 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 67 procVarRm 3 67 1 Description This system call is used to remove a whole process variable area 3 67 2 Syntax sc msg t sc procVarRm void 3 67 3 Parameter None 3 67 4 Return Value Pointer to the message buffer holding the process variables 3 67 5 Errors Error Code i Error Type Extra Value KERNEL PTR SC ERR PROCESS FATAL No procVar set or value NULL SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 107 SC 3 System Calls Reference 3 68 sc procVarSet 3 68 1 Description This system call is used to define or modify a process variable 3 68 2 Syntax int procVarSet tag t 132 value 3 68 3 Parameter tag Process variable tag User defined tag of the process variable value Value of the process variable 3 68 4 Return Value 0 if the system call fails and the process
160. static processes stack Sum of stack sizes of all static processes pools 2 Sum of sizes of all message pools mcb Size of module control block see below initsize 2 Code see parameter initsize below where mcb can be calculated as follows mcb 96 friends hooks 4 friends lt 0 if friends are notused 16 if friends are used hooks 2 Number of hooks configured Size of the initialized data max pools Maximum number of pools in the module procs The kernel will not allow to create more pools inside the module than stated here Maximum val ue is 128 Maximum number of processes in the module The kernel will not allow to create more pools inside the module than stated here Maximum val ue is 16384 3 10 4 Return Value Module ID SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 11 SC 3 System Calls Reference 3 10 5 Example extern sc module addr t m2mod my mid sysModuleCreate name m2mod init function m2mod init init stacksize 512 module prio module start char m2mod start module size u32 m2mod size init size 132 m2mod initsize max pools 4 max process 32 3 10 6 Errors Error Code Error Type Extra Value KERNEL ENO KERNELD i SC ERR PROCESS FATAL There is no kernel daemon defined in the system KERNEL EMODULE TOO SMALL i SC ERR SYSTEM FATAL Process
161. system and not the buffer sizes of the created pool Value n can be 4 8 or 16 statProcess statistics or message statistics are used 1 or not used 0 The number of fixed buffer sizes bufsizes This can be 4 8 or 16 It must always be lower or equal of the fixed buffer sizes which is defined for the whole system Pointer to an array of the fixed buffer sizes in ascending order name Pointer to the name of the pool to create 3 50 The name is represented by a ASCII character string terminated by 0 The string can have up to 31 characters Recommended characters are A Z a z 0 9 and underscore SCIOPTA Real Time Kernel Manual Version 4 1 Reference Manual 3 System Calls Reference 3 35 4 Return Value Pool ID of the created message pool 3 35 5 Example static const sc bufsize t bufsizes 8 4 8 16 32 64 128 256 700 myPool plid poolCreate start address 0 total size 4000 number of buffers 8 buffersizes bufsizes name myPool 3 35 6 Errors Error Code i Error Type Extra Value 5 em KERNEL EILL NUM SIZES i SC ERR MODULE FATAL Illegal number of buffer sizes Number of requested buffer sizes KERNEL EILL SIZES i SC ERR MODULE FATAL Illegal buffer sizes Requested buffer sizes KERNEL EILL NAME SC ERR MODULE FATAL Illegal pool name requested Requested pool name KERNEL EOUT OF
162. t msg SC pid t ttyd pid sc procPpidGet SC CURRENT PID msg sc msgAlloc sizeof keyb msg t KEYB MSG 0 SC ENDLESS if msg msg gt keyb data scan key msg gt keyb data cntrl control keys amp msg ttyd_pid 0 SCIOPTA Real Time Kernel 3 80 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 52 6 Errors Error Code i Error Type Extra Value KERNEL EILL PID SC ERR MODULE FATAL Illegal pid Process ID SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 81 SC 3 System Calls Reference 3 53 sc procPrioCreate 3 53 1 Description This system call is used to request the kernel daemon to create a prioritized process The standard kernel daemon sc kerneld needs to be defined and started at system configuration The process will be created within the callers module The maximum number of processes for a specific module is defined at module creation 3 53 2 Syntax SC pid t sc procPrioCreate const char name void entry void sc bufsize t stacksize sc ticks t slice Sc prio t prio int state sc poolid t plid 3 53 3 Parameter name Pointer to process name The name is represented by a ASCII character string terminated be 0 The string can have up to 31 characters Recommended characters are A Z a z 0 9 and un derscore entry Pointer to process function This is the address where
163. the caller If the message queue is empty or no wanted messages are available in the queue the process will be swapped out and another ready process with the highest priority will run If a desired message arrives the process will be swapped in and the wanted list will be scanned again A pointer to an array wanted containing the messages and or process IDs which will be scanned by sc msgRx The array must be terminated by 0 The kernel stores the pointer to the array in the process control block for de bugging A parameter flag flag controls different receiving methods 1 The messages to be received are listed in a message ID array 2 array can also contain process IDs In this case all messages sent by the listed processes are received 3 Youcan also build an array of message ID and process ID pairs to receive specific messages sent from specific processes 4 Also a message array with reversed logic can be given In this case any message is received except the mes sages specified in the array If the pointer wanted to the array is NULL or the array is empty contains only a zero element all messages will be received The caller can also specify a timeout value tmo The caller will not wait swapped out longer than the specified time If the timeout expires the process will be made ready again and sc msgRx will return with NULL The activation time is saved for sc msgRx in prioritized processes The activation time is t
164. the created process will start execution stacksize Process stack size The kernel will use one of the fixed message buffer sizes from the message pool which is big enough to include the stack Add 128 bytes for the process control block pcb and 32 bytes for the process name to your process stack to calculate the minimum stacksize 160 bytes slice Time slice of the prioritized process prio Process priority The priority of the process which can be from 0 to 31 0 is the highest priority SCIOPTA Real Time Kernel 3 82 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em state Process state after creation SC PDB STATE RUN The process will be on READY state It is ready to run and will be swapped in if it has the highest priority of all READY processes SC PDB STATE STP The process is stopped Use the procStart system call to start the process plid Pool ID Pool ID from where the message buffer which holds the stack and the pcb will be allocated 3 53 4 Return Value ID of the created process 3 53 5 Example hello pid procPrioCreate process name hello process func void void hello stacksize 512 slice 0 priority 16 run state SC PDB STATE RUN pool id SC DEFAULT POOL 3 53 6 Errors Error Code i Error Type Extra Value KERNEL ENO KERNELD i SC ERR PROCESS FATAL There is no kernel
165. tly described e Chapter 3 13 2 2 Step By Step Tutorial DRUID and DRUID server setup rewritten Chapter 5 16 Integrated Development Environments new chapter 5 10 3 Manual Version 2 0 Manual rewritten Own manual version moved to version 2 0 5 10 4 Manual Version 1 7 2 Installation all IPS Applications such as Web Server TFTP etc in one product Getting started now for all products e Chapter 4 Configuration now moved into Kernel User s Guide e New BSP added Phytec phyCORE LPC2294 Uninstallation now separately for every SCIOPTA product Eclipse included in the SCIOPTA delivery e New process SCP proxy introduced in Getting Started DHCP Client Example 1 5 libraries now in three verisons standard small and full 5 10 5 Manual Version 1 7 0 Allunion sc msg changed to sc msg t to support SCIOPTA 16 Bit systems NEAR pointer All union sc msg changed to sc msgptr t to support SCIOPTA 16 Bit systems NEAR pointer Allsdd obj t changed to sdd obj t NEARPTR to support SCIOPTA 16 Bit systems Allsdd netbuf t changed to sdd netbuf t NEARPTR to support SCIOPTA 16 Bit systems All sdd objInfo t changed to sdd objInfo t NEARPTR to support SCIOPTA 16 Bit systems Allips dev t changed to ips dev t NEARPTR to support SCIOPTA 16 Bit systems SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 5 9 SC 5 Manual Versions e Allipv4 arp t changed to
166. try xnt sc bufsize t stacksize sc ticks t period sc ticks t initdelay int state sc poolid t plid 3 62 3 Parameter name Pointer to process name The name is represented by a ASCII character string terminated be 0 The string can have up to 31 characters Recommended characters are A Z a z 0 9 and un derscore entry Pointer to process function This is the address where the created process will start execution stacksize Process stack size The kernel will use one of the fixed message buffer sizes from the message pool which is big enough to include the stack Add 128 bytes for the process control block pcb and 32 bytes for the process name to your process stack to calculate the minimum stacksize 160 bytes period Time period Period of time between calls to the timer process in ticks initdelay Initial time delay Initial delay in ticks before the first time call to the timer process SCIOPTA Real Time Kernel 3 98 Manual Version 4 1 Reference Manual 3 System Calls Reference SC em state Process state after creation SC PDB STATE RUN The process will be on READY state It is ready to run and will be swapped in if it has the highest priority of all READY processes SC PDB STATE STP The process is stopped Use the procStart system call to start the process plid Pool ID Pool ID from where the message buffer which holds the stack and the pcb will be allo
167. ult pool if the message resides not in a pool of the callers module and the callers module is not friend to the module where the message resides In this case the message pointer msgptr will be modified Please use sc msgAcquire with care Transferring message buffers without proper ownership control by using sc msgAcquire instead of transmitting and receiving messages with sc msgTx and sc msgRx will cause problems if you are killing processes 3 24 2 Syntax void msgAcquire sc msgptr t msgptr 3 21 3 Parameter msgptr Pointer to the message buffer pointer 3 21 4 Return Value None Example Change owner of a message sc msg t msg msg t msg2 msg sc msgRx SC ENDLESS TMO SC MSGRX ALL SC MSGRX MSGID msg2 msg gt transport msg receive msg indirect sc msgAcquire amp msg2 become owner of the message SCIOPTA Real Time Kernel 3 26 Manual Version 4 1 Reference Manual 3 System Calls Reference SC IOPTA e 3 21 5 Errors Error Code i Error Type Extra Value KERNEL EMSG HD 5 ERR MODULE FATAL Message header is corrupt Or caller tried to acquire an already freed message Pointer to message header KERNEL PTR SC ERR MODULE FATAL Either pointer to message or pointer to message pointer are zero Pointer to message or NIL SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 27 SC 3 System Calls Reference 3
168. void sc msgFree sc msgptr t msgptr 3 25 3 Parameter msgptr Pointer to message pointer 3 25 4 Return Value None 3 25 5 Example Free a message sco msg t msg msg sc msgRx SC ENDLESS TMO SC MSGRX ALL SC MSGRX MSGID sc msgFree amp msg SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 3 33 SC 3 System Calls Reference 3 25 6 Errors Error Code i Error Type Extra Value KERNEL PTR SC ERR MODULE FATAL Either pointer to message or pointer to message pointer are Zero Pointer to message pointer of NIL KERNEL EILL ERR MODULE FATAL Process ID is wrong Process ID KERNEL ENOT OWNER SC ERR MODULE FATAL Process does not own the message Pointer to message header KERNEL EILL MODULE SC ERR MODULE FATAL Module in message header has an illegal value Pointer to message header KERNEL EILL POOL ID SC ERR MODULE FATAL Pool index in message header has an illegal value Pointer to message header KERNEL EMSG HD CORRUPT SC ERR MODULE FATAL Either pool ID or buffersize index are corrupted Pointer to message header KERNEL EOUTSIDE POOL i SC ERR MODULE FATAL The pointer is outside the pool Possible pool id corruption Pointer to message header KERNEL EMSG ENDMARK CORRUPT SC ERR MODULE FATAL Message endmark is corrupt Pointer to message KERNEL EMSG PREV ENDMARK SC ERR MODULE FATAL Endmark of previous message is corrupt Pointer
169. x2C Internal SCIOPTA Real Time Kernel Reference Manual Manual Version 4 1 4 3 5 em 4 Kernel Error Codes Name Number Error Source SC PROCTIMCREATESTATIC Ox2D Internal SC PROCUSRINTCREATESTATIC Ox2E Obsolete SC PROCPRIOCREATE Ox2F procPrioCreate SC PROCINTCREATE 0x30 sc procIntCreate SC PROCTIMCREATE 0x31 sc procTimCreate SC PROCUSRINTCREATE 0 32 SC PROCKILL 0x33 sc procKill SC PROCYIELD 0x34 sc procYield SC PROCOBSERVE 0x35 Sc procObserve SC SYSPROCCREATE 0x36 Internal SC PROCSCHEDLOCK 0x37 5 procSchedLock SC PROCVARGET 0x38 sc procVarGet SC PROCVARSET 0x39 Sc proc VarSet SC PROCVARDEL Ox3A sc procVarDel SC PROCVARRM Ox3B sc procVarRm SC PROCUNOBSERVE Ox3C sc procUnobserve SC PROCPATHGET Ox3D sc procPathGet SC PROCPATHCHECK Ox3E sc procPathCheck SC PROCHOOKREGISTER Ox3F sc procHookRegister SC MODULECREATE 0x40 sc moduleCreate SC MODULEKILL 0 41 sc moduleKill SC MODULENAMEGET 0x42 sc_moduleNameGet SC_MODULEIDGET 0x43 sc_moduleIdGet SC_MODULEINFO 0x44 sc_moduleInfo SC_MODULEPRIOGET 0x46 sc modulePrioGet SC MODULEFRIENDADD 0 47 sc moduleFriendAdd SC MODULEFRIENDRM 0x48 sc moduleFriendRm SC MODULEFRIENDGET 0x49 sc moduleFriendGet SC MODULEFRIENDNON Ox4A 5 moduleFriendNone

Download Pdf Manuals

image

Related Search

Related Contents

PDFファイル    User Guide  Heavy Duty Glass & Multi- Surface Cleaner Concentrate  60130-531 (LHX 20 User Manual englisch_11_08).book  Pour aller plus loin, sitographie : Bibliographie : www  EmpowerSystems Electronic Health Record User Guide  Manual de Instrucciones  Analizador de redes PQ-Box 100 / Software para la  Faça o das características técnicas  

Copyright © All rights reserved.
Failed to retrieve file