Barrelfish
Functions
dispatch.c File Reference

Dispatcher implementation. More...

Functions

void disp_run (dispatcher_handle_t handle)
 Run entry point. More...
 
void disp_lrpc (struct lmp_endpoint *ep, uint32_t bufpos, uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, dispatcher_handle_t handle)
 LRPC entry point. More...
 
void disp_pagefault (dispatcher_handle_t handle, lvaddr_t fault_address, uintptr_t error, lvaddr_t ip)
 Page fault entry point. More...
 
void disp_pagefault_disabled (dispatcher_handle_t handle, lvaddr_t fault_address, uintptr_t error, lvaddr_t ip)
 Disabled page fault entry point. More...
 
void disp_trap (dispatcher_handle_t handle, uintptr_t irq, uintptr_t error, lvaddr_t ip)
 Trap entry point. More...
 
void disp_init_disabled (dispatcher_handle_t handle)
 Initialise the dispatcher, while disabled. More...
 
void disp_yield_disabled (dispatcher_handle_t handle)
 Yield the dispatcher's CPU. More...
 
dispatcher_handle_t disp_disable (void)
 Disable the dispatcher. More...
 
dispatcher_handle_t disp_try_disable (bool *was_enabled)
 Try to disable the dispatcher. More...
 
void disp_enable (dispatcher_handle_t handle)
 Re-enable the dispatcher. More...
 
const char * disp_name (void)
 Return a pointer to the name field of the current dispatcher. More...
 

Detailed Description

Dispatcher implementation.

Function Documentation

dispatcher_handle_t disp_disable ( void  )

Disable the dispatcher.

This function disables the current dispatcher, returning a pointer to it. The dispatcher must be enabled.

While the dispatcher is disabled, the current thread cannot be preempted, and no incoming LMP messages can be received.

void disp_enable ( dispatcher_handle_t  handle)

Re-enable the dispatcher.

This function re-enables the current dispatcher. The dispatcher must be disabled.

void disp_init_disabled ( dispatcher_handle_t  handle)

Initialise the dispatcher, while disabled.

This function is called to setup the dispatcher structure while still disabled.

Parameters
dispDispatcher
void disp_lrpc ( struct lmp_endpoint ep,
uint32_t  bufpos,
uintptr_t  arg1,
uintptr_t  arg2,
uintptr_t  arg3,
uintptr_t  arg4,
dispatcher_handle_t  handle 
)

LRPC entry point.

This function is called from assembly code when the kernel enters us to give us the CPU and deliver an LRPC message. The dispatcher is disabled.

Parameters
epLMP endpoint structure
bufposReserved position in endpoint message buffer
arg1Message payload
arg2Message payload
arg3Message payload
arg4Message payload
handleDispatcher pointer
Note
Dispatcher pointer comes last here, because AB was too lazy to shuffle registers through the whole LRPC path when adding it.
const char* disp_name ( void  )

Return a pointer to the name field of the current dispatcher.

May be called when the dispatcher is either enabled or disabled.

Returns
a string of at most #DISP_NAME_LEN characters, which may not be nul-terminated.
void disp_pagefault ( dispatcher_handle_t  handle,
lvaddr_t  fault_address,
uintptr_t  error,
lvaddr_t  ip 
)

Page fault entry point.

This function is called from assembly code when the kernel enters us to report a page fault while enabled.

Parameters
handleDispatcher
fault_addressFault address
errorCPU error code
ipFaulting instruction pointer
void disp_pagefault_disabled ( dispatcher_handle_t  handle,
lvaddr_t  fault_address,
uintptr_t  error,
lvaddr_t  ip 
)

Disabled page fault entry point.

This function is called from assembly code when the kernel enters us to report a page fault while disabled.

Parameters
handleDispatcher
fault_addressFault address
errorCPU error code
ipFaulting instruction pointer
void disp_run ( dispatcher_handle_t  handle)

Run entry point.

This function is called from assembly code when the kernel enters us to give us the CPU.

Parameters
dispDispatcher
void disp_trap ( dispatcher_handle_t  handle,
uintptr_t  irq,
uintptr_t  error,
lvaddr_t  ip 
)

Trap entry point.

This function is called from assembly code when the kernel enters us to report a trap taken while we were enabled.

Parameters
handleDispatcher
irqTrap vector
errorCPU error code
ipFaulting instruction pointer
dispatcher_handle_t disp_try_disable ( bool *  was_enabled)

Try to disable the dispatcher.

This function disables the current dispatcher if it's enabled and returns a pointer to it.

While the dispatcher is disabled, the current thread cannot be preempted, and no incoming LMP messages can be received.

Parameters
was_enabledTrue, if the dispatcher was enabled
void disp_yield_disabled ( dispatcher_handle_t  handle)

Yield the dispatcher's CPU.

This function yields the CPU. It may only be called while disabled.

Parameters
dispCurrent dispatcher