Skip to content

Commit

Permalink
cdvdfsv: remove unused OPL shutdown RPC (save >4KiB)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickgaiser committed Sep 28, 2023
1 parent 97a18f6 commit d12bf6d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
39 changes: 0 additions & 39 deletions iop/cdvdfsv/src/cdvdfsv.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,23 @@ static void cdvdfsv_startrpcthreads(void);
static void cdvdfsv_rpc0_th(void *args);
static void cdvdfsv_rpc1_th(void *args);
static void cdvdfsv_rpc2_th(void *args);
static void cdvdfsv_rpc_sd_th(void *args);
static void *cbrpc_cdinit(int fno, void *buf, int size);
static void *cbrpc_cddiskready(int fno, void *buf, int size);
static void *cbrpc_cddiskready2(int fno, void *buf, int size);
static void *cbrpc_S596(int fno, void *buf, int size);
static void *cbrpc_shutdown(int fno, void *buf, int size);

u8 *cdvdfsv_buf;

static SifRpcDataQueue_t rpc0_DQ;
static SifRpcDataQueue_t rpc1_DQ;
static SifRpcDataQueue_t rpc2_DQ;
static SifRpcDataQueue_t rpc_sd_DQ;
static SifRpcServerData_t cdinit_rpcSD, cddiskready_rpcSD, cddiskready2_rpcSD;
static SifRpcServerData_t S596_rpcSD;
static SifRpcServerData_t sd_rpcSD;

static u8 cdinit_rpcbuf[16];
static u8 cddiskready_rpcbuf[16];
static u8 cddiskready2_rpcbuf[16];
static u8 S596_rpcbuf[16];
static u8 shutdown_rpcbuf[16];

static int rpc0_thread_id, rpc1_thread_id, rpc2_thread_id, rpc_sd_thread_id;

Expand Down Expand Up @@ -175,15 +170,6 @@ static void cdvdfsv_startrpcthreads(void)

rpc0_thread_id = CreateThread(&thread_param);
StartThread(rpc0_thread_id, NULL);

thread_param.attr = TH_C;
thread_param.option = 0xABCD8003;
thread_param.thread = (void *)cdvdfsv_rpc_sd_th;
thread_param.stacksize = 0x1000;
thread_param.priority = 0x1;

rpc_sd_thread_id = CreateThread(&thread_param);
StartThread(rpc_sd_thread_id, NULL);
}

//-------------------------------------------------------------------------
Expand Down Expand Up @@ -227,15 +213,6 @@ static void cdvdfsv_rpc2_th(void *args)
sceSifRpcLoop(&rpc2_DQ);
}

//-------------------------------------------------------------------------
// Unofficial RPC for shutting down OPL.
static void cdvdfsv_rpc_sd_th(void *args)
{
sceSifSetRpcQueue(&rpc_sd_DQ, GetThreadId());
sceSifRegisterRpc(&sd_rpcSD, 0x80000598, &cbrpc_shutdown, shutdown_rpcbuf, NULL, NULL, &rpc_sd_DQ);
sceSifRpcLoop(&rpc_sd_DQ);
}

//-------------------------------------------------------------------------
static void *cbrpc_cdinit(int fno, void *buf, int size)
{ // CD Init RPC callback
Expand Down Expand Up @@ -283,22 +260,6 @@ static void *cbrpc_S596(int fno, void *buf, int size)
return buf;
}

//--------------------------------------------------------------
static void *cbrpc_shutdown(int fno, void *buf, int size)
{
int value;

if (fno == 1) {
// Terminate operations.
// Shutdown OPL
value = *(int *)buf;
sceCdSC(CDSC_OPL_SHUTDOWN, &value);
}

*(int *)buf = 1;
return buf;
}

//--------------------------------------------------------------
void sysmemSendEE(void *buf, void *EE_addr, int size)
{
Expand Down
1 change: 0 additions & 1 deletion iop/common/cdvdman_opl.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,5 @@ enum CDIOC_CODE {
#define CDSC_IO_SEMA 0xFFFFFFF6 // Wait (param != 0) or signal (param == 0) high-level I/O semaphore.
#define CDSC_GET_VERSION 0xFFFFFFF7 // Get CDVDMAN version.
#define CDSC_SET_ERROR 0xFFFFFFFE // Used by CDVDFSV and CDVDSTM to set the error code (Typically READCF*).
#define CDSC_OPL_SHUTDOWN 0x00000001 // Shutdown OPL

#endif

0 comments on commit d12bf6d

Please sign in to comment.