Use endpoint_t for the destination of mini_send and _syscall, and the

source of mini_receive.

Also some small cleanup.
This commit is contained in:
Kees van Reeuwijk 2010-06-02 21:51:32 +00:00
parent 0a42d36ac6
commit 36e12d5bd8
6 changed files with 18 additions and 20 deletions

View file

@ -28,7 +28,7 @@
_PROTOTYPE( int __execve, (const char *_path, char *const _argv[],
char *const _envp[], int _nargs, int _nenvps) );
_PROTOTYPE( int _syscall, (int _who, int _syscallnr, message *_msgptr) );
_PROTOTYPE( int _syscall, (endpoint_t _who, int _syscallnr, message *_msgptr) );
_PROTOTYPE( void _loadname, (const char *_name, message *_msgptr) );
_PROTOTYPE( int _len, (const char *_s) );
_PROTOTYPE( void _begsig, (int _dummy) );

View file

@ -46,10 +46,10 @@
FORWARD _PROTOTYPE( void idle, (void));
/**
* Made public for use in clock.c (for user-space scheduling)
FORWARD _PROTOTYPE( int mini_send, (struct proc *caller_ptr, int dst_e,
FORWARD _PROTOTYPE( int mini_send, (struct proc *caller_ptr, endpoint_t dst_e,
message *m_ptr, int flags));
*/
FORWARD _PROTOTYPE( int mini_receive, (struct proc *caller_ptr, int src,
FORWARD _PROTOTYPE( int mini_receive, (struct proc *caller_ptr, endpoint_t src,
message *m_ptr, int flags));
FORWARD _PROTOTYPE( int mini_senda, (struct proc *caller_ptr,
asynmsg_t *table, size_t size));
@ -516,11 +516,12 @@ proc_nr_t src_dst; /* src or dst process */
/*===========================================================================*
* mini_send *
*===========================================================================*/
PUBLIC int mini_send(caller_ptr, dst_e, m_ptr, flags)
register struct proc *caller_ptr; /* who is trying to send a message? */
int dst_e; /* to whom is message being sent? */
message *m_ptr; /* pointer to message buffer */
const int flags;
PUBLIC int mini_send(
register struct proc *caller_ptr, /* who is trying to send a message? */
endpoint_t dst_e, /* to whom is message being sent? */
message *m_ptr, /* pointer to message buffer */
const int flags
)
{
/* Send a message from 'caller_ptr' to 'dst'. If 'dst' is blocked waiting
* for this message, copy the message to it and unblock 'dst'. If 'dst' is
@ -599,11 +600,12 @@ const int flags;
/*===========================================================================*
* mini_receive *
*===========================================================================*/
PRIVATE int mini_receive(caller_ptr, src_e, m_ptr, flags)
register struct proc *caller_ptr; /* process trying to get message */
int src_e; /* which message source is wanted */
message *m_ptr; /* pointer to message buffer */
const int flags;
PRIVATE int mini_receive(
register struct proc *caller_ptr, /* process trying to get message */
endpoint_t src_e, /* which message source is wanted */
message *m_ptr, /* pointer to message buffer */
const int flags
)
{
/* A process or task wants to get a message. If a message is already queued,
* acquire it and deblock the sender. If no message from the desired source

View file

@ -18,7 +18,7 @@ static int b64_add(struct mantissa *e1, struct mantissa *e2);
static void b64_sft(struct mantissa *e1, int n);
static void
mul_ext(struct EXTEND *e1, struct EXTEND *e2, struct EXTEND *e3)
mul_ext(const struct EXTEND *e1, const struct EXTEND *e2, struct EXTEND *e3)
{
/* Multiply the extended numbers e1 and e2, and put the
result in e3.

View file

@ -10,7 +10,7 @@ char *
strtok(register char *string, const char *separators)
{
register char *s1, *s2;
static char *savestring;
static char *savestring = NULL;
if (string == NULL) {
string = savestring;

View file

@ -7,7 +7,6 @@ int asyn_synch(asynchio_t *asyn, int fd)
/* No more asynchronous operations on this file descriptor. */
{
asynfd_t *afd;
int flags;
int op;
if ((unsigned) fd >= FD_SETSIZE) { errno= EBADF; return -1; }

View file

@ -1,9 +1,6 @@
#include <lib.h>
PUBLIC int _syscall(who, syscallnr, msgptr)
int who;
int syscallnr;
register message *msgptr;
PUBLIC int _syscall(endpoint_t who, int syscallnr, message *msgptr)
{
int status;