mirror of
				https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu-mainline.git
				synced 2025-03-21 01:53:15 +00:00 
			
		
		
		
	Merge pull request #131 from lioncash/enum
nvmap: Make IoctlCommands an enum class
This commit is contained in:
		
						commit
						fdbb039427
					
				@ -22,20 +22,21 @@ VAddr nvmap::GetObjectAddress(u32 handle) const {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
u32 nvmap::ioctl(u32 command, const std::vector<u8>& input, std::vector<u8>& output) {
 | 
			
		||||
    switch (command) {
 | 
			
		||||
    case IocCreateCommand:
 | 
			
		||||
    switch (static_cast<IoctlCommand>(command)) {
 | 
			
		||||
    case IoctlCommand::Create:
 | 
			
		||||
        return IocCreate(input, output);
 | 
			
		||||
    case IocAllocCommand:
 | 
			
		||||
    case IoctlCommand::Alloc:
 | 
			
		||||
        return IocAlloc(input, output);
 | 
			
		||||
    case IocGetIdCommand:
 | 
			
		||||
    case IoctlCommand::GetId:
 | 
			
		||||
        return IocGetId(input, output);
 | 
			
		||||
    case IocFromIdCommand:
 | 
			
		||||
    case IoctlCommand::FromId:
 | 
			
		||||
        return IocFromId(input, output);
 | 
			
		||||
    case IocParamCommand:
 | 
			
		||||
    case IoctlCommand::Param:
 | 
			
		||||
        return IocParam(input, output);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    UNIMPLEMENTED();
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
u32 nvmap::IocCreate(const std::vector<u8>& input, std::vector<u8>& output) {
 | 
			
		||||
 | 
			
		||||
@ -48,12 +48,12 @@ private:
 | 
			
		||||
    /// Mapping of currently allocated handles to the objects they represent.
 | 
			
		||||
    std::unordered_map<u32, std::shared_ptr<Object>> handles;
 | 
			
		||||
 | 
			
		||||
    enum IoctlCommands {
 | 
			
		||||
        IocCreateCommand = 0xC0080101,
 | 
			
		||||
        IocFromIdCommand = 0xC0080103,
 | 
			
		||||
        IocAllocCommand = 0xC0200104,
 | 
			
		||||
        IocParamCommand = 0xC00C0109,
 | 
			
		||||
        IocGetIdCommand = 0xC008010E
 | 
			
		||||
    enum class IoctlCommand : u32 {
 | 
			
		||||
        Create = 0xC0080101,
 | 
			
		||||
        FromId = 0xC0080103,
 | 
			
		||||
        Alloc = 0xC0200104,
 | 
			
		||||
        Param = 0xC00C0109,
 | 
			
		||||
        GetId = 0xC008010E
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    struct IocCreateParams {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user