Esempio n. 1
0
void
SimpleCpcClient::cmd_list(char *arg) {
  Properties p;
  Vector<Process> proc_list;
  list_processes(proc_list, p);

  for(size_t i = 0; i < proc_list.size(); i++) {
    printproc(proc_list[i]);
  }
}
void printmsg(message *msg, struct proc *src, struct proc *dst,
	char operation, int printparams)
{
	const char *name;
	int mtype = msg->m_type, mightbecall = 0;

#ifdef DEBUG_DUMPIPC_NAMES
  {
	char *names[] = DEBUG_DUMPIPC_NAMES;
	int nnames = sizeof(names)/sizeof(names[0]);

	/* skip printing messages for messages neither to
	 * or from DEBUG_DUMPIPC_EP if it is defined; either
	 * can be NULL to indicate kernel
	 */
	if(!(src && namematch(names, nnames, src->p_name)) &&
	   !(dst && namematch(names, nnames, dst->p_name))) {
		return;
	}
  }
#endif

	/* source, destination and message type */
	printf("%c", operation);
	printproc(src);
	printproc(dst);
	name = mtypename(mtype, &mightbecall);
	if (name) {
		printf(" %s(%d/0x%x)", name, mtype, mtype);
	} else {
		printf(" %d/0x%x", mtype, mtype);
	}

	if (mightbecall && printparams) {
#define IDENT(x, y) if (mtype == x) printparam(#y, &msg->y, sizeof(msg->y));
#include "kernel/extracted-mfield.h"
#undef IDENT
	}
	printf("\n");
}
Esempio n. 3
0
PRIVATE void printmsg(message *msg, struct proc *src, struct proc *dst, 
	char operation, int iscall, int printparams)
{
	const char *name;
	int mtype = msg->m_type;

	/* source, destination and message type */
	printf("%c", operation);
	printproc(src);
	printproc(dst);
	name = mtypename(mtype, iscall);
	if (name) {
		printf(" %s(%d)", name, mtype);
	} else {
		printf(" %d", mtype);
	}

	if (iscall && printparams) {
#define IDENT(x, y) if (mtype == x) printparam(#y, &msg->y, sizeof(msg->y));
#include "extracted-mfield.h"
#undef IDENT
	}
	printf("\n");
}
Esempio n. 4
0
void
consoleintr(int (*getc)(void))
{
  int c;

  while((c = getc()) >= 0){
   switch(c){
    case C('U'):  // Kill line.
      while(input.e != input.w &&
            input.buf[(input.e-1) % INPUT_BUF] != '\n'){
        input.e--;
        consputc(BACKSPACE);
      }
      break;
    case C('H'): case '\x7f':  // Backspace
      if(input.e != input.w){
        input.e--;
        consputc(BACKSPACE);
      }
      break;
    default:
      if(c != 0 && input.e-input.r < INPUT_BUF){
      	c = (c == '\r') ? '\n' : c;
        if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
 		consputc(c);	   
		if(getcmd() == 1){
		  cprintf("Building a process...\n");
		  confirmalloc();

		}else if(getcmd() == 2){
		  cprintf("Showing the Process Table...\n");
		  printproc();
		}else if(getcmd() == 0){
		    if(input.e!=0)
		  	cprintf("Unknow command\n");
		}
		input.e = 0;
	}
	else{	    
       	  input.buf[input.e++ % INPUT_BUF] = c;
          consputc(c);
        }
      }
      break;
    }
  }
}