Annotation of prex-old/sys/include/kernel.h, Revision 1.1
1.1 ! nbrk 1: /*-
! 2: * Copyright (c) 2005-2007, Kohsuke Ohtani
! 3: * All rights reserved.
! 4: *
! 5: * Redistribution and use in source and binary forms, with or without
! 6: * modification, are permitted provided that the following conditions
! 7: * are met:
! 8: * 1. Redistributions of source code must retain the above copyright
! 9: * notice, this list of conditions and the following disclaimer.
! 10: * 2. Redistributions in binary form must reproduce the above copyright
! 11: * notice, this list of conditions and the following disclaimer in the
! 12: * documentation and/or other materials provided with the distribution.
! 13: * 3. Neither the name of the author nor the names of any co-contributors
! 14: * may be used to endorse or promote products derived from this software
! 15: * without specific prior written permission.
! 16: *
! 17: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
! 18: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! 19: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! 20: * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
! 21: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! 22: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
! 23: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 24: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! 25: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
! 26: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 27: * SUCH DAMAGE.
! 28: */
! 29:
! 30: #ifndef _KERNEL_H
! 31: #define _KERNEL_H
! 32:
! 33: #include <sys/param.h>
! 34: #include <sys/list.h>
! 35: #include <sys/errno.h>
! 36: #include <prex/bootinfo.h>
! 37: #include <machine/stdarg.h>
! 38: #include <arch.h>
! 39: #include <platform.h>
! 40: #include <debug.h>
! 41:
! 42: typedef struct object *object_t;
! 43: typedef struct task *task_t;
! 44: typedef struct thread *thread_t;
! 45: typedef struct device *device_t;
! 46: typedef struct mutex *mutex_t;
! 47: typedef struct cond *cond_t;
! 48: typedef struct sem *sem_t;
! 49: typedef struct vm_map *vm_map_t;
! 50: typedef uint32_t cap_t;
! 51:
! 52: #include <prex/sysinfo.h>
! 53:
! 54: /*
! 55: * Magic numbers
! 56: */
! 57: #define OBJECT_MAGIC 0x4f626a3f /* 'Obj?' */
! 58: #define TASK_MAGIC 0x54736b3f /* 'Tsk?' */
! 59: #define THREAD_MAGIC 0x5468723f /* 'Thr?' */
! 60: #define DEVICE_MAGIC 0x4465763f /* 'Dev?' */
! 61: #define MUTEX_MAGIC 0x4d75783f /* 'Mux?' */
! 62: #define COND_MAGIC 0x436f6e3f /* 'Con?' */
! 63: #define SEM_MAGIC 0x53656d3f /* 'Sem?' */
! 64:
! 65: /*
! 66: * Global variables
! 67: */
! 68: extern struct thread *cur_thread; /* pointer to the current thread */
! 69: extern struct task kern_task; /* kernel task */
! 70: extern struct boot_info *boot_info; /* pointer to boot information */
! 71: #ifdef DEBUG
! 72: extern volatile int irq_level; /* current interrupt level */
! 73: #endif
! 74:
! 75: extern size_t strlcpy(char *, const char *, size_t);
! 76: extern int strncmp(const char *, const char *, size_t);
! 77: extern size_t strnlen(const char *, size_t);
! 78: extern void *memcpy(void *, const void *, size_t);
! 79: extern void *memset(void *, int, size_t);
! 80: extern int vsprintf(char *, const char *, va_list);
! 81:
! 82: #endif /* !_KERNEL_H */
CVSweb