
B–61863E–1/06
2. TASK CONTROL FUNCTION
PMC CONTROL SOFTWARE
77
Packets are used for communication between tasks. When a task sends
a packet, it notifies a receiving task of the packet address
The concept of ownership is applicable to packets. Once a task obtains
a packet address, however, the task can still access the packet even after
sending the packet regardless of the ownership. This is because packet
communication is just the sending of addresses.
Consequently, after sending a packet, a task may rewrite the packet
carelessly while the receiving task is reading data. To avoid this, tasks
without ownership should not access packets.
CAUTION
When a packet is sent to a task, the ownership of the packet
is transferred to the destination task.
For packet communication control, the following system calls are used:
Function name Description
os_make_pkt Allocates a packet.
os_delt_pkt Returns a used packet.
os_send_pkt Sends a packet.
os_recv_pkt Receives a packet.
os_mark_pkt Marks a packet.
os_rmrk_pkt Removes a mark from a packet.
(1) Allocating a packet
To allocate a packet, use the system call, os_make_ pkt. A packet is
allocated from a packet pool which is prepared by the system. If the
packet pool becomes insufficient, a packet is allocated from the
memory pool. The packet types that can be specified at packet
allocation are listed below.
[Packet types]
Type SIze Number of packets
0 32 16
1 64 16
2 128 8
3 256 4
(2) Deleting a packet
To delete a packet, use the system call, os_delt_pkt. When a packet
is deleted, the address of the allocated packet is used.
CAUTION
1 Access to a deleted packet is inhibited.
2 Packets without ownership cannot be deleted.
2.6.6
Intertask
Communication
(Packet
Communication)