mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-03 23:28:48 +00:00 
			
		
		
		
	Remove every trailing whitespace from the project (but externals).
This commit is contained in:
		
							parent
							
								
									fb597b6d68
								
							
						
					
					
						commit
						b1503b2020
					
				
					 65 changed files with 212 additions and 212 deletions
				
			
		| 
						 | 
				
			
			@ -151,7 +151,7 @@ void SendParameter(Service::Interface* self) {
 | 
			
		|||
    u32 handle              = cmd_buff[6];
 | 
			
		||||
    u32 size                = cmd_buff[7];
 | 
			
		||||
    u32 in_param_buffer_ptr = cmd_buff[8];
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
 | 
			
		||||
 | 
			
		||||
    LOG_WARNING(Service_APT, "(STUBBED) called src_app_id=0x%08X, dst_app_id=0x%08X, signal_type=0x%08X,"
 | 
			
		||||
| 
						 | 
				
			
			@ -283,7 +283,7 @@ void Init() {
 | 
			
		|||
    AddService(new APT_A_Interface);
 | 
			
		||||
    AddService(new APT_S_Interface);
 | 
			
		||||
    AddService(new APT_U_Interface);
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    // Load the shared system font (if available).
 | 
			
		||||
    // The expected format is a decrypted, uncompressed BCFNT file with the 0x80 byte header
 | 
			
		||||
    // generated by the APT:U service. The best way to get is by dumping it from RAM. We've provided
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -63,7 +63,7 @@ void Initialize(Service::Interface* self);
 | 
			
		|||
 *      4 : Handle to shared font memory
 | 
			
		||||
 */
 | 
			
		||||
void GetSharedFont(Service::Interface* self);
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * APT::NotifyToWait service function
 | 
			
		||||
 *  Inputs:
 | 
			
		||||
| 
						 | 
				
			
			@ -88,7 +88,7 @@ void Enable(Service::Interface* self);
 | 
			
		|||
 *      4 : Home Menu AppId
 | 
			
		||||
 *      5 : AppID of currently active app
 | 
			
		||||
 */
 | 
			
		||||
void GetAppletManInfo(Service::Interface* self); 
 | 
			
		||||
void GetAppletManInfo(Service::Interface* self);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * APT::IsRegistered service function. This returns whether the specified AppID is registered with NS yet.
 | 
			
		||||
| 
						 | 
				
			
			@ -100,14 +100,14 @@ void GetAppletManInfo(Service::Interface* self);
 | 
			
		|||
 *  Outputs:
 | 
			
		||||
 *      0 : Return header
 | 
			
		||||
 *      1 : Result of function, 0 on success, otherwise error code
 | 
			
		||||
 *      2 : Output, 0 = not registered, 1 = registered. 
 | 
			
		||||
 *      2 : Output, 0 = not registered, 1 = registered.
 | 
			
		||||
 */
 | 
			
		||||
void IsRegistered(Service::Interface* self);
 | 
			
		||||
 | 
			
		||||
void InquireNotification(Service::Interface* self);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * APT::SendParameter service function. This sets the parameter data state. 
 | 
			
		||||
 * APT::SendParameter service function. This sets the parameter data state.
 | 
			
		||||
 * Inputs:
 | 
			
		||||
 *     1 : Source AppID
 | 
			
		||||
 *     2 : Destination AppID
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ namespace BOSS_P {
 | 
			
		|||
class Interface : public Service::Interface {
 | 
			
		||||
public:
 | 
			
		||||
    Interface();
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    std::string GetPortName() const override {
 | 
			
		||||
        return "boss:P";
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ namespace BOSS_U {
 | 
			
		|||
class Interface : public Service::Interface {
 | 
			
		||||
public:
 | 
			
		||||
    Interface();
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    std::string GetPortName() const override {
 | 
			
		||||
        return "boss:U";
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,5 +19,5 @@ namespace CAM_U {
 | 
			
		|||
Interface::Interface() {
 | 
			
		||||
    //Register(FunctionTable);
 | 
			
		||||
}
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
} // namespace
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -315,11 +315,11 @@ void Init() {
 | 
			
		|||
    AddService(new CFG_I_Interface);
 | 
			
		||||
    AddService(new CFG_S_Interface);
 | 
			
		||||
    AddService(new CFG_U_Interface);
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    // Open the SystemSaveData archive 0x00010017
 | 
			
		||||
    FileSys::Path archive_path(cfg_system_savedata_id);
 | 
			
		||||
    auto archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SystemSaveData, archive_path);
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    // If the archive didn't exist, create the files inside
 | 
			
		||||
    if (archive_result.Code().description == ErrorDescription::FS_NotFormatted) {
 | 
			
		||||
        // Format the archive to create the directories
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -254,7 +254,7 @@ ResultVal<ArchiveHandle> OpenArchive(ArchiveIdCode id_code, FileSys::Path& archi
 | 
			
		|||
 | 
			
		||||
    CASCADE_RESULT(std::unique_ptr<ArchiveBackend> res, itr->second->Open(archive_path));
 | 
			
		||||
 | 
			
		||||
    // This should never even happen in the first place with 64-bit handles, 
 | 
			
		||||
    // This should never even happen in the first place with 64-bit handles,
 | 
			
		||||
    while (handle_map.count(next_handle) != 0) {
 | 
			
		||||
        ++next_handle;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -488,7 +488,7 @@ void ArchiveInit() {
 | 
			
		|||
        RegisterArchiveType(std::move(sdmc_factory), ArchiveIdCode::SDMC);
 | 
			
		||||
    else
 | 
			
		||||
        LOG_ERROR(Service_FS, "Can't instantiate SDMC archive with path %s", sdmc_directory.c_str());
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    // Create the SaveData archive
 | 
			
		||||
    auto savedata_factory = Common::make_unique<FileSys::ArchiveFactory_SaveData>(sdmc_directory);
 | 
			
		||||
    RegisterArchiveType(std::move(savedata_factory), ArchiveIdCode::SaveData);
 | 
			
		||||
| 
						 | 
				
			
			@ -503,7 +503,7 @@ void ArchiveInit() {
 | 
			
		|||
    if (sharedextsavedata_factory->Initialize())
 | 
			
		||||
        RegisterArchiveType(std::move(sharedextsavedata_factory), ArchiveIdCode::SharedExtSaveData);
 | 
			
		||||
    else
 | 
			
		||||
        LOG_ERROR(Service_FS, "Can't instantiate SharedExtSaveData archive with path %s", 
 | 
			
		||||
        LOG_ERROR(Service_FS, "Can't instantiate SharedExtSaveData archive with path %s",
 | 
			
		||||
            sharedextsavedata_factory->GetMountPoint().c_str());
 | 
			
		||||
 | 
			
		||||
    // Create the SaveDataCheck archive, basically a small variation of the RomFS archive
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -434,7 +434,7 @@ static void IsSdmcWriteable(Service::Interface* self) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * FS_User::FormatSaveData service function, 
 | 
			
		||||
 * FS_User::FormatSaveData service function,
 | 
			
		||||
 * formats the SaveData specified by the input path.
 | 
			
		||||
 *  Inputs:
 | 
			
		||||
 *      0  : 0x084C0242
 | 
			
		||||
| 
						 | 
				
			
			@ -520,7 +520,7 @@ static void CreateExtSaveData(Service::Interface* self) {
 | 
			
		|||
    LOG_WARNING(Service_FS, "(STUBBED) savedata_high=%08X savedata_low=%08X cmd_buff[3]=%08X "
 | 
			
		||||
            "cmd_buff[4]=%08X cmd_buff[5]=%08X cmd_buff[6]=%08X cmd_buff[7]=%08X cmd_buff[8]=%08X "
 | 
			
		||||
            "cmd_buff[9]=%08X cmd_buff[10]=%08X cmd_buff[11]=%08X", save_high, save_low,
 | 
			
		||||
            cmd_buff[3], cmd_buff[4], cmd_buff[5], cmd_buff[6], cmd_buff[7], cmd_buff[8], cmd_buff[9], 
 | 
			
		||||
            cmd_buff[3], cmd_buff[4], cmd_buff[5], cmd_buff[6], cmd_buff[7], cmd_buff[8], cmd_buff[9],
 | 
			
		||||
            cmd_buff[10], cmd_buff[11]);
 | 
			
		||||
 | 
			
		||||
    cmd_buff[1] = CreateExtSaveData(media_type, save_high, save_low).raw;
 | 
			
		||||
| 
						 | 
				
			
			@ -544,7 +544,7 @@ static void DeleteExtSaveData(Service::Interface* self) {
 | 
			
		|||
    u32 save_high = cmd_buff[3];
 | 
			
		||||
    u32 unknown = cmd_buff[4]; // TODO(Subv): Figure out what this is
 | 
			
		||||
 | 
			
		||||
    LOG_WARNING(Service_FS, "(STUBBED) save_low=%08X save_high=%08X media_type=%08X unknown=%08X", 
 | 
			
		||||
    LOG_WARNING(Service_FS, "(STUBBED) save_low=%08X save_high=%08X media_type=%08X unknown=%08X",
 | 
			
		||||
            save_low, save_high, cmd_buff[1] & 0xFF, unknown);
 | 
			
		||||
 | 
			
		||||
    cmd_buff[1] = DeleteExtSaveData(media_type, save_high, save_low).raw;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -167,7 +167,7 @@ static void WriteHWRegsWithMask(Service::Interface* self) {
 | 
			
		|||
    u32* cmd_buff = Kernel::GetCommandBuffer();
 | 
			
		||||
    u32 reg_addr = cmd_buff[1];
 | 
			
		||||
    u32 size = cmd_buff[2];
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    u32* src_data = (u32*)Memory::GetPointer(cmd_buff[4]);
 | 
			
		||||
    u32* mask_data = (u32*)Memory::GetPointer(cmd_buff[6]);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -208,21 +208,21 @@ static void SetBufferSwap(u32 screen_id, const FrameBufferInfo& info) {
 | 
			
		|||
    PAddr phys_address_left = Memory::VirtualToPhysicalAddress(info.address_left);
 | 
			
		||||
    PAddr phys_address_right = Memory::VirtualToPhysicalAddress(info.address_right);
 | 
			
		||||
    if (info.active_fb == 0) {
 | 
			
		||||
        WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_left1)), 4, 
 | 
			
		||||
        WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_left1)), 4,
 | 
			
		||||
                &phys_address_left);
 | 
			
		||||
        WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_right1)), 4, 
 | 
			
		||||
        WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_right1)), 4,
 | 
			
		||||
                &phys_address_right);
 | 
			
		||||
    } else {
 | 
			
		||||
        WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_left2)), 4, 
 | 
			
		||||
        WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_left2)), 4,
 | 
			
		||||
                &phys_address_left);
 | 
			
		||||
        WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_right2)), 4, 
 | 
			
		||||
        WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].address_right2)), 4,
 | 
			
		||||
                &phys_address_right);
 | 
			
		||||
    }
 | 
			
		||||
    WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].stride)), 4, 
 | 
			
		||||
    WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].stride)), 4,
 | 
			
		||||
            &info.stride);
 | 
			
		||||
    WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].color_format)), 4, 
 | 
			
		||||
    WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].color_format)), 4,
 | 
			
		||||
            &info.format);
 | 
			
		||||
    WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].active_fb)), 4, 
 | 
			
		||||
    WriteHWRegs(base_address + 4 * static_cast<u32>(GPU_REG_INDEX(framebuffer_config[screen_id].active_fb)), 4,
 | 
			
		||||
            &info.shown_fb);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -374,7 +374,7 @@ static void ExecuteCommand(const Command& command, u32 thread_id) {
 | 
			
		|||
    {
 | 
			
		||||
        auto& params = command.set_command_list_last;
 | 
			
		||||
 | 
			
		||||
        WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(command_processor_config.address)), 
 | 
			
		||||
        WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(command_processor_config.address)),
 | 
			
		||||
                Memory::VirtualToPhysicalAddress(params.address) >> 3);
 | 
			
		||||
        WriteGPURegister(static_cast<u32>(GPU_REG_INDEX(command_processor_config.size)), params.size);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -470,7 +470,7 @@ static void SetLcdForceBlack(Service::Interface* self) {
 | 
			
		|||
 | 
			
		||||
    LCD::Write(HW::VADDR_LCD + 4 * LCD_REG_INDEX(color_fill_top), data.raw); // Top LCD
 | 
			
		||||
    LCD::Write(HW::VADDR_LCD + 4 * LCD_REG_INDEX(color_fill_bottom), data.raw); // Bottom LCD
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    cmd_buff[1] = RESULT_SUCCESS.raw;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -516,8 +516,8 @@ static void TriggerCmdReqQueue(Service::Interface* self) {
 | 
			
		|||
 */
 | 
			
		||||
static void ImportDisplayCaptureInfo(Service::Interface* self) {
 | 
			
		||||
    u32* cmd_buff = Kernel::GetCommandBuffer();
 | 
			
		||||
    
 | 
			
		||||
    // TODO(Subv): We're always returning the framebuffer structures for thread_id = 0, 
 | 
			
		||||
 | 
			
		||||
    // TODO(Subv): We're always returning the framebuffer structures for thread_id = 0,
 | 
			
		||||
    // because we only support a single running application at a time.
 | 
			
		||||
    // This should always return the framebuffer data that is currently displayed on the screen.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -106,7 +106,7 @@ void Update() {
 | 
			
		|||
        mem->touch.index_reset_ticks_previous = mem->touch.index_reset_ticks;
 | 
			
		||||
        mem->touch.index_reset_ticks = (s64)CoreTiming::GetTicks();
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    // Signal both handles when there's an update to Pad or touch
 | 
			
		||||
    event_pad_or_touch_1->Signal();
 | 
			
		||||
    event_pad_or_touch_2->Signal();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,6 +25,6 @@ const Interface::FunctionInfo FunctionTable[] = {
 | 
			
		|||
HID_SPVR_Interface::HID_SPVR_Interface() {
 | 
			
		||||
    Register(FunctionTable);
 | 
			
		||||
}
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
} // namespace HID
 | 
			
		||||
} // namespace Service
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,7 +11,7 @@
 | 
			
		|||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace HID {
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * HID service interface.
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,15 +20,15 @@ enum class ChargeLevels : u32 {
 | 
			
		|||
    CompletelyFull     = 5,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/** 
 | 
			
		||||
/**
 | 
			
		||||
 * Represents the gamecoin file structure in the SharedExtData archive
 | 
			
		||||
 * More information in 3dbrew (http://www.3dbrew.org/wiki/Extdata#Shared_Extdata_0xf000000b_gamecoin.dat)
 | 
			
		||||
 */
 | 
			
		||||
struct GameCoin {
 | 
			
		||||
    u32 magic; ///< Magic number: 0x4F00
 | 
			
		||||
    u16 total_coins; ///< Total Play Coins 
 | 
			
		||||
    u16 total_coins; ///< Total Play Coins
 | 
			
		||||
    u16 total_coins_on_date; ///< Total Play Coins obtained on the date stored below.
 | 
			
		||||
    u32 step_count; ///< Total step count at the time a new Play Coin was obtained. 
 | 
			
		||||
    u32 step_count; ///< Total step count at the time a new Play Coin was obtained.
 | 
			
		||||
    u32 last_step_count; ///< Step count for the day the last Play Coin was obtained
 | 
			
		||||
    u16 year;
 | 
			
		||||
    u8 month;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,6 +18,6 @@ const Interface::FunctionInfo FunctionTable[] = {
 | 
			
		|||
PTM_Play_Interface::PTM_Play_Interface() {
 | 
			
		||||
    Register(FunctionTable);
 | 
			
		||||
}
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
} // namespace PTM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
| 
						 | 
				
			
			@ -52,7 +52,7 @@ std::unordered_map<std::string, Kernel::SharedPtr<Interface>> g_kernel_named_por
 | 
			
		|||
std::unordered_map<std::string, Kernel::SharedPtr<Interface>> g_srv_services;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a function string for logging, complete with the name (or header code, depending 
 | 
			
		||||
 * Creates a function string for logging, complete with the name (or header code, depending
 | 
			
		||||
 * on what's passed in) the port name, and all the cmd_buff arguments.
 | 
			
		||||
 */
 | 
			
		||||
static std::string MakeFunctionString(const char* name, const char* port_name, const u32* cmd_buff) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -139,7 +139,7 @@ static int TranslateError(int error) {
 | 
			
		|||
    auto found = error_map.find(error);
 | 
			
		||||
    if (found != error_map.end())
 | 
			
		||||
        return -found->second;
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    return error;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -346,7 +346,7 @@ static void Bind(Service::Interface* self) {
 | 
			
		|||
    sockaddr sock_addr = CTRSockAddr::ToPlatform(*ctr_sock_addr);
 | 
			
		||||
 | 
			
		||||
    int res = ::bind(socket_handle, &sock_addr, std::max<u32>(sizeof(sock_addr), len));
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    int result = 0;
 | 
			
		||||
    if (res != 0)
 | 
			
		||||
        result = TranslateError(GET_ERRNO);
 | 
			
		||||
| 
						 | 
				
			
			@ -360,14 +360,14 @@ static void Fcntl(Service::Interface* self) {
 | 
			
		|||
    u32 socket_handle = cmd_buffer[1];
 | 
			
		||||
    u32 ctr_cmd = cmd_buffer[2];
 | 
			
		||||
    u32 ctr_arg = cmd_buffer[3];
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
    int result = 0;
 | 
			
		||||
    u32 posix_ret = 0; // TODO: Check what hardware returns for F_SETFL (unspecified by POSIX)
 | 
			
		||||
    SCOPE_EXIT({
 | 
			
		||||
            cmd_buffer[1] = result;
 | 
			
		||||
            cmd_buffer[2] = posix_ret;
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
    if (ctr_cmd == 3) { // F_GETFL
 | 
			
		||||
#if EMU_PLATFORM == PLATFORM_WINDOWS
 | 
			
		||||
        posix_ret = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -404,11 +404,11 @@ static void Fcntl(Service::Interface* self) {
 | 
			
		|||
            posix_ret = -1;
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
        flags &= ~O_NONBLOCK;
 | 
			
		||||
        if (ctr_arg & 4) // O_NONBLOCK
 | 
			
		||||
            flags |= O_NONBLOCK;
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
        int ret = ::fcntl(socket_handle, F_SETFL, flags);
 | 
			
		||||
        if (ret == SOCKET_ERROR_VALUE) {
 | 
			
		||||
            result = TranslateError(GET_ERRNO);
 | 
			
		||||
| 
						 | 
				
			
			@ -439,8 +439,8 @@ static void Listen(Service::Interface* self) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
static void Accept(Service::Interface* self) {
 | 
			
		||||
    // TODO(Subv): Calling this function on a blocking socket will block the emu thread, 
 | 
			
		||||
    // preventing graceful shutdown when closing the emulator, this can be fixed by always 
 | 
			
		||||
    // TODO(Subv): Calling this function on a blocking socket will block the emu thread,
 | 
			
		||||
    // preventing graceful shutdown when closing the emulator, this can be fixed by always
 | 
			
		||||
    // performing nonblocking operations and spinlock until the data is available
 | 
			
		||||
    u32* cmd_buffer = Kernel::GetCommandBuffer();
 | 
			
		||||
    u32 socket_handle = cmd_buffer[1];
 | 
			
		||||
| 
						 | 
				
			
			@ -448,7 +448,7 @@ static void Accept(Service::Interface* self) {
 | 
			
		|||
    sockaddr addr;
 | 
			
		||||
    socklen_t addr_len = sizeof(addr);
 | 
			
		||||
    u32 ret = static_cast<u32>(::accept(socket_handle, &addr, &addr_len));
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    if ((s32)ret != SOCKET_ERROR_VALUE)
 | 
			
		||||
        open_sockets[ret] = { ret, true };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -525,8 +525,8 @@ static void SendTo(Service::Interface* self) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
static void RecvFrom(Service::Interface* self) {
 | 
			
		||||
    // TODO(Subv): Calling this function on a blocking socket will block the emu thread, 
 | 
			
		||||
    // preventing graceful shutdown when closing the emulator, this can be fixed by always 
 | 
			
		||||
    // TODO(Subv): Calling this function on a blocking socket will block the emu thread,
 | 
			
		||||
    // preventing graceful shutdown when closing the emulator, this can be fixed by always
 | 
			
		||||
    // performing nonblocking operations and spinlock until the data is available
 | 
			
		||||
    u32* cmd_buffer = Kernel::GetCommandBuffer();
 | 
			
		||||
    u32 socket_handle = cmd_buffer[1];
 | 
			
		||||
| 
						 | 
				
			
			@ -568,7 +568,7 @@ static void Poll(Service::Interface* self) {
 | 
			
		|||
    pollfd* platform_pollfd = new pollfd[nfds];
 | 
			
		||||
    for (unsigned current_fds = 0; current_fds < nfds; ++current_fds)
 | 
			
		||||
        platform_pollfd[current_fds] = CTRPollFD::ToPlatform(input_fds[current_fds]);
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    int ret = ::poll(platform_pollfd, nfds, timeout);
 | 
			
		||||
 | 
			
		||||
    // Now update the output pollfd structure
 | 
			
		||||
| 
						 | 
				
			
			@ -630,7 +630,7 @@ static void GetPeerName(Service::Interface* self) {
 | 
			
		|||
    socklen_t len = cmd_buffer[2];
 | 
			
		||||
 | 
			
		||||
    CTRSockAddr* ctr_dest_addr = reinterpret_cast<CTRSockAddr*>(Memory::GetPointer(cmd_buffer[0x104 >> 2]));
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    sockaddr dest_addr;
 | 
			
		||||
    socklen_t dest_addr_len = sizeof(dest_addr);
 | 
			
		||||
    int ret = ::getpeername(socket_handle, &dest_addr, &dest_addr_len);
 | 
			
		||||
| 
						 | 
				
			
			@ -651,8 +651,8 @@ static void GetPeerName(Service::Interface* self) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
static void Connect(Service::Interface* self) {
 | 
			
		||||
    // TODO(Subv): Calling this function on a blocking socket will block the emu thread, 
 | 
			
		||||
    // preventing graceful shutdown when closing the emulator, this can be fixed by always 
 | 
			
		||||
    // TODO(Subv): Calling this function on a blocking socket will block the emu thread,
 | 
			
		||||
    // preventing graceful shutdown when closing the emulator, this can be fixed by always
 | 
			
		||||
    // performing nonblocking operations and spinlock until the data is available
 | 
			
		||||
    u32* cmd_buffer = Kernel::GetCommandBuffer();
 | 
			
		||||
    u32 socket_handle = cmd_buffer[1];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue