2014-09-05 163 views
0

在OIL文件中,總是會有一個名爲「Implementation.oil」的文件包含在內。我找不到解釋這個文件做什麼的東西!她是一個例子: `Osek實現語言

#include "implementation.oil" 
CPU ATMEL_AT91SAM7S256 
{ 
    OS LEJOS_OSEK 
    { 
    STATUS = EXTENDED; 
    STARTUPHOOK = FALSE; 
    ERRORHOOK = FALSE; 
    SHUTDOWNHOOK = FALSE; 
    PRETASKHOOK = FALSE; 
    POSTTASKHOOK = FALSE; 
    USEGETSERVICEID = FALSE; 
    USEPARAMETERACCESS = FALSE; 
    USERESSCHEDULER = FALSE; 
    }; 

    /* Definition of application mode */ 
    APPMODE appmode1{}; 

    /* Definition of Task1 */ 
    TASK Task1 
    { 
    AUTOSTART = FALSE; 
    PRIORITY = 1; /* Smaller value means lower priority */ 
    ACTIVATION = 1; 
    SCHEDULE = FULL; 
    STACKSIZE = 512; /* Stack size */ 
    }; 
` 
+0

谷歌搜索'#include「implementation.oil」'發現,這通常指的是「針對特定平臺的系統對象的規範」。所以這是一個特定於一組目標硬件的文件。 – Ross 2014-09-05 13:14:55

+0

謝謝羅斯,但我正在尋找一個能夠真正理解這個文件應該包含什麼的例子。 – 2014-09-05 13:24:15

回答

2

「實施」部分用於定義值,可以是範圍分配給「CPU」部分中的相應屬性(即,限制任務激活的最大數量,任務優先級等以加快代碼執行或減小代碼大小或其他原因)。將軟件應用程序從一個OSEK/VDX OS實施移植到另一個(例如Trampoline to Erika,Lejos to Trampoline等)時,這非常有用。

1

嗯,如果有人有興趣,這裏是一個implemntation.oil文件的樣子:

IMPLEMENTATION trampoline { 
    OS { 

     ENUM [STANDARD, EXTENDED] STATUS; 
     BOOLEAN STARTUPHOOK = FALSE; 
     BOOLEAN ERRORHOOK = FALSE; 
     BOOLEAN SHUTDOWNHOOK = FALSE; 
     BOOLEAN PRETASKHOOK = FALSE; 
     BOOLEAN POSTTASKHOOK = FALSE; 
     BOOLEAN USEGETSERVICEID = FALSE; 
     BOOLEAN USEPARAMETERACCESS = FALSE; 
     BOOLEAN USERESSCHEDULER = TRUE; 

     BOOLEAN SYSTEM_CALL = FALSE; 
     BOOLEAN DEBUG = FALSE; 
     BOOLEAN INTERRUPTTABLE = FALSE; 
     BOOLEAN PACKED_DATA = FALSE; 
     IDENTIFIER SCHEDULER = osek; 
     BOOLEAN [ 
      TRUE { 
      ENUM [ 
       elxr { STRING SCRIPT = "script.ld"; }, 
       gnu_ld { STRING SCRIPT = "script.ld"; }, 
       mwld { STRING SCRIPT = "script.mcf"; } 
      ] LINKER; 
      ENUM [gcc, ghs, mwc] COMPILER; 
      ENUM [gnu_as] ASSEMBLER; 
      BOOLEAN MEMORY_PROTECTION = FALSE; 
      }, 
      FALSE 
     ] MEMMAP = FALSE; 

     BOOLEAN [ 
      TRUE { 
      STRING APP_SRC[]; 
      STRING CFLAGS[]; 
      STRING CPPFLAGS[]; 
      STRING ASFLAGS[]; 
      STRING LDFLAGS[]; 
      STRING APP_NAME[]; 
      STRING COMPILER[]; 
      STRING ASSEMBLER[]; 
      STRING LINKER[]; 
      }, 
      FALSE 
     ] BUILD = FALSE; 
     BOOLEAN [ 
      TRUE { 
      ENUM [ FILE { STRING NAME; } ] METHOD; 
      ENUM [xml, txt, bin] FORMAT; 
      BOOLEAN TRACE_TASK = TRUE; 
      BOOLEAN TRACE_ISR = TRUE; 
      BOOLEAN TRACE_RESOURCE = TRUE; 
      BOOLEAN TRACE_ALARM = TRUE; 
      BOOLEAN TRACE_USER = TRUE; 
      BOOLEAN DESCRIPTION = TRUE; 
      }, 
      FALSE 
     ] TRACE = FALSE; 
    }; 

    APPMODE { 
      }; 

    TASK { 
     BOOLEAN [ 
     TRUE { 
     APPMODE_TYPE APPMODE[]; 
     }, 
     FALSE 
     ] AUTOSTART; 
     UINT32 PRIORITY; 
     UINT32 ACTIVATION; 
     ENUM [NON, FULL] SCHEDULE; 
     EVENT_TYPE EVENT[]; 
     RESOURCE_TYPE RESOURCE[]; 
     MESSAGE_TYPE MESSAGE[]; 
     UINT32 STACKSIZE = 2000 ; 
     }; 

    ISR { 
     UINT32 [1, 2] CATEGORY; 
     RESOURCE_TYPE RESOURCE[]; 
     MESSAGE_TYPE MESSAGE[]; 
     UINT32 PRIORITY; 
     UINT32 STACKSIZE = 2000 ; 
     }; 
    COUNTER { 
     UINT32 MINCYCLE; 
     UINT32 MAXALLOWEDVALUE; 
     UINT32 TICKSPERBASE; 
     }; 
    ALARM { 
     COUNTER_TYPE COUNTER; 
     ENUM [ 
       ACTIVATETASK { 
        TASK_TYPE TASK; 
        }, 
       SETEVENT { 
       TASK_TYPE TASK; 
       EVENT_TYPE EVENT; 
         } 

       ] ACTION; 
     BOOLEAN [ 
       TRUE { 
       UINT32 ALARMTIME; 
       UINT32 CYCLETIME; 
       APPMODE_TYPE APPMODE[]; 
        }, 
        FALSE 
       ] AUTOSTART; 
      }; 
    EVENT { 
     UINT64 WITH_AUTO MASK; 
      }; 
    RESOURCE { 
     ENUM [ 
      STANDARD, 
     LINKED { 
      RESOURCE_TYPE LINKEDRESOURCE; 
      }, 
     INTERNAL 
     ] RESOURCEPROPERTY; 
     }; 
    MESSAGE { 
    ENUM [ 
     SEND_STATIC_INTERNAL { 
      STRING CDATATYPE; 
      }, 
      RECEIVE_UNQUEUED_INTERNAL { 
       MESSAGE_TYPE SENDINGMESSAGE; 
       UINT64 INITIALVALUE = 0; 
       }, 
      RECEIVE_QUEUED_INTERNAL { 
       MESSAGE_TYPE SENDINGMESSAGE; 
       UINT32 QUEUESIZE; 
       } 
     ] MESSAGEPROPERTY; 

    ENUM [ 
     NONE, 
     ACTIVATETASK { 
      TASK_TYPE TASK; 
     }, 
     SETEVENT { 
     TASK_TYPE TASK; 
     EVENT_TYPE EVENT; 
     }, 
     COMCALLBACK { 
     STRING CALLBACKROUTINENAME; 
     MESSAGE_TYPE MESSAGE[]; 
     }, 
     FLAG { 
     STRING FLAGNAME; 
     } 
     ] NOTIFICATION = NONE; 
     }; 
    COM { 
    BOOLEAN COMERRORHOOK = FALSE; 
    BOOLEAN COMUSEGETSERVICEID = FALSE; 
    BOOLEAN COMUSEPARAMETERACCESS = FALSE; 
    BOOLEAN COMSTARTCOMEXTENSION = FALSE; 
    STRING COMAPPMODE[]; 
    ENUM [ 
      COMSTANDARD, 
      COMEXTENDED 
      ] COMSTATUS = COMSTANDARD; 
    }; 
    NM { 
    }; 
};