From 291d9f53d1799ae0529699504ade0f2a7917e4ad Mon Sep 17 00:00:00 2001 From: dhewg Date: Wed, 14 Jul 2010 16:58:31 +0200 Subject: [PATCH] new ipc call IPC_PPC_BOOT_FILE. patch by trap15 --- ipc.h | 7 ++++--- powerpc.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ipc.h b/ipc.h index 5807841..55b925e 100644 --- a/ipc.h +++ b/ipc.h @@ -79,7 +79,7 @@ Copyright (C) 2009 John Kelley // etc. #define IPC_SDHC_DISCOVER 0x0000 -#define IPC_SDHC_EXIT 0x0001 +#define IPC_SDHC_EXIT 0x0001 #define IPC_SDMMC_ACK 0x0000 #define IPC_SDMMC_READ 0x0001 @@ -92,13 +92,14 @@ Copyright (C) 2009 John Kelley #define IPC_AES_RESET 0x0000 #define IPC_AES_SETIV 0x0001 -#define IPC_AES_SETKEY 0x0002 -#define IPC_AES_DECRYPT 0x0003 +#define IPC_AES_SETKEY 0x0002 +#define IPC_AES_DECRYPT 0x0003 #define IPC_BOOT2_RUN 0x0000 #define IPC_BOOT2_TMD 0x0001 #define IPC_PPC_BOOT 0x0000 +#define IPC_PPC_BOOT_FILE 0x0001 #define IPC_CODE (f,d,r) (((f)<<24)|((d)<<16)|(r)) diff --git a/powerpc.c b/powerpc.c index e9af11b..9259068 100644 --- a/powerpc.c +++ b/powerpc.c @@ -4,6 +4,7 @@ Copyright (C) 2008, 2009 Sven Peter Copyright (C) 2009 Andre Heider "dhewg" +Copyright (C) 2010 Alex Marshall # This code is licensed to you under the terms of the GNU GPL, version 2; # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt @@ -15,6 +16,7 @@ Copyright (C) 2009 Andre Heider "dhewg" #include "powerpc_elf.h" #include "hollywood.h" #include "utils.h" +#include "string.h" #include "start.h" #include "gecko.h" @@ -83,6 +85,21 @@ void powerpc_ipc(volatile ipc_request *req) } break; + + case IPC_PPC_BOOT_FILE: + if (req->args[0]) { + // Enqueued from ARM side, do not invalidate mem nor ipc_post + powerpc_boot_file((char *) req->args[1]); + } else { + dc_invalidaterange((void *) req->args[1], + strnlen((char *) req->args[1], 256)); + int res = powerpc_boot_file((char *) req->args[1]); + if (res) + ipc_post(req->code, req->tag, 1, res); + } + + break; + default: gecko_printf("IPC: unknown SLOW PPC request %04X\n", req->req); }