IXP1200 Network Processor Family ATM
// sram[read, $foo], ordered, ctx_swap
4.10Mutex Vectors
Mutex vectors are an extension to critical sections that allows multiple critical sections to be contained within a single absolute register. (critsect.uc implements critical sections, critsect macros are documented in the IXP1200 Macro Library Reference Manual.) Critsect macros are used to allow only 1 of the 4 threads of a microengine to execute a critical code section at one time. The critsect macros allow the four threads within a microengine to use a semaphore implemented in an absolute register. The semaphore is used to restrict use of a resource shared by the threads in a microengine. The
The following critical section macros are for use within a microengine. Up to 32 critical sections can be implemented with each absolute register. These macros are used where
4.10.1mutex_vector_init()
Initializes critical sections to enable subsequent mutex_vector_enter() to succeed.
mutex_vector_init(out_abs_reg)
Parameter | Description |
|
|
out_abs_reg | Absolute register containing the semaphores. |
|
|
4.10.2mutex_vector_enter()
Enters the specified microengine critical section.
mutex_vector_enter(io_abs_reg, in_bit_number)
Parameter | Description | |
|
| |
out_abs_reg | Absolute register containing the semaphores. | |
|
| |
| bit number of the semaphore | |
in_bit_number | 0 bits: critical section available | |
1 bits: critical section occupied | ||
| ||
| init: clears all bits | |
|
|
4.10.3mutex_vector_exit()
Exits the specified microengine critical section.
mutex_vector_exit(io_abs_reg, in_bit_number)
Application Note | 53 |
Modified on: 3/20/02,