OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [orpmon/] [common/] [common.c] - Diff between revs 921 and 1312

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 921 Rev 1312
Line 4... Line 4...
#include "support.h"
#include "support.h"
#include "keyboard.h"
#include "keyboard.h"
#include "spr_defs.h"
#include "spr_defs.h"
#include "int.h"
#include "int.h"
 
 
 
#include "build.h"
 
 
#define MAX_COMMANDS  100
#define MAX_COMMANDS  100
 
 
extern unsigned long src_addr;
extern unsigned long src_addr;
 
 
bd_t bd;
bd_t bd;
 
 
int num_commands = 0;
int num_commands = 0;
 
 
command_struct command[MAX_COMMANDS];
command_struct command[MAX_COMMANDS];
 
 
 
 
 
 
void putc (const char c)
void putc (const char c)
{
{
  debug ("putc %i, %i = %c\n", bd.bi_console_type, c, c);
  debug ("putc %i, %i = %c\n", bd.bi_console_type, c, c);
  switch (bd.bi_console_type) {
  switch (bd.bi_console_type) {
  case CT_NONE:
  case CT_NONE:
Line 50... Line 50...
    kbd_tail = (kbd_tail + 1) % KBDBUF_SIZE;
    kbd_tail = (kbd_tail + 1) % KBDBUF_SIZE;
    return ch;
    return ch;
#endif
#endif
  case CT_UART:
  case CT_UART:
    return uart_getc ();
    return uart_getc ();
 
    break;
 
  case CT_NONE: /* just to satisfy the compiler */
 
  case CT_SIM:
 
    break;
  }
  }
  return -1;
  return -1;
}
}
 
 
int testc ()
int testc ()
Line 65... Line 69...
    if (kbd_head == kbd_tail) return 0;
    if (kbd_head == kbd_tail) return 0;
    else return getc ();
    else return getc ();
#endif
#endif
  case CT_UART:
  case CT_UART:
    return uart_testc ();
    return uart_testc ();
 
    break;
 
  case CT_NONE: /* just to satisfy the compiler */
 
  case CT_SIM:
 
    break;
  }
  }
  return -1;
  return -1;
}
}
 
 
int ctrlc ()
int ctrlc ()
Line 154... Line 162...
 
 
  /* Show prompt */
  /* Show prompt */
#ifdef XESS
#ifdef XESS
  printf ("\norp-xsv> ");
  printf ("\norp-xsv> ");
#else
#else
  printf ("\nbender> ");
  printf ("\n" BOARD_DEF_NAME"> ");
#endif
#endif
 
 
  /* Get characters from UART */
  /* Get characters from UART */
  c = getc();
  c = getc();
  while (c != '\r' && c != '\f' && c != '\n')
  while (c != '\r' && c != '\f' && c != '\n')
Line 206... Line 214...
        }
        }
 
 
        found++;
        found++;
        break;
        break;
      }
      }
 
    /* 'built-in' build command */
 
    if(strcmp(command_str, "build") == 0) {
 
      printf("Build tag: %s", BUILD_VERSION);
 
      found++;
 
    }
      if (!found)
      if (!found)
        printf ("Unknown command. Type 'help' for help.\n");
        printf ("Unknown command. Type 'help' for help.\n");
  }
  }
 
 
}
}
Line 235... Line 247...
void tick_init(void);
void tick_init(void);
void module_touch_init (void);
void module_touch_init (void);
void module_ata_init (void);
void module_ata_init (void);
void module_hdbug_init (void);
void module_hdbug_init (void);
 
 
 
 
/* List of all initializations */
/* List of all initializations */
void mon_init (void)
void mon_init (void)
{
{
  /* Set defaults */
  /* Set defaults */
  global.erase_method = 2; /* as needed */
  global.erase_method = 2; /* as needed */
Line 270... Line 283...
 
 
/* Main shell loop */
/* Main shell loop */
int main(int argc, char **argv)
int main(int argc, char **argv)
{
{
  extern unsigned long calc_mycrc32 (void);
  extern unsigned long calc_mycrc32 (void);
  unsigned long t;
#if 0
#if 1
 
  extern unsigned long mycrc32, mysize;
  extern unsigned long mycrc32, mysize;
#endif
#endif
 
 
  int_init ();
  int_init ();
  change_console_type (CONSOLE_TYPE);
  change_console_type (CONSOLE_TYPE);
Line 294... Line 306...
  if (HELP_ENABLED) register_command ("help", "", "shows this help", help_cmd);
  if (HELP_ENABLED) register_command ("help", "", "shows this help", help_cmd);
 
 
#ifdef XESS
#ifdef XESS
  printf ("\nORP-XSV Monitor (type 'help' for help)\n");
  printf ("\nORP-XSV Monitor (type 'help' for help)\n");
#else
#else
  printf ("\nBender Monitor (type 'help' for help)\n");
  printf ("\n" BOARD_DEF_NAME " Monitor (type 'help' for help)\n");
#endif
#endif
 
 
  while(1) mon_command();
  while(1) mon_command();
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.