-/* This file contains information dump procedures. During the initialization
+/* This file contains information dump procedures. During the initialization
* of the Information Service 'known' function keys are registered at the TTY
- * server in order to receive a notification if one is pressed. Here, the
- * corresponding dump procedure is called.
+ * server in order to receive a notification if one is pressed. Here, the
+ * corresponding dump procedure is called.
*
* The entry points into this file are
* map_unmap_fkeys: register or unregister function key maps with TTY
/*===========================================================================*
* map_unmap_keys *
*===========================================================================*/
-void map_unmap_fkeys(map)
-int map;
+void
+map_unmap_fkeys(int map)
{
int fkeys, sfkeys;
int h, s;
fkeys = sfkeys = 0;
for (h = 0; h < NHOOKS; h++) {
- if (hooks[h].key >= F1 && hooks[h].key <= F12)
+ if (hooks[h].key >= F1 && hooks[h].key <= F12)
bit_set(fkeys, hooks[h].key - F1 + 1);
else if (hooks[h].key >= SF1 && hooks[h].key <= SF12)
bit_set(sfkeys, hooks[h].key - SF1 + 1);
static struct data_store noxfer_ds_store[NR_DS_KEYS];
-void data_store_dmp()
+void
+data_store_dmp(void)
{
struct data_store *p;
static int prev_i = 0;
/* This file contains procedures to dump to FS' data structures.
*
* The entry points into this file are
- * dtab_dump: display device <-> driver mappings
- * fproc_dump: display FS process table
+ * dtab_dump: display device <-> driver mappings
+ * fproc_dump: display FS process table
*
* Created:
* Oct 01, 2004: by Jorrit N. Herder
/*===========================================================================*
* fproc_dmp *
*===========================================================================*/
-void fproc_dmp()
+void
+fproc_dmp(void)
{
struct fproc *fp;
int i, j, nfds, n=0;
/*===========================================================================*
* dtab_dmp *
*===========================================================================*/
-void dtab_dmp()
+void
+dtab_dmp(void)
{
int i;
printf("Error obtaining table from VFS. Perhaps recompile IS?\n");
return;
}
-
+
printf("File System (FS) device <-> driver mappings\n");
printf(" Label Major Driver ept\n");
printf("------------- ----- ----------\n");
static char *s_flags_str(int flags);
static 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.
* Note that the process table copy has the same name as in the kernel
* so that most macros and definitions from proc.h also apply here.
*/
/*===========================================================================*
* kmessages_dmp *
*===========================================================================*/
-void kmessages_dmp()
+void
+kmessages_dmp(void)
{
struct kmessages *kmess; /* get copy of kernel messages */
static char print_buf[_KMESS_BUF_SIZE+1]; /* this one is used to print */
size--;
}
print_buf[r] = 0; /* make sure it terminates */
- printf("Dump of all messages generated by the kernel.\n\n");
+ printf("Dump of all messages generated by the kernel.\n\n");
printf("%s", print_buf); /* print the messages */
}
/*===========================================================================*
* monparams_dmp *
*===========================================================================*/
-void monparams_dmp()
+void
+monparams_dmp(void)
{
char val[MULTIBOOT_PARAM_BUF_SIZE];
char *e;
do {
e += strlen(e);
*e++ = '\n';
- } while (*e != 0);
+ } while (*e != 0);
/* Finally, print the result. */
printf("Dump of kernel environment strings set by boot monitor.\n");
/*===========================================================================*
* irqtab_dmp *
*===========================================================================*/
-void irqtab_dmp()
+void
+irqtab_dmp(void)
{
int i,r;
struct irq_hook irq_hooks[NR_IRQ_HOOKS];
printf(" <unused>\n");
continue;
}
- printf("%10d ", e->proc_nr_e);
- printf(" (%02d) ", e->irq);
+ printf("%10d ", e->proc_nr_e);
+ printf(" (%02d) ", e->irq);
printf(" %s", (e->policy & IRQ_REENABLE) ? "reenable" : " - ");
printf(" %4lu", e->notify_id);
if (irq_actids[e->irq] & e->id)
/*===========================================================================*
* image_dmp *
*===========================================================================*/
-void image_dmp()
+void
+image_dmp(void)
{
int m, r;
struct boot_image *ip;
-
+
if ((r = sys_getimage(image)) != OK) {
printf("IS: warning: couldn't get copy of image table: %d\n", r);
return;
}
printf("Image table dump showing all processes included in system image.\n");
printf("---name- -nr- flags -stack-\n");
- for (m=0; m<NR_BOOT_PROCS; m++) {
+ for (m=0; m<NR_BOOT_PROCS; m++) {
ip = &image[m];
printf("%8s %4d\n", ip->proc_name, ip->proc_nr);
}
/*===========================================================================*
* kenv_dmp *
*===========================================================================*/
-void kenv_dmp()
+void
+kenv_dmp(void)
{
struct kinfo kinfo;
struct machine machine;
printf("Dump of kinfo structure.\n\n");
printf("Kernel info structure:\n");
- printf("- nr_procs: %3u\n", kinfo.nr_procs);
- printf("- nr_tasks: %3u\n", kinfo.nr_tasks);
- printf("- release: %.6s\n", kinfo.release);
- printf("- version: %.6s\n", kinfo.version);
+ printf("- nr_procs: %3u\n", kinfo.nr_procs);
+ printf("- nr_tasks: %3u\n", kinfo.nr_tasks);
+ printf("- release: %.6s\n", kinfo.release);
+ printf("- version: %.6s\n", kinfo.version);
printf("\n");
}
/*===========================================================================*
* privileges_dmp *
*===========================================================================*/
-void privileges_dmp()
+void
+privileges_dmp(void)
{
register struct proc *rp;
static struct proc *oldrp = BEG_PROC_ADDR;
PROCLOOP(rp, oldrp)
r = -1;
- for (sp = &priv[0]; sp < &priv[NR_SYS_PROCS]; sp++)
+ for (sp = &priv[0]; sp < &priv[NR_SYS_PROCS]; sp++)
if (sp->s_proc_nr == rp->p_nr) { r ++; break; }
if (r == -1 && !isemptyp(rp)) {
sp = &priv[USER_PRIV_ID];
/*===========================================================================*
* procstack_dmp *
*===========================================================================*/
-void procstack_dmp()
+void
+procstack_dmp(void)
{
/* Proc table dump, with stack */
/*===========================================================================*
* proc_name *
*===========================================================================*/
-static char *proc_name(proc_nr)
-int proc_nr;
+static char *
+proc_name(int proc_nr)
{
struct proc *p;
if (proc_nr == ANY) return "ANY";
/* This file contains procedures to dump to PM' data structures.
*
* The entry points into this file are
- * mproc_dmp: display PM process table
+ * mproc_dmp: display PM process table
*
* Created:
* May 11, 2005: by Jorrit N. Herder
#include "inc.h"
#include "../pm/mproc.h"
#include <minix/timers.h>
-#include <minix/config.h>
-#include <minix/type.h>
+#include <minix/config.h>
+#include <minix/type.h>
struct mproc mproc[NR_PROCS];
return str;
}
-void mproc_dmp()
+void
+mproc_dmp(void)
{
struct mproc *mp;
int i, n=0;
mp = &mproc[i];
if (mp->mp_pid == 0 && i != PM_PROC_NR) continue;
if (++n > 22) break;
- printf("%8.8s %4d%4d%4d %5d %5d %5d ",
+ printf("%8.8s %4d%4d%4d %5d %5d %5d ",
mp->mp_name, i, mp->mp_parent, mp->mp_tracer, mp->mp_pid, mproc[mp->mp_parent].mp_pid, mp->mp_procgrp);
printf("%2d(%2d) %2d(%2d) ",
mp->mp_realuid, mp->mp_effuid, mp->mp_realgid, mp->mp_effgid);
- printf(" %3d %s ",
- mp->mp_nice, flags_str(mp->mp_flags));
+ printf(" %3d %s ",
+ mp->mp_nice, flags_str(mp->mp_flags));
printf("\n");
}
if (i >= NR_PROCS) i = 0;
/*===========================================================================*
* sigaction_dmp *
*===========================================================================*/
-void sigaction_dmp()
+void
+sigaction_dmp(void)
{
struct mproc *mp;
int i, n=0;
/* This file contains procedures to dump RS data structures.
*
* The entry points into this file are
- * rproc_dump: display RS system process table
+ * rproc_dump: display RS system process table
*
* Created:
* Oct 03, 2005: by Jorrit N. Herder
/*===========================================================================*
* rproc_dmp *
*===========================================================================*/
-void rproc_dmp()
+void
+rproc_dmp(void)
{
struct rproc *rp;
struct rprocpub *rpub;
/* part of a contiguous identical run? */
is_repeat =
vri &&
- vri_prev_set &&
+ vri_prev_set &&
vri->vri_prot == vri_prev.vri_prot &&
vri->vri_flags == vri_prev.vri_flags &&
vri->vri_length == vri_prev.vri_length &&
(*n)++;
}
-void vm_dmp()
+void
+vm_dmp(void)
{
static struct proc proc[NR_TASKS + NR_PROCS];
static struct vm_region_info vri[LINES];
-/* System Information Service.
+/* System Information Service.
* This service handles the various debugging dumps, such as the process
- * table, so that these no longer directly touch kernel memory. Instead, the
- * system task is asked to copy some table in local memory.
- *
+ * table, so that these no longer directly touch kernel memory. Instead, the
+ * system task is asked to copy some table in local memory.
+ *
* Created:
* Apr 29, 2004 by Jorrit N. Herder
*/
*===========================================================================*/
int main(int argc, char **argv)
{
-/* This is the main routine of this service. The main loop consists of
+/* This is the main routine of this service. The main loop consists of
* three major activities: getting new work, processing the work, and
* sending the reply. The loop never terminates, unless a panic occurs.
*/
- int result;
+ int result;
/* SEF local startup. */
env_setargs(argc, argv);
sef_local_startup();
- /* Main loop - get work and do it, forever. */
- while (TRUE) {
+ /* Main loop - get work and do it, forever. */
+ while (TRUE) {
/* Wait for incoming message, sets 'callnr' and 'who'. */
get_work();
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
-static void sef_local_startup()
+static void
+sef_local_startup(void)
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
/*===========================================================================*
* get_work *
*===========================================================================*/
-static void get_work()
+static void
+get_work(void)
{
int status = 0;
status = sef_receive(ANY, &m_in); /* this blocks until message arrives */
/*===========================================================================*
* reply *
*===========================================================================*/
-static void reply(who, result)
-int who; /* destination */
-int result; /* report result to replyee */
+static void
+reply(
+ int who, /* destination */
+ int result /* report result to replyee */
+)
{
int send_status;
m_out.m_type = result; /* build reply message */