00001 /* 00002 * libspe2 - A wrapper library to adapt the JSRE SPE usage model to SPUFS 00003 * Copyright (C) 2005 IBM Corp. 00004 * 00005 * This library is free software; you can redistribute it and/or modify it 00006 * under the terms of the GNU Lesser General Public License as published by 00007 * the Free Software Foundation; either version 2.1 of the License, 00008 * or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, but 00011 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00012 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00013 * License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public License 00016 * along with this library; if not, write to the Free Software Foundation, 00017 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 */ 00019 00020 #include "spebase.h" 00021 #include <elf.h> 00022 00023 #define LS_SIZE 0x40000 /* 256K (in bytes) */ 00024 00025 #define SPE_LDR_PROG_start (LS_SIZE - 512) // location of spe_ld.so prog 00026 #define SPE_LDR_PARAMS_start (LS_SIZE - 128) // location of spe_ldr_params 00027 00028 typedef union 00029 { 00030 unsigned long long ull; 00031 unsigned int ui[2]; 00032 } addr64; 00033 00034 struct spe_ld_info 00035 { 00036 unsigned int entry; 00037 }; 00038 00039 /* 00040 * Global API : */ 00041 00042 int _base_spe_verify_spe_elf_image(spe_program_handle_t *handle); 00043 00044 int _base_spe_load_spe_elf (spe_program_handle_t *handle, void *ld_buffer, 00045 struct spe_ld_info *ld_info); 00046 00047 int _base_spe_parse_isolated_elf(spe_program_handle_t *handle, 00048 uint64_t *addr, uint32_t *size); 00049 00050 int _base_spe_toe_ear (spe_program_handle_t *speh); 00051