Line 201:
Line 201:
| 30 || syscall_ahbMemFlush_wrapper
| 30 || syscall_ahbMemFlush_wrapper
|-
|-
−
| 31 || software_IRQ_31 || seems to enable hardware interrupts for device nr 31
+
| 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.
|-
|-
−
| 32 || software_irq_18 || seems to enable hardware interrupts for device nr 18
+
| 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
|-
|-
−
| 33 || software_IRQ_7_or_8(id) || seems to enable hardware interrupts for device nr 7 if id==0, else device nr 8 (sdhc)
+
| 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
|-
|-
−
| 34 || software_IRQ(id) || enables hardware interrupts for device nr. id; check caller PID
+
| 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):
+
{| class="wikitable"
+
! id !! PID
+
|-
+
| 4 ([[Hardware/USB Host Controller|USB Host Controller]]) || 6 (EHCI)
+
|-
+
| 5 ([[Hardware/USB Host Controller|USB Host Controller]]) || 4 (OH0/OHCI0)
+
|-
+
| 6 ([[Hardware/USB Host Controller|USB Host Controller]]) || 5 (OH1)
+
|-
+
| 7 ([[Hardware/SD Host Controller|SD Host Controller]]) || 7 (SDI)
+
|-
+
| 8 ([[Hardware/802.11 Wireless|802.11 Wireless]]) || 11 (WL)
+
|-
+
| 11 ([[Hardware/Hollywood GPIOs|Hollywood GPIOs]] (Starlet); also updates POWER (1) in [[Hardware/Hollywood_GPIOs#HW_GPIO_INTFLAG|HW_GPIO_INTFLAG]]) || 14 (STM)
+
|-
+
| 17 (Reset button) || 14 (STM)
+
|-
+
| 18 ([[Hardware/Drive Interface|Drive Interface]]) || 3 (DI)
+
|-
+
| 31 ([[Hardware/IPC|IPC (Starlet)]]) || 0 (Kernel or ES)
+
|}
+
| 0 on success, -1 for unknown IRQ (not in that table), -4 for no permission
|-
|-
| 35 || access_iobuf_pool(arg1) || no-op in IOS-35, arg1=0 || returns always 0
| 35 || access_iobuf_pool(arg1) || no-op in IOS-35, arg1=0 || returns always 0
Line 239:
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 of 0xD800194 || Returns 0 on success, -1 on error
+
| 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
|-
|-
−
| 45 || int syscall_deassert_di_reset || Enables bit 10 of 0xD800194 || 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
|-
|-
−
| 46 || BOOL syscall_check_di_reset || Checks bit 10 of 0xD800194 || Returns 1 on reset asserted, 0 on (deasserted or 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
|-
|-
| 47 || GetSomeFlags || Depending on what is currently running (boot2/IOS) it returns different values || IOS: *(u32*)r0=0 *(u16*)r1=0
| 47 || GetSomeFlags || Depending on what is currently running (boot2/IOS) it returns different values || IOS: *(u32*)r0=0 *(u16*)r1=0
Line 258:
Line 280:
| 4c || int kernel_set_version(u32 version) || Stores version to 0x3140 (can only be called by ES) || 0 on success
| 4c || int kernel_set_version(u32 version) || Stores version to 0x3140 (can only be called by ES) || 0 on success
|-
|-
−
| 4d || u32 kernel_get_version() || Returns the current IOS version from 0x3140 (can only be called by ES || IOS version or 0 on error
+
| 4d || u32 kernel_get_version() || Returns the current IOS version from 0x3140 (can only be called by ES) || IOS version or 0 on error
|-
|-
−
| 4e || poke_E0_1 || Can only be called by DI
+
| 4e || int set_di_spinup(uint enable) || Sets or clears the DI_SPIN [[Hardware/Hollywood GPIOs|GPIO]]; if enable is 0 then the flag is set (disabling spinup); it is cleared otherwise. (Can only be called by DI) || 0 on success, -1 on error
|-
|-
| 4f || void* virt_to_phys(void *ptr) || Converts a virtual pointer to its physical equivalent
| 4f || void* virt_to_phys(void *ptr) || Converts a virtual pointer to its physical equivalent
|-
|-
−
| 50 || void Set_DVDVideo(u32 disable) || Enable/Disable DI DVD Video commands (can only be called from DI) || 0 on success, -1 on error
+
| 50 || int Set_DVDVideo(bool disable) || Enable/Disable DI DVD Video commands (can only be called from DI) || 0 on success, -1 on error
|-
|-
−
| 51 || u32 Check_DVDVideo() || Return status of DI DVD Video commands (can only be called from DI) || 1 if disabled, 0 if enabled or error
+
| 51 || bool Check_DVDVideo() || Return status of DI DVD Video commands (can only be called from DI) || 1 if disabled, 0 if enabled or error
|-
|-
−
| 52 || syscall_52 || can only be called from DI
+
| 52 || int syscall_52(bool value) || Sets bit 4 of [[Hardware/Hollywood_Registers#HW_EXICTRL|HW_EXICTRL]], clearing it if value is 0 and setting it otherwise. DI only seems to call it with false{{check}}. (Can only be called from DI)
+
| 0 on success, -1 on error
|-
|-
−
| 53 || syscall_53 || can only be called from DI
+
| 53 || bool syscall_53() || Checks bit 4 of [[Hardware/Hollywood_Registers#HW_EXICTRL|HW_EXICTRL]] (can only be called from DI) || 1 if bit 4 of [[Hardware/Hollywood_Registers#HW_EXICTRL|HW_EXICTRL]] is set, 0 if not set or error
|-
|-
| 54 || int set_ahbprot(u32 enable) || Enable/Disable PPC AHBPROT setting (can only be called from ES) || 0 on success, -1 on error
| 54 || int set_ahbprot(u32 enable) || Enable/Disable PPC AHBPROT setting (can only be called from ES) || 0 on success, -1 on error
Line 280:
Line 303:
| 57 || syscall_57 || 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
|-
|-
−
| 58 || void call_poke_debug_port(u8 value) || Set GPIO lines 16-23 (DEBUG1-7) to value
+
| 58 || void call_poke_debug_port(u8 value) || Set [[Hardware/Hollywood GPIOs|GPIO]] lines 16-23 (DEBUG0-7, the [[debug port]]) to value
|-
|-
| 59 || load_PPC || can only be called from ES || 0 on success, negative for error
| 59 || load_PPC || can only be called from ES || 0 on success, negative for error