30 #ifndef SPE_EMULATED_LOADER_FILE
31 #define SPE_EMULATED_LOADER_FILE "/usr/lib/spe/emulated-loader.bin"
47 DEBUG_PRINTF(
"%s called, but no program loaded\n", __func__);
55 len = sprintf(buf,
"%p", program->
elf_image);
56 write(objfd, buf, len + 1);
73 static inline int __write_isolated_load_params(
struct spe_context *spe,
74 uint32_t addr_h, uint32_t addr_l, uint32_t size)
83 if ((write(fd, &addr_h,
sizeof(uint32_t)) !=
sizeof(uint32_t)) ||
84 (write(fd, &addr_l,
sizeof(uint32_t)) !=
sizeof(uint32_t)) ||
85 (write(fd, &size,
sizeof(uint32_t)) !=
sizeof(uint32_t))) {
86 DEBUG_PRINTF(
"%s: error writing to wbox\n", __FUNCTION__);
102 static int spe_start_isolated_app(
struct spe_context *spe,
106 uint32_t size, addr_h, addr_l;
109 DEBUG_PRINTF(
"%s: invalid isolated image\n", __FUNCTION__);
115 DEBUG_PRINTF(
"%s: isolated image is incorrectly aligned\n",
121 addr_l = (uint32_t)(addr & 0xffffffff);
122 addr_h = (uint32_t)(addr >> 32);
124 DEBUG_PRINTF(
"%s: Sending isolated app params: 0x%08x 0x%08x 0x%08x\n",
125 __FUNCTION__, addr_h, addr_l, size);
127 if (__write_isolated_load_params(spe, addr_h, addr_l, size)) {
181 static int spe_start_emulated_isolated_app(
struct spe_context *spe,
189 loader = emulated_loader_program();
196 DEBUG_PRINTF(
"%s: No loader available\n", __FUNCTION__);
200 return spe_start_isolated_app(spe, handle);
211 rc = spe_start_isolated_app(spe, program);
214 rc = spe_start_emulated_isolated_app(spe, program, &ld_info);