1 /******************************************************************************
2 * Copyright (c) 2004, 2011 IBM Corporation
4 * This program and the accompanying materials
5 * are made available under the terms of the BSD License
6 * which accompanies this distribution, and is available at
7 * http://www.opensource.org/licenses/bsd-license.php
10 * IBM Corporation - initial implementation
11 *****************************************************************************/
14 * libelf Forth wrapper
19 // : elf-load-file ( fileaddr -- entry type )
20 PRIM(ELF_X2d_LOAD_X2d_FILE)
22 void *file_addr = TOS.a;
25 type = elf_load_file(file_addr, &entry, elf_forth_claim, flush_cache);
31 // : elf-load-file-to-addr ( fileaddr destaddr -- entry type )
32 PRIM(ELF_X2d_LOAD_X2d_FILE_X2d_TO_X2d_ADDR)
34 void *dest_addr = TOS.a; POP;
35 void *file_addr = TOS.a;
38 type = elf_load_file_to_addr(file_addr, dest_addr, &entry,
39 elf_forth_claim, flush_cache);