mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-03 16:39:01 -06:00 
			
		
		
		
	service: Add migration services
Adds the basic skeleton for the mig:usr service based off information provided by Switch Brew.
This commit is contained in:
		
							
								
								
									
										34
									
								
								src/core/hle/service/mig/mig.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								src/core/hle/service/mig/mig.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
			
		||||
// Copyright 2018 yuzu emulator team
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include <memory>
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/mig/mig.h"
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
#include "core/hle/service/sm/sm.h"
 | 
			
		||||
 | 
			
		||||
namespace Service::Migration {
 | 
			
		||||
 | 
			
		||||
class MIG_USR final : public ServiceFramework<MIG_USR> {
 | 
			
		||||
public:
 | 
			
		||||
    explicit MIG_USR() : ServiceFramework{"mig:usr"} {
 | 
			
		||||
        // clang-format off
 | 
			
		||||
        static const FunctionInfo functions[] = {
 | 
			
		||||
            {10, nullptr, "TryGetLastMigrationInfo"},
 | 
			
		||||
            {100, nullptr, "CreateServer"},
 | 
			
		||||
            {101, nullptr, "ResumeServer"},
 | 
			
		||||
            {200, nullptr, "CreateClient"},
 | 
			
		||||
            {201, nullptr, "ResumeClient"},
 | 
			
		||||
        };
 | 
			
		||||
        // clang-format on
 | 
			
		||||
 | 
			
		||||
        RegisterHandlers(functions);
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void InstallInterfaces(SM::ServiceManager& sm) {
 | 
			
		||||
    std::make_shared<MIG_USR>()->InstallAsService(sm);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace Service::Migration
 | 
			
		||||
							
								
								
									
										15
									
								
								src/core/hle/service/mig/mig.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/core/hle/service/mig/mig.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
// Copyright 2018 yuzu emulator team
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
namespace Service::SM {
 | 
			
		||||
class ServiceManager;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
namespace Service::Migration {
 | 
			
		||||
 | 
			
		||||
void InstallInterfaces(SM::ServiceManager& sm);
 | 
			
		||||
 | 
			
		||||
} // namespace Service::Migration
 | 
			
		||||
@@ -38,6 +38,7 @@
 | 
			
		||||
#include "core/hle/service/ldn/ldn.h"
 | 
			
		||||
#include "core/hle/service/ldr/ldr.h"
 | 
			
		||||
#include "core/hle/service/lm/lm.h"
 | 
			
		||||
#include "core/hle/service/mig/mig.h"
 | 
			
		||||
#include "core/hle/service/mii/mii.h"
 | 
			
		||||
#include "core/hle/service/mm/mm_u.h"
 | 
			
		||||
#include "core/hle/service/ncm/ncm.h"
 | 
			
		||||
@@ -224,6 +225,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
 | 
			
		||||
    LDN::InstallInterfaces(*sm);
 | 
			
		||||
    LDR::InstallInterfaces(*sm);
 | 
			
		||||
    LM::InstallInterfaces(*sm);
 | 
			
		||||
    Migration::InstallInterfaces(*sm);
 | 
			
		||||
    Mii::InstallInterfaces(*sm);
 | 
			
		||||
    MM::InstallInterfaces(*sm);
 | 
			
		||||
    NCM::InstallInterfaces(*sm);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user