2014-04-13 22:33:45 +02:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
|
|
|
|
#include "common/log.h"
|
|
|
|
|
2014-04-14 04:59:16 +02:00
|
|
|
#include "core/hle/hle.h"
|
|
|
|
#include "core/hle/service/apt.h"
|
2014-04-13 22:33:45 +02:00
|
|
|
|
|
|
|
namespace Service {
|
|
|
|
|
2014-04-14 04:59:16 +02:00
|
|
|
// Returns handle to APT Mutex. Not imlemented.
|
|
|
|
Syscall::Result APT::GetLockHandle() {
|
|
|
|
return 0x00000000;
|
|
|
|
}
|
2014-04-13 22:33:45 +02:00
|
|
|
|
2014-04-14 04:59:16 +02:00
|
|
|
/**
|
|
|
|
* Called when svcSendSyncRequest is called, loads command buffer and executes comand
|
|
|
|
* @return Return result of svcSendSyncRequest passed back to user app
|
|
|
|
*/
|
2014-04-13 22:33:45 +02:00
|
|
|
Syscall::Result APT::Sync() {
|
2014-04-14 04:59:16 +02:00
|
|
|
Syscall::Result res = 0;
|
|
|
|
u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + CMD_OFFSET);
|
|
|
|
|
|
|
|
switch(cmd_buff[0]) {
|
|
|
|
case CMD_HEADER_INIT:
|
|
|
|
NOTICE_LOG(OSHLE, "APT::Sync - Initialize");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CMD_HEADER_GET_LOCK_HANDLE:
|
|
|
|
NOTICE_LOG(OSHLE, "APT::Sync - GetLockHandle");
|
|
|
|
cmd_buff[5] = GetLockHandle();
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
ERROR_LOG(OSHLE, "APT::Sync - Unknown command 0x%08X", cmd_buff[0]);
|
|
|
|
res = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
2014-04-13 22:33:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|