Changeset 874621f in mainline for generic/include


Ignore:
Timestamp:
2006-06-06T07:40:51Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0dbc4e7
Parents:
6f9a9bc
Message:

Added kernel circular buffer klog.
Added automatic killing of tasks raising inappropriate exceptions.
TODO Fix vsnprintf return value(and behaviour according to specs) and remove workaround in klog.

Location:
generic/include
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • generic/include/interrupt.h

    r6f9a9bc r874621f  
    3333#include <typedefs.h>
    3434#include <arch/types.h>
     35#include <proc/task.h>
     36#include <proc/thread.h>
     37#include <arch.h>
     38#include <console/klog.h>
     39#include <ipc/irq.h>
    3540
    3641#ifndef IVT_ITEMS
     
    4247#endif
    4348
     49#define fault_if_from_uspace(istate, cmd, ...) \
     50{ \
     51        if (istate_from_uspace(istate)) { \
     52                klog_printf(cmd, ##__VA_ARGS__); \
     53                klog_printf("Task %lld got exception at PC:%P. Task killed.", TASK->taskid, istate_get_pc(istate)); \
     54                task_kill(TASK->taskid); \
     55                thread_exit(); \
     56        } \
     57}
     58
     59
    4460extern iroutine exc_register(int n, const char *name, iroutine f);
    4561extern void exc_dispatch(int n, istate_t *t);
  • generic/include/ipc/irq.h

    r6f9a9bc r874621f  
    3030#define __IRQ_H__
    3131
     32/** Maximum length of IPC IRQ program */
    3233#define IRQ_MAX_PROG_SIZE 10
     34
     35/** Reserved 'virtual' messages for kernel notifications */
     36#define IPC_IRQ_RESERVED_VIRTUAL 10
     37
     38#define IPC_IRQ_KLOG  (-1)
    3339
    3440typedef enum {
     
    6066#ifdef KERNEL
    6167
     68#include <ipc/ipc.h>
     69
    6270extern void ipc_irq_make_table(int irqcount);
    6371extern int ipc_irq_register(answerbox_t *box, int irq, irq_code_t *ucode);
    6472extern void ipc_irq_send_notif(int irq);
     73extern void ipc_irq_send_msg(int irq, __native a2, __native a3);
    6574extern void ipc_irq_unregister(answerbox_t *box, int irq);
    6675extern void irq_ipc_bind_arch(__native irq);
  • generic/include/ipc/sysipc.h

    r6f9a9bc r874621f  
    4848                              __native method, __native arg1);
    4949__native sys_ipc_hangup(int phoneid);
    50 __native sys_ipc_register_irq(__native irq, irq_code_t *ucode);
    51 __native sys_ipc_unregister_irq(__native irq);
     50__native sys_ipc_register_irq(int irq, irq_code_t *ucode);
     51__native sys_ipc_unregister_irq(int irq);
    5252
    5353#endif
  • generic/include/proc/thread.h

    r6f9a9bc r874621f  
    151151extern thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, int flags, char *name);
    152152extern void thread_ready(thread_t *t);
    153 extern void thread_exit(void);
     153extern void thread_exit(void) __attribute__((noreturn));
    154154
    155155#ifndef thread_create_arch
  • generic/include/stackarg.h

    r6f9a9bc r874621f  
    5050        (*((type *)((ap).last + ((ap).pos  += sizeof(type) ) - sizeof(type))))
    5151
     52#define va_copy(dst,src)       dst=src
    5253#define va_end(ap)
    5354
  • generic/include/stdarg.h

    r6f9a9bc r874621f  
    4141#define va_arg(ap, type)                __builtin_va_arg(ap, type)
    4242#define va_end(ap)                      __builtin_va_end(ap)
     43#define va_copy(dst,src)                __builtin_va_copy(dst,src)
    4344
    4445#endif
Note: See TracChangeset for help on using the changeset viewer.