
538
Evaluating and Programming the 29K RISC Family
msg_init()
before it calls
dbg_control()
. This enables the DebugCore to start using
the message system.
msg_V_msg
This label (called
msg_intr
in older code versions) is the entry address for the
interrupt handler dealing with message reception. If the 29K can be interrupted when
a complete message is available, such as when a message is placed in shared memory
by another processor, the OS should place address
msg_V_msg
in the appropriate
vector table entry.
struct message *
msg_rbuf_p
The message system passes received messages via this pointer. For example,
when the DebugCore accesses a new incoming message it uses
msg_rbuf_p
to point
to the start of the message.
struct message *
msg_sbuf_p
The
msg_send()
function sets the
msg_sbuf_p
variable to point to the start of
the buffer currently being sent by the 29K processor. The message support mecha-
nism must ensure that this pointer is set to zero after the current message has been
received by the TIP on the host processor. For message systems which rely on
UARTs, the UART driver must ensure that
msg_sbuf_p
is set to zero when the last
character of the current message has been sent.
int
msg_send
(struct message *message_pointer)
This function is used to send all messages to MonTIP. Both the OS and Debug-
Core use this function. It is passed a pointer to the start of the message and returns the
number of characters accepted for transmission. If the message system is currently to
busy to accepted the message, the function returns –1.
int
msg_wait_for
()
The DebugCore can receive a message at any time if interrupts are enabled.
However when the DebugCore is waiting for a message it calls
msg_wait_for()
. This
function returns zero immediately if no message is available and the DebugCore
must wait for a message system interrupt. If the message system is controlling the
communications hardware via polling (with interrupts turned off), then
msg_wait_for()
will return –1 when a complete new message is received.
os_V_msg
When the message system operates with interrupts enabled a message may be
received at any time from MonTIP. If the message class is 64 or greater the operating
system will be interrupted. The OS must install the entry address
os_V_msg
for vec-
tor number V_OS_MSG (76) in the processor vector table.
void
ser_init
()
When the message system is initialized with a call to
msg_init()
, it will call the
initialization function for any hardware driver module. In the case of the serial driver
module the function
ser_init()
is called.