Updated PCI IDs to latest snapshot.
[tangerine.git] / arch / ppc-all / prep / kernel / kernel_init.c
blob4fbbf6778b87e4cc77e92ee6731e9da1a2c2d5bd
1 /*
2 Copyright C 2003, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: kernel.resource startup file
6 Lang: English
7 */
9 #include <exec/types.h>
10 #include <exec/resident.h>
11 #include <exec/execbase.h>
12 #include <exec/memory.h>
14 #include <asm/macros.h>
15 #include <aros/libcall.h>
16 #include <aros/asmcall.h>
18 #include <proto/exec.h>
19 #include <proto/kernel.h>
21 #include "kernel.h"
22 #include "libdefs.h"
24 static const char Kernel_VersionID[] = VERSION_STRING;
25 static const char Kernel_Name[] = NAME_STRING;
27 struct KernelBase * Kernel_init();
29 #ifndef __ROM__
30 static LONG __no_exec()
32 return(-1);
34 #endif
36 struct Resident Kernel_Resident SECTION_CODE = {
37 RTC_MATCHWORD,
38 &Kernel_Resident,
39 &Kernel_end,
41 VERSION_NUMBER,
42 NT_RESOURCE,
43 125,
44 Kernel_Name,
45 Kernel_VersionID,
46 Kernel_init
49 #ifdef SysBase
50 #undef SysBase
51 #endif
53 AROS_UFH3(struct KernelBase *, Kernel_init,
54 AROS_UFHA(ULONG, dummy, D0),
55 AROS_UFHA(ULONG, slist, A0),
56 AROS_UFHA(struct ExecBase *, SysBase, A6))
58 AROS_USERFUNC_INIT
60 struct KernelBase *KernelBase = NULL;
61 UWORD neg = AROS_ALIGN(LIB_VECTSIZE * VECTOR_COUNT);
63 KernelBase = (struct KernelBase *)
64 ((ULONG)AllocMem(neg + sizeof(struct KernelBase),
65 MEMF_CLEAR | MEMF_PUBLIC) + neg);
67 if (KernelBase)
69 KernelBase->sysBase = SysBase;
70 KernelBase->node.ln_Pri = Kernel_Resident.rt_Pri;
71 KernelBase->node.ln_Name = Kernel_Resident.rt_Name;
72 KernelBase->node.ln_Type = NT_RESOURCE;
74 MakeFunctions(KernelBase, (APTR)LIBFUNCTABLE, NULL);
75 AddResource(KernelBase);
78 return(KernelBase);
80 AROS_USERFUNC_EXIT