next up previous contents
Next: 5.3 Distributed Memory Managers Up: 5.2 Portals Previous: 5.2 Portals

5.2.1 Kernel-User interface

Messages exchanged between the kernel and the user are instances of Msg.

<Off message. >= (U->)
struct off_Msg {
};
Defines off_Msg (links are to index).

They are of two kinds, requests and replies. Requests carry a field with the request type so that the same portal could be multiplexed for multiple requests.

<Off message request. >= (U->)
// Message types.

struct off_MsgReq : public off_Msg {
  off_ex_t m_type;              // message type
  off_MsgReq(off_ex_t type) : m_type(type) {;}
};
Defines off_MsgReq, off_MsgReq::off_MsgReq (links are to index).

Replies are not typed.

<Off message reply. >= (U->)
struct off_MsgRep : public off_Msg {
};
Defines off_MsgRep (links are to index).

A portal handler is defined

<Off portal handler. >= (U->)
// A portal handler. 
typedef err_t off_PrtlHandlerFn(natural_t nwords, void *msg); 

\subsubsection{Kernel-User interface \cpp{} source files} All message definitions are kept in prtl/ex.h. That file describes the possible interactions between the kernel and the user. Concrete messages are not described here; they are described through this document in those sections where their need becomes clear.

NOTE: XXX add a chunk for ENTRY definition.

<ex.h*>=
<Read the literate code instead warning. >
#ifndef __OFF_EX_H
#define __OFF_EX_H 1

<Off user-kernel messages dependencies. >
<Off Virtual traps dependencies. >
<Off Virtual traps. >

#define ENTRY
<Off portal handler. >
<Off message. >
<Off message request. >
<Off message reply. >

<Off user-kernel messages. >
 
#endif // __OFF_EX_H

Some messages may provide methods to fill their contents, those routines are kept in prtl/ex.C.

<ex.C*>=
<Read the literate code instead warning. >

#include <prtl/ex.h>            // Exported interface.
<Off user-kernel messages implementation dependencies. >

<Off user-kernel messages implementation. >

%% --------------------------------------------------------------



Francisco J. Ballesteros
1998-05-25