06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

tm_tick pSOS+ <strong>System</strong> <strong>Calls</strong><br />

tm_tick Announces a clock tick to the pSOS+ kernel.<br />

#include <br />

unsigned long tm_tick()<br />

Description<br />

Return Value<br />

Error Codes<br />

Notes<br />

This system call is used to inform the pSOS+ kernel of the arrival of a new clock<br />

tick. The pSOS+ time manager uses it to update its time and date calendar, count<br />

down tasks that are timing out, and track a running task's time-slice for roundrobin<br />

scheduling. Normally, the user's real-time clock ISR calls tm_tick().<br />

The frequency of tm_tick() calls is fixed and defined in the pSOS+ Configuration<br />

Table as kc_ticks2sec. Thus, if the value is 100, the pSOS+ time manager<br />

interprets 100 tm_tick() calls as one real-time second.<br />

This call always returns 0.<br />

None<br />

1. tm_tick() is very fast: it just notifies the system of the arrival of another clock<br />

tick. Most other Time Manager actions that can result from this clock tick are<br />

postponed until the pSOS+ kernel dispatches and do not run at the clock<br />

interrupt level. This improves deterministic system interrupt response.<br />

2. The system accumulates announced ticks when necessary, so no chance exists<br />

for an overrun or missed tick. Typically, the accumulation never counts past 1.<br />

However, if a system contains one or more lengthy ISRs that respond to high<br />

frequency interrupt sources, they can monopolize the CPU enough to prevent<br />

the pSOS+ kernel from processing a tick before the next one arrives. In such<br />

rare cases, the pSOS+ kernel accumulates the ticks for subsequent accounting.<br />

Multiprocessor Considerations<br />

None. This call can only be directed at the local processor node.<br />

1-178 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!