RivieraWaves系统 RW-BT-KERNEL-SW-FS.pdf

所需积分/C币:50 2019-06-20 15:36:53 1.64MB PDF
收藏 收藏
举报

RivieraWaves系统 RW-BT-KERNEL-SW-FS.pdf, 讲解RivieraWaves微系统,英文版。
ivieraWaves Title: RivieraWaves Kernel Document type: Functional Specifications Reference: RW-BT-KERNEL-SW-FS Version: 1.1 Release Date: 2012-05-23 1 Table of contents Revision History… 2 1 Table of contents mmmmmmmmm.........onm.m..ms 3 2 List of tables 3 Overview ,5 3.1 Feature list 3.2 Source file Structure 3.3|nc| ude files∴ 垂垂。 3.4 Kernel Environ ment… 4 Messages………,…,…,…,…,,,,…,,…,……,,…….……,,,………,,…,………7 4.1 Overview 4.2 Message Object. 4.3 Message Identifier 4.4 Parameter Management……,… 4.5 Message Queue Object 4.6 Message Queue Primitives 4.6.1 Message allocation 7788889 4.6.2 Message send 4.6.3 Message Send basic… 4.6.4 Message Forward 10 4.6.5 Message free… ∴10 5 Scheduler 11 5.1 Overview 11 5.2 Requirements 11 5.2.1 Priority Management 11 5.2.2 Scheduling Algorithm 12 5.2.3 Save service 里,, 12 6 Tasks 13 6.1 Definition .13 7 Kerne| Timer….. 14 7.1 Overview 7.2 Time definition 14 7.3Ti Obiect 74 Timer Setting.…… 14 7.5 Timer primitives 15 7.5.1 imer set 15 7.5.2 Timer Clear 15 7.5.3 Timer Activity 7.5.4 Timer Expiry 8 Effective macros ……17 Confidential -C 2012 Riviera Waves Page 3 of 17 ivieraWaves Title: RivieraWaves Kernel Document type: Functional Specifications Reference: RW-BT-KERNEL-SW-FS Version: 1.1 Release Date: 2012-05-23 2 List of tables Confidential -C 2012 Riviera Waves Page 4 of 17 ivieraWaves Title: RivieraWaves Kernel Document type: Functional Specifications Reference: RW-BT-KERNEL-SW-FS Version: 1.1 Release Date: 2012-05-23 Overview 3.1 Feature list Riviera Waves Kernel is a small and efficient real Time Operating System, offering the following features Exchange of messages Message say Timer functionalit The kernel also provides an event functionality used to defer actions 3.2 Source file structure Fille Description ke config. h Contains all the constants that can be changed in order to tailor the kernel ke env.c,, h Contains the kernel environment definition ke event. c, h Contains the event handling primitives ke mem. c: h Implementation of the heap management module ke msg. C, h This file contains the scheduler primitives called to create or delete a task. It contains also the scheduler itself ke_ queue.c;h Contains all the functions that handle the different queues (timer queue, save queue, user queue) ke task. c,, h Contains the implementation of the kernel task management. ke timer. c,. h Contains the scheduler primitives called to create or delete a timer task. It contains also the timer scheduler itself Table 3. 1: Kernel files list 3.3 Include files In order to use the services offered by the kernel the user should include the following files: ke task. h ke timer h Confidential -C 2012 Riviera Waves Page 5 of 17 ivieraWaves Title: RivieraWaves Kernel Document type: Functional Specifications Reference: RW-BT-KERNEL-SW-FS Version: 1.1 Release Date: 2012-05-23 3.4 Kernel environment The kernel environment structure contains the three queues used for the event timer and message management. evt tield queue of sent messages but not yet delivered to receiver queue sent Queue of sent messages but not yet delivered to receiver. queue saved: Queue of messages delivered but not consumed by receiver queue timer Queue of timer block first. Pointer to first element of lin ked list If kernel profiling is enabled, the following fields are added max heap_ used: Maximum heap memory used by the kernel queue timer Queue of messages delivered but not consumed by receiver Confidential -C 2012 Riviera Waves Page 6 of 17 ivieraWaves Title: RivieraWaves Kernel Document type: Functional Specifications Reference: RW-BT-KERNEL-SW-FS Version: 1.1 Release Date: 2012-05-23 4 Messages 4.1 Overview Message queues provide a mechanism to transmit one or more message to a task two queues are defined queue sent Queue of sent messages but not yet delivered to receiver queue saved: Queue of messages delivered but not consumed by receiver Transmission of messages is done in 3 steps Allocation of a message structure by the sender task Filling of the message parameters Message structure pushed in the kernel A message is identified by a unique id composed of the task type and an increasing number the following macro builds the first message id of a task #define KE_FIRST_MSG(task((ke_msg_id t(task )<< 10)) TASK_TYPE [15:10 IC 19. C A message has a list of parameters that is defined in a structure (see chapter Message object) Message Object 4.2 Message object The structure of the message contains hdrs List header for chaining hci ty Type of Hci data (used by the hcl only) hci off offset of the HCi data in the message(used by the Hcl only) hci ler Length of the HCi traffic(used by the HCl only) id Message identifi dest id: Destination kernel identifier src Source kernel identifi param_ len Parameter embedded structure length param: Parameter embedded structure Must be word-aligned 4.3 Message Identifi Message ldentifier is defined as follow pedef uint16 t ke_ msg_id t; The message identifier should be defined by task type in one file only to avoid multiple identical definitions In xx task. h for xx task Confidential -C 2012 Riviera Waves Page 7 of 17 ivieraWaves Title: RivieraWaves Kernel Document type: Functional Specifications Reference: RW-BT-KERNEL-SW-FS Version: 1.1 Release Date: 2012-05-23 4.4 Parameter management During message allocation the size of the parameter is passed and memory is allocated in the kernel heap. In order to store this data, the pointer on the parameters is returned the scheduler frees this memory after the transition completion void*ke_msg_ alloc(ke_ msg_id t const id, ke task id t const dest id ke task id t const src id uint16 t const param_ ler struct ke msg msg =(struct ke_msg*)ke_ malloc(sizeof(struct ke_msg)+ param len-sizeof ( uint32_tD return param_ pti 4.5 Message Queue object A Message queue is defined as a linked list composed of message element first: pointer to first element of the list pointer to the last element If kernel profiling is enable those following field are added cite number of element in the list maxent max number of element in the list mincnt in number of element in the list 4.6 Message Queue Primitives 4.6.1 Message Allocation Prototype void *ke_msg_alloc(ke_msg_id t const id ke task id t const dest id ke task id t const src id uint16 t const param_len) Parameters: Type Parameters Description ke_ msg_id ke task id t i dest id Destination Task Identifier ke task id t src id Source task identifier uint 16 t param len Length of parameter Confidential -C 2012 Riviera Waves Page 8 of 17 ivieraWaves Title: RivieraWaves Kernel Document type: Functional Specifications Reference: RW-BT-KERNEL-SW-FS Version: 1.1 Release Date: 2012-05-23 Return Pointer to the parameter member of the ke msg if the parameter structure is empty the pointer will point to the end of the message and should not be used (except to retrieve the message pointer or to send the message) Description This primitive allocates memory for a message that has to be sent the memory is allocated dynamically on the heap and the length of the variable parameter structure has to be provided in order to allocate the correct size 4.6.2 Message Send Prototype: void ke msg_ send (void const *param_ ptr) Parameters Type Parameters Description void const param ptr Pointer to the parameter member of the message that should be sent Return: None Description: Send a message previously allocated with any ke_ msg alloc( like functions. the kernel will take care of freeing the message memor Once the tunction have been called, it is not possible to access its data anymore as the kernel may have copied the message and freed the original memory 4.6.3 Message send Basic Prototype: void ke_msg_send basic(ke_ msg_id t const id, ke task id t const dest id ke task id t const src id) Parameter Type Parameters Description id t id Message identifi ke task id t dest id Destination Task ldentifier ke task id t src id Source Task identifier Return None Description Send a message that has a zero length parameter member no allocation is required as it will be done internally Confidential -C 2012 Riviera Waves Page 9 of 17 ivieraWaves Title: RivieraWaves Kernel Document type: Functional Specifications Reference: RW-BT-KERNEL-SW-FS Version: 1.1 Release Date: 2012-05-23 4.6. 4 Message Forward Prototype void ke_msg_ forward (void const*param_ptr, ke task id t const dest id ke task id t const src id) Parameters Tvpe Parameters Description yoid const param pt Pointer to the parameter member of the message that should be sent ke task id t dest id Destination Task Identifier ke_task_id_t src id Source Task identifier Return none Description Forward a message to another task by changing its destination and source tasks ids 4.6.5 Message free Prototype void ke_ msg_ free(struct ke msg const*msg) Parameters Type Parameters Description struct ke msg const米 msg Pointer to the message to be freed Return None Description: Free allocated message Confidential -C 2012 Riviera Waves Page 10 of 17

...展开详情
试读 17P RivieraWaves系统 RW-BT-KERNEL-SW-FS.pdf
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    一个资源只可评论一次,评论内容不能少于5个字
    k文 垃圾文档,一点用都没有。大家千万别上当。别下载。
    2020-03-20
    回复
    zzlqzzlq 感谢分享,这个也许有用
    2019-09-06
    回复
    • 签到新秀

      累计签到获取,不积跬步,无以至千里,继续坚持!
    • 分享王者

      成功上传51个资源即可获取
    关注 私信 TA的资源
    上传资源赚积分,得勋章
    最新推荐
    RivieraWaves系统 RW-BT-KERNEL-SW-FS.pdf 50积分/C币 立即下载
    1/17
    RivieraWaves系统 RW-BT-KERNEL-SW-FS.pdf第1页
    RivieraWaves系统 RW-BT-KERNEL-SW-FS.pdf第2页
    RivieraWaves系统 RW-BT-KERNEL-SW-FS.pdf第3页
    RivieraWaves系统 RW-BT-KERNEL-SW-FS.pdf第4页
    RivieraWaves系统 RW-BT-KERNEL-SW-FS.pdf第5页
    RivieraWaves系统 RW-BT-KERNEL-SW-FS.pdf第6页

    试读已结束,剩余11页未读...

    50积分/C币 立即下载 >