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[], _PROTOTYPE( int __execve, (const char *_path, char *const _argv[],
char *const _envp[], int _nargs, int _nenvps) ); 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( void _loadname, (const char *_name, message *_msgptr) );
_PROTOTYPE( int _len, (const char *_s) ); _PROTOTYPE( int _len, (const char *_s) );
_PROTOTYPE( void _begsig, (int _dummy) ); _PROTOTYPE( void _begsig, (int _dummy) );

View File

@ -46,10 +46,10 @@
FORWARD _PROTOTYPE( void idle, (void)); FORWARD _PROTOTYPE( void idle, (void));
/** /**
* Made public for use in clock.c (for user-space scheduling) * 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)); 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)); message *m_ptr, int flags));
FORWARD _PROTOTYPE( int mini_senda, (struct proc *caller_ptr, FORWARD _PROTOTYPE( int mini_senda, (struct proc *caller_ptr,
asynmsg_t *table, size_t size)); asynmsg_t *table, size_t size));
@ -516,11 +516,12 @@ proc_nr_t src_dst; /* src or dst process */
/*===========================================================================* /*===========================================================================*
* mini_send * * mini_send *
*===========================================================================*/ *===========================================================================*/
PUBLIC int mini_send(caller_ptr, dst_e, m_ptr, flags) PUBLIC int mini_send(
register struct proc *caller_ptr; /* who is trying to send a message? */ register struct proc *caller_ptr, /* who is trying to send a message? */
int dst_e; /* to whom is message being sent? */ endpoint_t dst_e, /* to whom is message being sent? */
message *m_ptr; /* pointer to message buffer */ message *m_ptr, /* pointer to message buffer */
const int flags; const int flags
)
{ {
/* Send a message from 'caller_ptr' to 'dst'. If 'dst' is blocked waiting /* 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 * for this message, copy the message to it and unblock 'dst'. If 'dst' is
@ -599,11 +600,12 @@ const int flags;
/*===========================================================================* /*===========================================================================*
* mini_receive * * mini_receive *
*===========================================================================*/ *===========================================================================*/
PRIVATE int mini_receive(caller_ptr, src_e, m_ptr, flags) PRIVATE int mini_receive(
register struct proc *caller_ptr; /* process trying to get message */ register struct proc *caller_ptr, /* process trying to get message */
int src_e; /* which message source is wanted */ endpoint_t src_e, /* which message source is wanted */
message *m_ptr; /* pointer to message buffer */ message *m_ptr, /* pointer to message buffer */
const int flags; const int flags
)
{ {
/* A process or task wants to get a message. If a message is already queued, /* 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 * 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 b64_sft(struct mantissa *e1, int n);
static void 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 /* Multiply the extended numbers e1 and e2, and put the
result in e3. result in e3.

View File

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

View File

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

View File

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