Files | |
file | context.h |
file | cubeos.h |
file | e_handle.c |
file | iobuf.h |
file | ivtab.c |
file | ivtab.h |
file | kerror.c |
file | kerror.h |
file | ptimer.c |
file | ptimer.h |
file | schedule.c |
file | schedule.h |
file | seminl.h |
file | sleep.c |
file | softreset.c |
file | softreset.h |
file | ssem.h |
file | sys_var.c |
file | sys_var.h |
file | taskconst.h |
file | trap.c |
file | trap.h |
Compounds | |
struct | iobuf |
This forms an io buffer. More... | |
struct | process |
process/thread table entry. More... | |
struct | regs |
register structure for context switch. More... | |
struct | sem_s |
contains all data about a semaphore. More... | |
Typedefs | |
typedef regs | reglist |
register structure for context switch. More... | |
typedef sem_s | sem_t |
contains all data about a semaphore. More... | |
Functions | |
void | KERN_contextsw (regptr oldarea, regptr newarea) |
switch CPU context. More... | |
void | KERN_exphandler (unsigned long par1, unsigned long par2,...) |
KERN_exphandler - Exception handler. More... | |
void | iobuf_init (struct iobuf *x, short bl) |
prepares an iobuf for use. More... | |
int | put (struct iobuf *x, char c) |
writes one char into an io buffer. More... | |
char | get (struct iobuf *x) |
reads one char from an io buffer. More... | |
void | KERN_panic () |
This function shuts down the system the hard way. More... | |
void | KERN_complain (int i, char *text) |
This is the general error-reporting function of the kernel. More... | |
int | KERN_installdispatcher (void(*dispatcher)()) |
installs a timer dispatcher routine that is called every tick. More... | |
int | KERN_removedispatcher () |
removes the installed timer dispatcher routine. More... | |
int | KERN_ptint (void) |
periodic timer interrupt routine. More... | |
void | KERN_init_ptimer (void) |
initializes the periodic timer of the '332 SIM. More... | |
unsigned long | _getseconds () |
returns the second counter. More... | |
int | _gettimeofday (struct timeval *tp, struct timezone *ignore) |
fills a struct timeval with the current internal time. More... | |
unsigned long | _settimeofday (unsigned long val) |
sets the internal time from an integer. More... | |
void | _KERN_taskend () |
this ends a thread. More... | |
regptr | _KERN_initcontext (regptr context, short sr, void *sp, void *function) |
initalizes a context. More... | |
int | KERN_create_prio (void *function, int prio) |
create a new threas. More... | |
int | KERN_create (void *function) |
starts a new thread. More... | |
void | KERN_schedule (void) |
this is the scheduler. It is either called by the periodic timer interrupt or from a user thread. More... | |
int | KERN_schedinit () |
initalizes the scheduler. More... | |
int | KERN_suspend (int i) |
suspend a thread. More... | |
int | KERN_wakeup (int i) |
wakes up a thread. More... | |
int | KERN_delta_handler () |
this is the kernel delta list handler. It is called by the periodic timer interrupe. More... | |
void | sem_post (sem_t x) |
post operation on a semaphore. More... | |
void | sem_wait (sem_t x) |
wait operation on a semaphore. More... | |
int | sem_init (sem_t x, int i, int v) |
prepares a semaphore. More... | |
int | sem_destroy (sem_t x) |
destroys a semaphore and releases all threads waiting on it. More... | |
void | KERN_softreset () |
resets the hardware by using a dirty hack. More... | |
void | KERN_sysvarinit () |
initializes some system variables. More... | |
void | trap0 (void) |
Trap Handler. More... | |
void | disable () |
disables interrupt processing. More... | |
void | enable () |
enable interrupt processing. More... | |
void | _KERN_IVTab_init () |
initializes the interrupt vector table. More... | |
int | _KERN_IVTab_setvector (unsigned short vector, void(*isr)(void)) |
sets a vector in the interrupt vector table. More... | |
int | _KERN_IVTab_clearvector (unsigned short vector, void(*isr)(void)) |
resets the interrupt vector table. More... |
|
register structure for context switch.
|
|
contains all data about a semaphore.
|
|
returns the second counter.
|
|
fills a struct timeval with the current internal time.
Definition at line 141 of file ptimer.c. References TICKS_PER_SECOND. |
|
initalizes a context.
Definition at line 61 of file schedule.c. References _KERN_taskend, MAGIC, PNREGS, POS_PC, POS_SR, POS_SSP, sp, and writeint. Referenced by KERN_create_prio. |
|
resets the interrupt vector table.
Definition at line 79 of file ivtab.c. References _KERN_IVTab_oldvector. |
|
initializes the interrupt vector table. Reads out the VBR register of the CPU and stores it in the _KERN_IVTab pointer. Resets the old vectors to zero. _KERN_IVTab_init() is called by crt0.S during initialisation. Definition at line 33 of file ivtab.c. References _KERN_IVTab_oldvector. |
|
sets a vector in the interrupt vector table.
Definition at line 56 of file ivtab.c. References _KERN_IVTab_oldvector. |
|
this ends a thread.
Definition at line 50 of file schedule.c. References KERN_schedule, and process::signal. Referenced by _KERN_initcontext. |
|
sets the internal time from an integer.
Definition at line 163 of file ptimer.c. References PTIMER_PITR_VAL, SIM_PITR, and writeshort. |
|
disables interrupt processing. disable() disabled interrupt processing by setting the interrupt mask in the CPU status register. Note: This functions should be used with extreme care since it also disables IO processing and preemptive scheduling. Definition at line 69 of file cubeos.h. Referenced by I2C_slprocess, I2C_Start_I2C_Transfer, KERN_create_prio, KERN_installdispatcher, KERN_psleep, KERN_removedispatcher, KERN_ssleep, KERN_suspend, KERN_usleep, RSM_getframe, sem_destroy, sem_init, sem_post, sem_wait, TTY_inchar, TTY_outchar, TTY_readchar, and TTY_writechar. |
|
enable interrupt processing. enable() enables interrupt processing by clearing the interrupt mask in the CPU status register. Note: This functions should be used with extreme care since it also re-enables IO processing and preemptive scheduling. Definition at line 73 of file cubeos.h. Referenced by I2C_slprocess, I2C_Start_I2C_Transfer, KERN_create_prio, KERN_installdispatcher, KERN_psleep, KERN_removedispatcher, KERN_ssleep, KERN_suspend, KERN_usleep, RSM_getframe, sem_destroy, sem_init, sem_post, sem_wait, TTY_inchar, TTY_outchar, TTY_readchar, and TTY_writechar. |
|
reads one char from an io buffer.
Definition at line 89 of file iobuf.h. References iobuf::buflen, iobuf::cnt, iobuf::data, and iobuf::tail. |
|
prepares an iobuf for use.
Definition at line 43 of file iobuf.h. References iobuf::buflen, BUFLEN, iobuf::cnt, iobuf::head, and iobuf::tail. Referenced by DUART_duart, QSM_sciinit, and TTY_init. |
|
This is the general error-reporting function of the kernel.
Definition at line 52 of file kerror.c. References ERR_PANIC, and KERN_panic. |
|
switch CPU context.
Referenced by KERN_schedule. |
|
starts a new thread.
Definition at line 166 of file schedule.c. References KERN_create_prio. |
|
create a new threas.
Definition at line 106 of file schedule.c. References _KERN_initcontext, _LIBC_init_reent, disable, enable, ERR_EMERG, getpid, process::irq, KERN_complain, LIST_insert_tail, malloc, MAX_PRIONUM, process::next, NO_TASK, PNREGS, process::ppid, process::prio, regs::regs, process::regs, process::signal, process::stack, process::state, STATE_EMPTY, STATE_READY, TASK_INIT_IRQLVL, TASK_INIT_SR, TASK_INIT_STACKSIZE, and process::time_delta. Referenced by KERN_create. |
|
this is the kernel delta list handler. It is called by the periodic timer interrupe.
Definition at line 426 of file schedule.c. References _KERN_delta, KERN_wakeup, and LIST_entries. Referenced by KERN_ptint. |
|
KERN_exphandler - Exception handler.
Definition at line 38 of file e_handle.c. References readshort, SIM_MCR, TTY_MODE_RXBLOCKING, TTY_MODE_TXBLOCKING, TTY_MODE_TXUNBUF, TTY_soutchar, and writeshort. |
|
initializes the periodic timer of the '332 SIM.
Definition at line 103 of file ptimer.c. References PTIMER_IRQ_LEVEL, PTIMER_PITR_VAL, PTIMER_VECTOR, SIM_PICR, SIM_PITR, writeshort, and writeshortpos. |
|
installs a timer dispatcher routine that is called every tick.
Definition at line 34 of file ptimer.c. References _KERN_call_dispatcher, disable, and enable. |
|
This function shuts down the system the hard way.
Definition at line 29 of file kerror.c. References readshort, SIM_MCR, and writeshort. Referenced by KERN_complain. |
|
periodic timer interrupt routine. This function is called by the periodic timer interrupt. Definition at line 69 of file ptimer.c. References _DUART_duart_bugfix, _KERN_call_dispatcher, KERN_delta_handler, QUANTUM, and TICKS_PER_SECOND. |
|
removes the installed timer dispatcher routine.
Definition at line 48 of file ptimer.c. References _KERN_call_dispatcher, disable, and enable. |
|
initalizes the scheduler.
Definition at line 317 of file schedule.c. References _KERN_delta, _LIBC_init_reent, entry_s::data, entry_s::len, LIST_init, LIST_makeentry, LIST_TYPE_PRIO, LIST_TYPE_SYS, MAX_PRIONUM, process::me, process::pid, PNREGS, process::ppid, process::prio, process::reent, regs::regs, process::regs, process::signal, process::stack, process::state, STATE_EMPTY, STATE_RUNNING, and list_s::type. |
|
this is the scheduler. It is either called by the periodic timer interrupt or from a user thread.
Definition at line 175 of file schedule.c. References ERR_PANIC, getpid, KERN_complain, KERN_contextsw, LIST_delete, LIST_entries, LIST_head, LIST_insert_tail, MAX_PRIONUM, process::reent, process::signal, process::state, STATE_EMPTY, STATE_READY, STATE_RUNNING, and STATE_SUSPEND. Referenced by _KERN_taskend, and KERN_suspend. |
|
resets the hardware by using a dirty hack. This function disables the clock output of the 68332 that is used to retrigger the external DS1232 watchdog chip. After losing the retrigger signal for about 500ms, the DS1232 will pull the reset line low. I would like to use the RESET assembler instruction, but that would only reset the external devices and leave the CPU running, which might not be as clean as I'd like it to be. Definition at line 32 of file softreset.c. References readshort, SIM_MCR, and writeshort. Referenced by QSM_sci_int. |
|
suspend a thread.
Definition at line 361 of file schedule.c. References disable, enable, KERN_schedule, entry_s::list, LIST_delete, LIST_TYPE_PRIO, process::me, process::state, STATE_EMPTY, STATE_SUSPEND, and list_s::type. |
|
initializes some system variables.
Definition at line 37 of file sys_var.c. References _KERN_disablecount, and KERN_srsave. |
|
wakes up a thread.
Definition at line 405 of file schedule.c. References LIST_delete, LIST_insert_head, process::state, STATE_READY, and STATE_SUSPEND. Referenced by KERN_delta_handler. |
|
writes one char into an io buffer.
Definition at line 68 of file iobuf.h. References iobuf::buflen, iobuf::cnt, iobuf::data, and iobuf::head. |
|
destroys a semaphore and releases all threads waiting on it.
Definition at line 118 of file seminl.h. References disable, enable, sem_s::init, NO_TASK, sem_s::task, and wakeup. |
|
prepares a semaphore.
Definition at line 102 of file seminl.h. References sem_s::c, disable, enable, sem_s::init, NO_TASK, and sem_s::task. |
|
post operation on a semaphore.
Definition at line 45 of file seminl.h. References sem_s::c, disable, enable, sem_s::init, NO_TASK, sem_s::task, and wakeup. |
|
wait operation on a semaphore.
Definition at line 69 of file seminl.h. References sem_s::c, disable, enable, getpid, sem_s::init, KERN_suspend, NO_TASK, and sem_s::task. |
|
Trap Handler.
|