In memory of Ben “bushing” Byer, who passed away on Monday, February 8th, 2016.

Changes

Jump to navigation Jump to search
748 bytes added ,  01:08, 6 February 2020
revise some syscall descriptions
Line 201: Line 201:  
| 30 || syscall_ahbMemFlush_wrapper
 
| 30 || syscall_ahbMemFlush_wrapper
 
|-
 
|-
| 31 || int software_IRQ_31() || Enables [[Hardware/Hollywood IRQs|hardware interrupts]] for device 31 ([[Hardware/IPC|IPC (Starlet)]]) (can only be used from the kernel or ES) || 0 on success, -4 for no permission.
+
| 31 || int enable_irq_iop() || Enables [[Hardware/Hollywood IRQs|hardware interrupts]] for device 31 ([[Hardware/IPC|IPC (Starlet)]]) (can only be used from the kernel or ES) || 0 on success, -4 for no permission.
 
|-
 
|-
| 32 || int software_IRQ_18() || Enables [[Hardware/Hollywood IRQs|hardware interrupts]] for device 18 ([[Hardware/Drive Interface|DI]]) (can only be used from DI) || 0 on success, -4 for no permission
+
| 32 || int enable_irq_di() || Enables [[Hardware/Hollywood IRQs|hardware interrupts]] for device 18 ([[Hardware/Drive Interface|DI]]) (can only be used from DI) || 0 on success, -4 for no permission
 
|-
 
|-
| 33 || int software_IRQ_7_or_8(int id) || Enables [[Hardware/Hollywood IRQs|hardware interrupts]] for device 7 ([[Hardware/SD Host Controller|SDHC]] - must be SDI) if id==0, else device 8 ([[Hardware/802.11 Wireless|802.11 Wireless]] - must be WL) || 0 on success, -4 for no permission
+
| 33 || int enable_irq_sdhc(int id) || Enables [[Hardware/Hollywood IRQs|hardware interrupts]] for device 7 ([[Hardware/SD Host Controller|SDHC]] - must be SDI) if id==0, else device 8 ([[Hardware/802.11 Wireless|802.11 Wireless]] - must be WL) || 0 on success, -4 for no permission
 
|-
 
|-
| 34 || int software_IRQ(int id) || Enables [[Hardware/Hollywood IRQs|hardware interrupts]] for the given device, with PID requirements (this is also used to syscalls 31 through 33):
+
| 34 || int enable_irq(int id) || Enables [[Hardware/Hollywood IRQs|hardware interrupts]] for the given device, with PID requirements (this is also used to syscalls 31 through 33):
 
  {| class="wikitable"
 
  {| class="wikitable"
 
   ! id !! PID
 
   ! id !! PID
Line 249: Line 249:  
| 3d || int verify_iobuf([[IOS/IoBuffer|struct iobuf]] *iob) || verify if the argument points to an io buffer
 
| 3d || int verify_iobuf([[IOS/IoBuffer|struct iobuf]] *iob) || verify if the argument points to an io buffer
 
|-
 
|-
| 3e || syscall_3e
+
| 3e || syscall_3e || Unknown; related to IO buffer functionality
 
|-
 
|-
 
| 3f || void IOS_InvalidateDCache(void *address, u32 size) || "sync_before_read" - Invalidates dcache, and something (probably related to flushing memory)
 
| 3f || void IOS_InvalidateDCache(void *address, u32 size) || "sync_before_read" - Invalidates dcache, and something (probably related to flushing memory)
Line 261: Line 261:  
| 43 || <nowiki>[[noreturn]]</nowiki> void boot_new_ios_kernel(void* ios_binary_address, u32 new_version) || Sets the version at 0x3140 to <code>new_version</code> and the IPC buffer range ("DDR settings") to the legacy range ("12M"), before branching to the new kernel. This can only be called from UID 0. || -
 
| 43 || <nowiki>[[noreturn]]</nowiki> void boot_new_ios_kernel(void* ios_binary_address, u32 new_version) || Sets the version at 0x3140 to <code>new_version</code> and the IPC buffer range ("DDR settings") to the legacy range ("12M"), before branching to the new kernel. This can only be called from UID 0. || -
 
|-
 
|-
| 44 || int syscall_assert_di_reset() || Clears bit 10 (DI) of [[Hardware/Hollywood_Registers#HW_RESETS|HW_RESETS]] (can only be called from DI) || Returns 0 on success, -1 on error
+
| 44 || int assert_di_reset() || Clears bit 10 (DI) of [[Hardware/Hollywood_Registers#HW_RESETS|HW_RESETS]] (can only be called from DI) || Returns 0 on success, -1 on error
 
|-
 
|-
| 45 || int syscall_deassert_di_reset() || Enables bit 10 (DI) of [[Hardware/Hollywood_Registers#HW_RESETS|HW_RESETS]] (can only be called from DI) || Returns 0 on success, -1 on error
+
| 45 || int deassert_di_reset() || Enables bit 10 (DI) of [[Hardware/Hollywood_Registers#HW_RESETS|HW_RESETS]] (can only be called from DI) || Returns 0 on success, -1 on error
 
|-
 
|-
| 46 || bool syscall_check_di_reset() || Checks bit 10 (DI) of [[Hardware/Hollywood_Registers#HW_RESETS|HW_RESETS]] (can only be called from DI) || Returns 1 on reset asserted, 0 on deasserted or error
+
| 46 || bool check_di_reset() || Checks bit 10 (DI) of [[Hardware/Hollywood_Registers#HW_RESETS|HW_RESETS]] (can only be called from DI) || Returns 1 on reset asserted, 0 on deasserted or error
 
|-
 
|-
| 47 || GetSomeFlags || Depending on what is currently running (boot2/IOS) it returns different values || IOS: *(u32*)r0=0 *(u16*)r1=0
+
| 47 || void get_kernel_flavor(u32 *type, u16 *unk) || The implementation of this syscall differs between "flavors" of kernel and returns some identifiers. ||  
Boot2: *(u32*)r0=3 *(u16*)r1=0
+
The IOSv58 system menu kernel writes (*type=3, *unk=0).
 +
The boot2v04 kernel writes (*type=0, *unk_0).
 
|-
 
|-
| 48 || set_r0_1_r1_0
+
| 48 || void get_unk_flavor(u32 *type, u16 *unk) || Potentially vestigial. Probably related to syscall 0x47 above. || Always returns (*type=1, *unk=0).
 
|-
 
|-
| 49 || get_boot_vector
+
| 49 || u32 get_boot_vector() || Returns a pointer (?) depending on the SRAM mirror bit in [[Hardware/Hollywood_Registers#HW_MEMIRR|HW_MEMIRR]].||
 +
Returns 0xffffff00 when the mirror bit is set.
 +
Returns 0x0d40ff00 when the mirror bit is unset.
 
|-
 
|-
 
| 4a || GetHollywoodRevision
 
| 4a || GetHollywoodRevision
Line 301: Line 304:  
| 56 || int poke_gpios(u32 reg, u32 value) || Set gpio reg to value (can only be called from STM) || 0 on success, -1 on error
 
| 56 || int poke_gpios(u32 reg, u32 value) || Set gpio reg to value (can only be called from STM) || 0 on success, -1 on error
 
|-
 
|-
| 57 || syscall_57 || can only be called from STM || 0 on success, -1 on error
+
| 57 || int write_ddr_reg(u32 reg_idx, u16 val) || Writes a 16-bit value to the specified Memory Controller register. Can only be called from the STM module. || Returns 0 on success, -1 on error.
 
|-
 
|-
| 58 || void call_poke_debug_port(u8 value) || Set [[Hardware/Hollywood GPIOs|GPIO]] lines 16-23 (DEBUG0-7, the [[debug port]]) to value
+
| 58 || void poke_debug_port(u8 value) || Set [[Hardware/Hollywood GPIOs|GPIO]] lines 16-23 (DEBUG0-7, the [[debug port]]) to the provided value.
 
|-
 
|-
| 59 || load_PPC || can only be called from ES || 0 on success, negative for error
+
| 59 || set_ipc_access_rights || Related to PPC IPC. Can only be called from the ES module. Called when bootstrapping PPC. || 0 on success, negative for error.
 
|-
 
|-
| 5a || u32 load_module(const char* path) || Load the specified IOS module and run it (can only be called from UID 0, which is kernel or ES) || 0 on success, negative for error
+
| 5a || u32 load_module(const char* path) || Load an ARM ELF [IOS module] and start a new thread. || 0 on success, negative for error
 
|-
 
|-
 
| 5b || IOSCError IOSC_CreateObject(u32* key_handle, IOSCObjectType type, IOSCObjectSubType subtype); || Create a new keyring entry. <code>key_handle</code> is updated with a key handle to use with other IOSC calls. || 0 on success, negative for error
 
| 5b || IOSCError IOSC_CreateObject(u32* key_handle, IOSCObjectType type, IOSCObjectSubType subtype); || Create a new keyring entry. <code>key_handle</code> is updated with a key handle to use with other IOSC calls. || 0 on success, negative for error
Line 367: Line 370:  
| 77 || IOSCError IOSC_CheckDiHashes(u8 * destAddr, u8 * diskRdBuf, u32 h1Index, u32 h2Index, u8 * h3Ptr); || can only be called from DI || 0 on success, negative on error
 
| 77 || IOSCError IOSC_CheckDiHashes(u8 * destAddr, u8 * diskRdBuf, u32 h1Index, u32 h2Index, u8 * h3Ptr); || can only be called from DI || 0 on success, negative on error
 
|-
 
|-
| 78 || syscall_78 || can only be called from ES || 0 on success, negative on error
+
| 78 || syscall_78_set(void *buf, u32 len) || Related to thread priorities? Can only be called from ES. || Returns 0 on success, negative on error
 
|-
 
|-
| 79 || syscall_79 || can only be called from ES || negative on error
+
| 79 || syscall_79_get(void *buf, u32 len) || Related to thread priorities? Can only be called from ES. || Returns negative on error.
 
|-
 
|-
 
| 7a || syscall_7a
 
| 7a || syscall_7a

Navigation menu