fix a typo - clear all the alerts, and not the 2nd twice
[AROS.git] / bootstrap / include / elfloader.h
blob40781dd37bfa2b2dcbbc6b368a698e96b94a7fb4
1 /*
2 * Copyright (C) 2006 - 2011 The AROS Development Team. All rights reserved.
3 * $Id$
4 */
6 #ifndef BOOTSTRAP_ELFLOADER_H_
7 #define BOOTSTRAP_ELFLOADER_H_
9 #include <inttypes.h>
11 /* The loader operates with a single-linked list of these structures */
12 struct ELFNode
14 struct ELFNode *Next;
15 struct sheader *sh;
16 struct elfheader *eh;
17 char *Name;
20 /* Some forward declarations */
21 struct TagItem;
22 struct KernelBSS;
23 struct ELF_ModuleInfo;
25 /* This is the calling convention for kickstart entry point */
26 typedef int (*kernel_entry_fun_t)(struct TagItem *, unsigned int);
28 /* Two main functions you will use */
29 int GetKernelSize(struct ELFNode *FirstELF, unsigned long *ro_size, unsigned long *rw_size, unsigned long *bss_size);
30 int LoadKernel(struct ELFNode *FirstELF, void *ptr_ro, void *ptr_rw, char *bss_tracker, uintptr_t DefSysBase,
31 void **kick_end, kernel_entry_fun_t *kernel_entry, struct ELF_ModuleInfo **kernel_debug);
34 * These functions are used to access files by the loader.
35 * They need to be provided by your bootstrap implementation.
37 void *open_file(struct ELFNode *n, unsigned int *err);
38 void close_file(void *file);
39 int read_block(void *file, unsigned long offset, void *dest, unsigned long length);
40 void *load_block(void *file, unsigned long offset, unsigned long length, unsigned int *err);
41 void free_block(void *addr);
43 #endif