#ifndef __REPOSITORY_H__ #define __REPOSITORY_H__ #include /* repository.c */ /* Key Format */ /* String or #0 or # if name is known, it is read from the HV, otherwise its data must be supplied as an argument. #0 is only required if the whole part of the key is null. #0 is not required on short keys, ie, "bi.spursvn" is enough, you dont need "bi.spursvn.#0.#0" */ /* "bi.pu.#.rm_size" */ /* If you dont want a result, set it as NULL */ #define KEY_PLATFORM_ID "plat.id" /* Use unknown, returns the string 0x43,0x6f,0x6b,0x42,0x31,0x30,0x00,0x00 = "CokB10" in first 64bit result. Second Result is NULL. */ #define KEY_BUS_ID "bus#.id" /* Generic */ #define KEY_BUS_TYPE "bus#.type" /* Generic */ #define KEY_BUS_NUMDEV "bus#.num_dev" /* Generic */ #define KEY_BUS_PORT "bus#.dev#.port" /* Block */ #define KEY_BUS_BLK_SIZE "bus#.dev#.blk_size" /* Block */ #define KEY_BUS_NUM_BLOCKS "bus#.dev#.n_blocks" /* Block */ #define KEY_BUS_NUM_REGIONS "bus#.dev#.n_regs" /* Block */ #define KEY_BUS_DEV_ID "bus#.dev#.id" #define KEY_BUS_DEV_TYPE "bus#.dev#.type" /* The following KEY_BUS_DEV_PCI* seem to be unused on retail PS3's */ #define KEY_BUS_DEV_PCIBUS "bus#.dev#.pci_bus" #define KEY_BUS_DEV_PCIDEV "bus#.dev#.pci_dev" #define KEY_BUS_DEV_PCIFUNC "bus#.dev#.pci_fun" #define KEY_BUS_DEV_INTR "bus#.dev#.intr#" /* V1 = Interrupt Type */ /* V2 = Interrupt ID */ #define KEY_BUS_DEV_REGION_TYPE "bus#.dev#.reg#.type" #define KEY_BUS_DEV_REGION_DATA "bus#.dev#.reg#.data" #define KEY_BUS_DEV_REGION_ID "bus#.dev#.region#.id" #define KEY_BUS_DEV_REGION_SIZE "bus#.dev#.region#.size" #define KEY_BUS_DEV_REGION_START "bus#.dev#.region#.start" #define KEY_BOOT_DATA_ADDRESS "bi.boot_dat.address" #define KEY_BOOT_DATA_SIZE "bi.boot_dat.size" #define KEY_REAL_MODE_LIMIT "bi.pu.#.rm_size" /* puid is automatically supplied */ #define KEY_MAX_MEMORY_SIZE "bi.rgntotal" #define KEY_VUART_PORT_AVSET "bi.vir_uart.port.avset" #define KEY_VUART_PORT_SYSMGR "bi.vir_uart.port.sysmgr" #define KEY_BE_NUMBER "ben" #define KEY_BE_NODEID "be#" #define KEY_BE_CLOCK_FREQ "be.#.clock" #define KEY_SPU_TOTAL_NUM "bi.spun" #define KEY_SPU_NUM_AVAILABLE "bi.spursvn" #define KEY_SPU_STATUS_AND_ID "bi.spursv.#" typedef enum ps3_bus_type { PS3_BUS_TYPE_UNKNOWN0 = 0, PS3_BUS_TYPE_UNKNOWN1 = 1, PS3_BUS_TYPE_UNKNOWN2 = 2, PS3_BUS_TYPE_UNKNOWN3 = 3, PS3_BUS_TYPE_SB = 4, /* South Bridge bus - Ethernet and USB Devices */ PS3_BUS_TYPE_STORAGE = 5, /* Bus for Storage Devices */ PS3_BUS_TYPE_SHOULD_BE_64_BITS = 0x7FFFFFFFFFFFFFFFll } ps3_bus_type; /* (un)Known return values for KEY_BUS_TYPE */ typedef enum ps3_dev_type { PS3_DEV_TYPE_STOR_DISK = 0, /* Internal HDD (maybe Cardbus as well) - Storage Bus */ PS3_DEV_TYPE_SB_GELIC = 3, /* Ethernet Hardware - SB Bus */ PS3_DEV_TYPE_SB_USB = 4, /* USB Hardware - SB Bus */ PS3_DEV_TYPE_STOR_ROM = 5, /* BLURAY Drive - Storage Bus */ PS3_DEV_TYPE_SB_GPIO = 6, /* General Purpose IO, SB Bus - Unknown Function */ PS3_DEV_TYPE_STOR_FLASH = 14, /* Flash Memory */ PS3_DEV_TYPE_MAX = 16, PS3_DEV_TYPE_SHOULD_BE_64_BITS = 0x7FFFFFFFFFFFFFFFll } ps3_dev_type; /* Known return values for KEY_BUS_DEV_TYPE */ typedef enum ps3_interrupt_type { PS3_INTERRUPT_TYPE_EVENT_PORT = 2, PS3_INTERRUPT_TYPE_SB_OHCI = 3, PS3_INTERRUPT_TYPE_SB_EHCI = 4, PS3_INTERRUPT_TYPE_OTHER = 5, PS3_INTERRUPT_TYPE_SHOULD_BE_64_BITS = 0x7FFFFFFFFFFFFFFFll } ps3_interrupt_type; typedef enum ps3_reg_type { PS3_REG_TYPE_SB_OHCI = 3, PS3_REG_TYPE_SB_EHCI = 4, PS3_REG_TYPE_SB_GPIO = 5, PS3_REG_TYPE_SHOULD_BE_64_BITS = 0x7FFFFFFFFFFFFFFFll } ps3_reg_type; int64_t read_repository(uint64_t *v1, uint64_t *v2, const char* key, ...); int64_t create_repository(uint64_t v1, uint64_t v2, const char* key, ...); int64_t modify_repository(uint64_t v1, uint64_t v2, const char* key, ...); int64_t delete_repository(const char* key, ...); int64_t ps3_find_device(ps3_dev_type dev, uint64_t dev_num, uint64_t *bus_index, uint64_t *device_index); int64_t ps3_get_irq(uint64_t bus_index, uint64_t device_index, ps3_interrupt_type intr_type, uint64_t *interrupt_id); #endif