summaryrefslogblamecommitdiffstats
path: root/src/core/hle/svc.h
blob: 4b9c71e06cb52f6f7b4ed7af38f53ee8e44e3be2 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                        
                                            
                                          





                                                                                                    
            
 










                     






                                   








                                                                 
                                                                                                    
                
 
               
 




























                                                                                               
                            

              
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include "common/common_types.h"

////////////////////////////////////////////////////////////////////////////////////////////////////
// SVC types

struct MemoryInfo {
    u32 base_address;
    u32 size;
    u32 permission;
    u32 state;
};

struct PageInfo {
    u32 flags;
};

enum ResetType {
    RESETTYPE_ONESHOT,
    RESETTYPE_STICKY,
    RESETTYPE_PULSE,
    RESETTYPE_MAX_BIT = (1u << 31),
};

enum ArbitrationType {
    ARBITRATIONTYPE_SIGNAL,
    ARBITRATIONTYPE_WAIT_IF_LESS_THAN,
    ARBITRATIONTYPE_DECREMENT_AND_WAIT_IF_LESS_THAN,
    ARBITRATIONTYPE_WAIT_IF_LESS_THAN_WITH_TIMEOUT,
    ARBITRATIONTYPE_DECREMENT_AND_WAIT_IF_LESS_THAN_WITH_TIMEOUT,
    ARBITRATIONTYPE_MAX_BIT = (1u << 31)
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace SVC

namespace SVC {

/// Values accepted by svcGetSystemInfo's type parameter.
enum class SystemInfoType {
    /**
     * Reports total used memory for all regions or a specific one, according to the extra
     * parameter. See `SystemInfoMemUsageRegion`.
     */
    REGION_MEMORY_USAGE = 0,
    /**
     * Returns the memory usage for certain allocations done internally by the kernel.
     */
    KERNEL_ALLOCATED_PAGES = 2,
    /**
     * "This returns the total number of processes which were launched directly by the kernel.
     * For the ARM11 NATIVE_FIRM kernel, this is 5, for processes sm, fs, pm, loader, and pxi."
     */
    KERNEL_SPAWNED_PIDS = 26,
};

/**
 * Accepted by svcGetSystemInfo param with REGION_MEMORY_USAGE type. Selects a region to query
 * memory usage of.
 */
enum class SystemInfoMemUsageRegion {
    ALL = 0,
    APPLICATION = 1,
    SYSTEM = 2,
    BASE = 3,
};

void CallSVC(u32 immediate);

} // namespace