URL
https://opencores.org/ocsvn/eco32/eco32/trunk
[/] [eco32/] [tags/] [eco32-0.22/] [sim/] [console.c] - Diff between revs 8 and 21
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 8 |
Rev 21 |
/*
|
/*
|
* console.c -- the simulator's operator console
|
* console.c -- the simulator's operator console
|
*/
|
*/
|
|
|
|
|
#include <stdio.h>
|
#include <stdio.h>
|
#include <stdlib.h>
|
#include <stdlib.h>
|
#include <string.h>
|
#include <string.h>
|
#include <stdarg.h>
|
#include <stdarg.h>
|
#include <signal.h>
|
#include <signal.h>
|
|
|
#include "common.h"
|
#include "common.h"
|
#include "console.h"
|
#include "console.h"
|
#include "error.h"
|
#include "error.h"
|
#include "cpu.h"
|
#include "cpu.h"
|
|
|
#include "getline.h"
|
#include "getline.h"
|
|
|
|
|
static void (*oldSigIntHandler)(int signum);
|
static void (*oldSigIntHandler)(int signum);
|
|
|
|
|
static void newSigIntHandler(int signum) {
|
static void newSigIntHandler(int signum) {
|
signal(SIGINT, newSigIntHandler);
|
signal(SIGINT, newSigIntHandler);
|
cpuHalt();
|
cpuHalt();
|
}
|
}
|
|
|
|
|
char *cGetLine(char *prompt) {
|
char *cGetLine(char *prompt) {
|
return gl_getline(prompt);
|
return gl_getline(prompt);
|
}
|
}
|
|
|
|
|
void cAddHist(char *line) {
|
void cAddHist(char *line) {
|
gl_histadd(line);
|
gl_histadd(line);
|
}
|
}
|
|
|
|
|
void cPrintf(char *format, ...) {
|
void cPrintf(char *format, ...) {
|
va_list ap;
|
va_list ap;
|
|
|
va_start(ap, format);
|
va_start(ap, format);
|
vprintf(format, ap);
|
vprintf(format, ap);
|
va_end(ap);
|
va_end(ap);
|
}
|
}
|
|
|
|
|
void cInit(void) {
|
void cInit(void) {
|
oldSigIntHandler = signal(SIGINT, newSigIntHandler);
|
oldSigIntHandler = signal(SIGINT, newSigIntHandler);
|
}
|
}
|
|
|
|
|
void cExit(void) {
|
void cExit(void) {
|
signal(SIGINT, oldSigIntHandler);
|
signal(SIGINT, oldSigIntHandler);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.