/kernel/trunk/generic/include/stackarg.h |
---|
49,6 → 49,7 |
#define va_arg(ap, type) \ |
(*((type *)((ap).last + ((ap).pos += sizeof(type) ) - sizeof(type)))) |
#define va_copy(dst,src) dst=src |
#define va_end(ap) |
/kernel/trunk/generic/include/proc/thread.h |
---|
150,7 → 150,7 |
extern void thread_init(void); |
extern thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, int flags, char *name); |
extern void thread_ready(thread_t *t); |
extern void thread_exit(void); |
extern void thread_exit(void) __attribute__((noreturn)); |
#ifndef thread_create_arch |
extern void thread_create_arch(thread_t *t); |
/kernel/trunk/generic/include/interrupt.h |
---|
32,6 → 32,11 |
#include <arch/interrupt.h> |
#include <typedefs.h> |
#include <arch/types.h> |
#include <proc/task.h> |
#include <proc/thread.h> |
#include <arch.h> |
#include <console/klog.h> |
#include <ipc/irq.h> |
#ifndef IVT_ITEMS |
# define IVT_ITEMS 0 |
41,6 → 46,17 |
# define IVT_FIRST 0 |
#endif |
#define fault_if_from_uspace(istate, cmd, ...) \ |
{ \ |
if (istate_from_uspace(istate)) { \ |
klog_printf(cmd, ##__VA_ARGS__); \ |
klog_printf("Task %lld got exception at PC:%P. Task killed.", TASK->taskid, istate_get_pc(istate)); \ |
task_kill(TASK->taskid); \ |
thread_exit(); \ |
} \ |
} |
extern iroutine exc_register(int n, const char *name, iroutine f); |
extern void exc_dispatch(int n, istate_t *t); |
void exc_init(void); |
/kernel/trunk/generic/include/console/klog.h |
---|
0,0 → 1,35 |
/* |
* Copyright (C) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef _KLOG_H_ |
#define _KLOG_H_ |
void klog_init(void); |
void klog_printf(const char *fmt, ...); |
#endif |
/kernel/trunk/generic/include/stdarg.h |
---|
40,5 → 40,6 |
#define va_start(ap, last) __builtin_va_start(ap, last) |
#define va_arg(ap, type) __builtin_va_arg(ap, type) |
#define va_end(ap) __builtin_va_end(ap) |
#define va_copy(dst,src) __builtin_va_copy(dst,src) |
#endif |
/kernel/trunk/generic/include/ipc/sysipc.h |
---|
47,7 → 47,7 |
__native sys_ipc_forward_fast(__native callid, __native phoneid, |
__native method, __native arg1); |
__native sys_ipc_hangup(int phoneid); |
__native sys_ipc_register_irq(__native irq, irq_code_t *ucode); |
__native sys_ipc_unregister_irq(__native irq); |
__native sys_ipc_register_irq(int irq, irq_code_t *ucode); |
__native sys_ipc_unregister_irq(int irq); |
#endif |
/kernel/trunk/generic/include/ipc/irq.h |
---|
29,8 → 29,14 |
#ifndef __IRQ_H__ |
#define __IRQ_H__ |
/** Maximum length of IPC IRQ program */ |
#define IRQ_MAX_PROG_SIZE 10 |
/** Reserved 'virtual' messages for kernel notifications */ |
#define IPC_IRQ_RESERVED_VIRTUAL 10 |
#define IPC_IRQ_KLOG (-1) |
typedef enum { |
CMD_MEM_READ_1 = 0, |
CMD_MEM_READ_2, |
59,9 → 65,12 |
#ifdef KERNEL |
#include <ipc/ipc.h> |
extern void ipc_irq_make_table(int irqcount); |
extern int ipc_irq_register(answerbox_t *box, int irq, irq_code_t *ucode); |
extern void ipc_irq_send_notif(int irq); |
extern void ipc_irq_send_msg(int irq, __native a2, __native a3); |
extern void ipc_irq_unregister(answerbox_t *box, int irq); |
extern void irq_ipc_bind_arch(__native irq); |
extern void ipc_irq_cleanup(answerbox_t *box); |