-   
 cre_flg
 acre_flg
 
-   
 ER      cre_flg (ID flgid, T_CFLG *pk_cflg );
 ER_ID   acre_flg ( T_CFLG *pk_cflg );
 
|  |  |  | 
|  | 
 ID      flgid;
 | 
 ID number of the eventflag.
 | 
|  | 
 T_CFLG  *pk_cflg;
 | 
 Pointer to the packet containing the eventflag creation information.
 | 
 
 [Eventflag creation information packet : T_CFLG]
 
 
| 
 typedef struct  t_cflg {
     ATR     flgatr;         /*Eventflag attribute*/
     FLGPTN  iflgptn;        /*Initial bit pattern*/
 } T_CFLG;
 | 
 
 This service call can be called from tasks that belong to 
Trusted Domain.
 
 The cre_flg creates a eventflag with eventflag ID indicated by 
flgid according to the content of 
pk_cflg. The acre_flg creates a eventflag according to the content of 
pk_cflg, and returns the created eventflag ID.
 
 1 )	 Eventflag attribute (
flgatr)
The following are specified for 
flgatr.
 
   flgatr := ( ( TA_TFIFO || TA_TPRI  | ( TA_WSGL || TA_WMUL ) | [TA_CLR] )
 -	 
TA_TFIFO ( = 0x0000)
Task wait queue is managed in FIFO order.
 
 -	 
TA_TPRI ( = 0x0001)
Task wait queue is managed in task current priority order. Among tasks with the same priority, they are queued in FIFO order. 
When TA_CLR attribute is not specified, even if there is the TA_TPRI attribute specified, the queue is managed in the same way as for the TA_TFIFO attribute. This behavior falls outside 
mITRON4.0 specification.
 
 -	 
TA_WSGL ( = 0x0000)
Does not permit multiple tasks to wait for the eventflag.
 
 -	 
TA_WMUL ( = 0x0002)
Permit multiple tasks to wait for the eventflag.
 
 2 )	 Initial bit pattern (
iflgptn)
Specify initial eventflag bit pattern.
 
 
|  |  |  | 
|  |  | 
 Normal completion of acre_flg. (Created eventflag ID)
 | 
|  |  | 
 Normal completion of cre_flg.
 | 
|  |  | 
 -	 Either of bits in flgatr  except bit0, bit1 and bit2 is 1.
 | 
|  |  |  | 
|  |  | 
 Invalid ID number. (only for cre_flg)
 | 
|  |  | 
 -	 This service call was issued in the CPU locked state.
 
 -	 This service call was issued from non-task.
 
 -	 This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
 | 
|  |  | 
 -	 Stack pointer points out of user stack for invoking task.
 
 -	 The operand-read access to the area indicated by pk_cflg  has not been permitted to the invoking task.
 | 
|  |  | 
 -	 The invoking task does not belong to trusted domain.
 | 
|  |  | 
 No ID number available.(only for acre_flg)
 | 
|  |  | 
 Object state error. (only for cre_flg)
 
 -	 The eventflag specified by flgid  exists.
 |