Updated servers according to syslib interface changes.

This commit is contained in:
Jorrit Herder 2005-07-29 15:00:49 +00:00
parent aec394a330
commit d3874a7917
9 changed files with 60 additions and 30 deletions

View file

@ -76,7 +76,7 @@ PUBLIC void main()
} else if (call_nr == DEV_SELECTED) { } else if (call_nr == DEV_SELECTED) {
printf("Old select device callback received - ignored\n"); printf("Old select device callback received - ignored\n");
} else if ((call_nr & NOTIFY_MESSAGE)) { } else if ((call_nr & NOTIFY_MESSAGE)) {
/* Device notifies (alert()s) us of an event. */ /* Device notifies us of an event. */
dev_status(&m_in); dev_status(&m_in);
} else { } else {
/* Call the internal function that does the work. */ /* Call the internal function that does the work. */

View file

@ -25,7 +25,7 @@ PUBLIC void fs_set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg)
/* reschedule our synchronous alarm if necessary */ /* reschedule our synchronous alarm if necessary */
if(!old_head || old_head > new_head) { if(!old_head || old_head > new_head) {
if(sys_syncalrm(SELF, new_head, 1) != OK) if(sys_setalarm(new_head, 1) != OK)
panic(__FILE__, "FS set timer couldn't set synchronous alarm.", NO_NUM); panic(__FILE__, "FS set timer couldn't set synchronous alarm.", NO_NUM);
#if VERBOSE #if VERBOSE
else else
@ -41,7 +41,7 @@ PUBLIC void fs_expire_timers(clock_t now)
clock_t new_head; clock_t new_head;
tmrs_exptimers(&fs_timers, now, &new_head); tmrs_exptimers(&fs_timers, now, &new_head);
if(new_head > 0) { if(new_head > 0) {
if(sys_syncalrm(SELF, new_head, 1) != OK) if(sys_setalarm(new_head, 1) != OK)
panic(__FILE__, "FS expire timer couldn't set synchronous alarm.", NO_NUM); panic(__FILE__, "FS expire timer couldn't set synchronous alarm.", NO_NUM);
#if VERBOSE #if VERBOSE
else else
@ -69,7 +69,7 @@ PUBLIC void fs_cancel_timer(timer_t *tp)
* will be 0 then). * will be 0 then).
*/ */
if(old_head < new_head || !new_head) { if(old_head < new_head || !new_head) {
if(sys_syncalrm(SELF, new_head, 1) != OK) if(sys_setalarm(new_head, 1) != OK)
panic(__FILE__, "FS expire timer couldn't set synchronous alarm.", NO_NUM); panic(__FILE__, "FS expire timer couldn't set synchronous alarm.", NO_NUM);
#if VERBOSE #if VERBOSE
printf("timers: after cancelling, set synalarm to %d -> %d\n", old_head, new_head); printf("timers: after cancelling, set synalarm to %d -> %d\n", old_head, new_head);

View file

@ -191,7 +191,7 @@ PRIVATE void set_timer()
next_timeout= new_time; next_timeout= new_time;
new_time -= curr_time; new_time -= curr_time;
if (sys_syncalrm(SELF, new_time, 0) != OK) if (sys_setalarm(new_time, 0) != OK)
ip_panic(("can't set timer")); ip_panic(("can't set timer"));
#endif #endif
} }

View file

@ -752,7 +752,7 @@ int is_revive;
#endif #endif
if (is_revive) if (is_revive)
{ {
alert(mq->mq_mess.m_source); notify(mq->mq_mess.m_source);
result= ELOCKED; result= ELOCKED;
} }
else else
@ -912,7 +912,7 @@ unsigned ops;
if (ops & SR_SELECT_WRITE) sr_fd->srf_flags |= SFF_SELECT_W; if (ops & SR_SELECT_WRITE) sr_fd->srf_flags |= SFF_SELECT_W;
if (ops & SR_SELECT_EXCEPTION) sr_fd->srf_flags |= SFF_SELECT_X; if (ops & SR_SELECT_EXCEPTION) sr_fd->srf_flags |= SFF_SELECT_X;
alert(sr_fd->srf_select_proc); notify(sr_fd->srf_select_proc);
} }
#endif #endif

View file

@ -8,12 +8,16 @@
#include "../../kernel/debug.h" #include "../../kernel/debug.h"
#include "../../kernel/type.h" #include "../../kernel/type.h"
#include "../../kernel/proc.h" #include "../../kernel/proc.h"
#include "../../kernel/ipc.h"
#define click_to_round_k(n) \ #define click_to_round_k(n) \
((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024)) ((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
/* Declare some local dump procedures. */ /* Declare some local dump procedures. */
FORWARD _PROTOTYPE( char *proc_name, (int proc_nr) ); FORWARD _PROTOTYPE( char *proc_name, (int proc_nr) );
FORWARD _PROTOTYPE( char *s_traps_str, (int flags) );
FORWARD _PROTOTYPE( char *s_flags_str, (int flags) );
FORWARD _PROTOTYPE( char *p_rts_flags_str, (int flags) );
/* Some global data that is shared among several dumping procedures. /* Some global data that is shared among several dumping procedures.
@ -22,7 +26,7 @@ FORWARD _PROTOTYPE( char *proc_name, (int proc_nr) );
*/ */
PUBLIC struct proc proc[NR_TASKS + NR_PROCS]; PUBLIC struct proc proc[NR_TASKS + NR_PROCS];
PUBLIC struct priv priv[NR_SYS_PROCS]; PUBLIC struct priv priv[NR_SYS_PROCS];
PUBLIC struct system_image image[NR_BOOT_PROCS]; PUBLIC struct boot_image image[NR_BOOT_PROCS];
@ -184,7 +188,7 @@ PUBLIC void irqtab_dmp()
PUBLIC void image_dmp() PUBLIC void image_dmp()
{ {
int m, i,j,r; int m, i,j,r;
struct system_image *ip; struct boot_image *ip;
static char send_mask[BITCHUNK_BITS*2]; static char send_mask[BITCHUNK_BITS*2];
if ((r = sys_getimage(image)) != OK) { if ((r = sys_getimage(image)) != OK) {
@ -192,7 +196,7 @@ PUBLIC void image_dmp()
return; return;
} }
printf("Image table dump showing all processes included in system image.\n"); printf("Image table dump showing all processes included in system image.\n");
printf("---name-- -nr- -flags- -q- ----pc- -stack- ----sendmask[0]-----\n"); printf("---name-- -nr- -flags- -traps- -sq- ----pc- -stack- -sendmask[0]------\n");
for (m=0; m<NR_BOOT_PROCS; m++) { for (m=0; m<NR_BOOT_PROCS; m++) {
ip = &image[m]; ip = &image[m];
for (i=j=0; i < BITCHUNK_BITS; i++, j++) { for (i=j=0; i < BITCHUNK_BITS; i++, j++) {
@ -200,9 +204,10 @@ PUBLIC void image_dmp()
if (i % 8 == 7) send_mask[++j] = ' '; if (i % 8 == 7) send_mask[++j] = ' ';
} }
send_mask[j] = '\0'; send_mask[j] = '\0';
printf("%8s %4d 0x%02x %3d %7lu %7lu %s\n", printf("%8s %4d %s %s %3d %7lu %7lu %s\n",
ip->proc_name, ip->proc_nr, ip->flags, ip->priority, ip->proc_name, ip->proc_nr,
(long)ip->initial_pc, ip->stksize, send_mask); s_flags_str(ip->flags), s_traps_str(ip->call_mask),
ip->priority, (long)ip->initial_pc, ip->stksize, send_mask);
} }
printf("\n"); printf("\n");
} }
@ -311,7 +316,21 @@ PRIVATE char *s_flags_str(int flags)
str[1] = (flags & RDY_Q_HEAD) ? 'Q' : '-'; str[1] = (flags & RDY_Q_HEAD) ? 'Q' : '-';
str[2] = (flags & BILLABLE) ? 'B' : '-'; str[2] = (flags & BILLABLE) ? 'B' : '-';
str[3] = (flags & SYS_PROC) ? 'S' : '-'; str[3] = (flags & SYS_PROC) ? 'S' : '-';
str[4] = '\0'; str[4] = '-';
str[5] = '\0';
return str;
}
PRIVATE char *s_traps_str(int flags)
{
static char str[10];
str[0] = (flags & (1 << ECHO)) ? 'E' : '-';
str[1] = (flags & (1 << SEND)) ? 'S' : '-';
str[2] = (flags & (1 << RECEIVE)) ? 'R' : '-';
str[3] = (flags & (1 << SENDREC)) ? 'B' : '-';
str[4] = (flags & (1 << NOTIFY)) ? 'N' : '-';
str[5] = '\0';
return str; return str;
} }
@ -338,7 +357,7 @@ PUBLIC void privileges_dmp()
return; return;
} }
printf("\n--nr-id-name---- -flags- -traps- -send mask-\n"); printf("\n--nr-id-name---- -flags- -traps- -send mask------------------------- \n");
for (rp = oldrp; rp < END_PROC_ADDR; rp++) { for (rp = oldrp; rp < END_PROC_ADDR; rp++) {
if (isemptyp(rp)) continue; if (isemptyp(rp)) continue;
@ -352,9 +371,9 @@ PUBLIC void privileges_dmp()
if (r == -1 && ! (rp->p_rts_flags & SLOT_FREE)) { if (r == -1 && ! (rp->p_rts_flags & SLOT_FREE)) {
sp = &priv[USER_PRIV_ID]; sp = &priv[USER_PRIV_ID];
} }
printf("(%02u) %-7.7s %5s 0x%03.3x ", printf("(%02u) %-7.7s %s %s ",
sp->s_id, rp->p_name, sp->s_id, rp->p_name,
s_flags_str(sp->s_flags), sp->s_call_mask s_flags_str(sp->s_flags), s_traps_str(sp->s_call_mask)
); );
for (i=j=0; i < NR_SYS_PROCS; i++, j++) { for (i=j=0; i < NR_SYS_PROCS; i++, j++) {
send_mask[j] = get_sys_bit(sp->s_send_mask, i) ? '1' : '0'; send_mask[j] = get_sys_bit(sp->s_send_mask, i) ? '1' : '0';
@ -419,6 +438,20 @@ PUBLIC void sendmask_dmp()
} }
PRIVATE char *p_rts_flags_str(int flags)
{
static char str[10];
str[0] = (flags & NO_MAP) ? 'M' : '-';
str[1] = (flags & SENDING) ? 'S' : '-';
str[2] = (flags & RECEIVING) ? 'R' : '-';
str[3] = (flags & SIGNALED) ? 'S' : '-';
str[4] = (flags & SIG_PENDING) ? 'P' : '-';
str[5] = (flags & P_STOP) ? 'T' : '-';
str[6] = '\0';
return str;
}
/*===========================================================================* /*===========================================================================*
* proctab_dmp * * proctab_dmp *
@ -451,7 +484,7 @@ PUBLIC void proctab_dmp()
if (proc_nr(rp) == IDLE) printf("(%2d) ", proc_nr(rp)); if (proc_nr(rp) == IDLE) printf("(%2d) ", proc_nr(rp));
else if (proc_nr(rp) < 0) printf("[%2d] ", proc_nr(rp)); else if (proc_nr(rp) < 0) printf("[%2d] ", proc_nr(rp));
else printf(" %2d ", proc_nr(rp)); else printf(" %2d ", proc_nr(rp));
printf(" %-7.7s %02u/%02u %02d/%02d %02u %6lu%6lu %6uK%6uK%6uK %3x", printf(" %-8.8s %02u/%02u %02d/%02d %02u %6lu%6lu %6uK%6uK%6uK %s",
rp->p_name, rp->p_name,
rp->p_priority, rp->p_max_priority, rp->p_priority, rp->p_max_priority,
rp->p_sched_ticks, rp->p_quantum_size, rp->p_sched_ticks, rp->p_quantum_size,
@ -459,13 +492,10 @@ PUBLIC void proctab_dmp()
rp->p_user_time, rp->p_sys_time, rp->p_user_time, rp->p_sys_time,
click_to_round_k(text), click_to_round_k(data), click_to_round_k(text), click_to_round_k(data),
click_to_round_k(size), click_to_round_k(size),
rp->p_rts_flags); p_rts_flags_str(rp->p_rts_flags));
if (rp->p_rts_flags & RECEIVING) { if (rp->p_rts_flags & (SENDING|RECEIVING)) {
printf(" %-7.7s", proc_name(rp->p_getfrom)); printf(" %-7.7s", proc_name(rp->p_getfrom));
} else } else
if (rp->p_rts_flags & SENDING) {
printf(" S:%-5.5s", proc_name(rp->p_sendto));
} else
if (rp->p_rts_flags == 0) { if (rp->p_rts_flags == 0) {
printf(" "); printf(" ");
} }

View file

@ -94,7 +94,7 @@ PUBLIC int do_fork()
rmc->mp_pid = new_pid; /* assign pid to child */ rmc->mp_pid = new_pid; /* assign pid to child */
/* Tell kernel and file system about the (now successful) FORK. */ /* Tell kernel and file system about the (now successful) FORK. */
sys_fork(who, child_nr, rmc->mp_pid); sys_fork(who, child_nr);
tell_fs(FORK, who, child_nr, rmc->mp_pid); tell_fs(FORK, who, child_nr, rmc->mp_pid);
/* Report child's memory map to kernel. */ /* Report child's memory map to kernel. */

View file

@ -140,8 +140,8 @@ PRIVATE void pm_init()
{ {
/* Initialize the process manager. */ /* Initialize the process manager. */
int key, i, s; int key, i, s;
static struct system_image image[NR_BOOT_PROCS]; static struct boot_image image[NR_BOOT_PROCS];
register struct system_image *ip; register struct boot_image *ip;
static char core_sigs[] = { SIGQUIT, SIGILL, SIGTRAP, SIGABRT, static char core_sigs[] = { SIGQUIT, SIGILL, SIGTRAP, SIGABRT,
SIGEMT, SIGFPE, SIGUSR1, SIGSEGV, SIGUSR2 }; SIGEMT, SIGFPE, SIGUSR1, SIGSEGV, SIGUSR2 };
static char ign_sigs[] = { SIGCHLD }; static char ign_sigs[] = { SIGCHLD };

View file

@ -181,7 +181,7 @@ PUBLIC int do_sigreturn()
mp->mp_sigmask = (sigset_t) m_in.sig_set; mp->mp_sigmask = (sigset_t) m_in.sig_set;
sigdelset(&mp->mp_sigmask, SIGKILL); sigdelset(&mp->mp_sigmask, SIGKILL);
r = sys_sigreturn(who, (struct sigmsg *) m_in.sig_context, m_in.sig_flags); r = sys_sigreturn(who, (struct sigmsg *) m_in.sig_context);
check_pending(mp); check_pending(mp);
return(r); return(r);
} }

View file

@ -26,7 +26,7 @@ PUBLIC void pm_set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg)
/* reschedule our synchronous alarm if necessary */ /* reschedule our synchronous alarm if necessary */
if(! prev_time || prev_time > next_time) { if(! prev_time || prev_time > next_time) {
if(sys_syncalrm(SELF, next_time, 1) != OK) if(sys_setalarm(next_time, 1) != OK)
panic(__FILE__, "PM set timer couldn't set synchronous alarm.", NO_NUM); panic(__FILE__, "PM set timer couldn't set synchronous alarm.", NO_NUM);
#if VERBOSE #if VERBOSE
else else
@ -42,7 +42,7 @@ PUBLIC void pm_expire_timers(clock_t now)
clock_t next_time; clock_t next_time;
tmrs_exptimers(&pm_timers, now, &next_time); tmrs_exptimers(&pm_timers, now, &next_time);
if(next_time > 0) { if(next_time > 0) {
if(sys_syncalrm(SELF, next_time, 1) != OK) if(sys_setalarm(next_time, 1) != OK)
panic(__FILE__, "PM expire timer couldn't set synchronous alarm.", NO_NUM); panic(__FILE__, "PM expire timer couldn't set synchronous alarm.", NO_NUM);
#if VERBOSE #if VERBOSE
else else
@ -65,7 +65,7 @@ PUBLIC void pm_cancel_timer(timer_t *tp)
* will be 0 then). * will be 0 then).
*/ */
if(prev_time < next_time || ! next_time) { if(prev_time < next_time || ! next_time) {
if(sys_syncalrm(SELF, next_time, 1) != OK) if(sys_setalarm(next_time, 1) != OK)
panic(__FILE__, "PM expire timer couldn't set synchronous alarm.", NO_NUM); panic(__FILE__, "PM expire timer couldn't set synchronous alarm.", NO_NUM);
#if VERBOSE #if VERBOSE
printf("timers: after cancelling, set synalarm to %d -> %d\n", prev_time, next_time); printf("timers: after cancelling, set synalarm to %d -> %d\n", prev_time, next_time);