Editing HV Syscall Reference
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 221: | Line 221: | ||
|R4 | |R4 | ||
|vas_id - virtual address space id of the PPE | |vas_id - virtual address space id of the PPE | ||
|} | |} | ||
Line 236: | Line 227: | ||
Regardless of the ppe_id, when called from kernel module init function, vas_id always seems to be 11. | Regardless of the ppe_id, when called from kernel module init function, vas_id always seems to be 11. | ||
---- | ---- | ||
=== lv1_query_logical_partition_address_region_info === | === lv1_query_logical_partition_address_region_info === | ||
Line 785: | Line 775: | ||
=== lv1_detect_pending_interrupts === | === lv1_detect_pending_interrupts === | ||
Not used in current kernel | Not used in current kernel. | ||
===== Abstract Call ===== | ===== Abstract Call ===== | ||
Line 800: | Line 790: | ||
|- | |- | ||
|R3 | |R3 | ||
|p1 - unknown | |p1 - unknown | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 808: | Line 798: | ||
|- | |- | ||
|R3 | |R3 | ||
|Status | |Status? | ||
|- | |- | ||
|R4 | |R4 | ||
|v1 - | |v1 - Unknown | ||
|- | |- | ||
|R5 | |R5 | ||
|v2 - | |v2 - Unknown | ||
|- | |- | ||
|R6 | |R6 | ||
|v3 - | |v3 - Unknown | ||
|- | |- | ||
|R7 | |R7 | ||
|v4 - | |v4 - Unknown | ||
|- | |- | ||
|} | |} | ||
Notes: | Notes: | ||
Info taken from kboot-10\dl\linux-2.6.16\include\asm-powerpc\lv1calltab.h (kboot-20061208) | Info taken from kboot-10\dl\linux-2.6.16\include\asm-powerpc\lv1calltab.h (kboot-20061208) | ||
---- | ---- | ||
=== lv1_end_of_interrupt === | === lv1_end_of_interrupt === | ||
Line 2,174: | Line 2,163: | ||
=== lv1_set_dabr === | === lv1_set_dabr === | ||
Sets dabr ( | Sets dabr (data address breakpoint register) - an exception should be thrown upon access to data at this address (range?) | ||
===== Kernel Call ===== | ===== Kernel Call ===== | ||
result = lv1_set_dabr( /*IN*/ dabr, | result = lv1_set_dabr( /*IN*/ dabr, DABR_KERNEL | DABR_USER); | ||
===== Parameters ===== | ===== Parameters ===== | ||
Line 2,189: | Line 2,178: | ||
|- | |- | ||
|R3 | |R3 | ||
|dabr - | |dabr - data address | ||
|- | |- | ||
|R4 | |R4 | ||
| | |(DABR_KERNEL | DABR_USER) - see notes | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 2,205: | Line 2,194: | ||
Notes: | Notes: | ||
DABR_KERNEL and DABR_USER are defined in “setup.c” as follows | |||
enum {DABR_USER = 1, DABR_KERNEL = 2,}; | enum {DABR_USER = 1, DABR_KERNEL = 2,}; | ||
---- | ---- | ||
=== lv1_set_vmx_graphics_mode === | === lv1_set_vmx_graphics_mode === | ||
Line 2,263: | Line 2,236: | ||
The Cell Broadband Engine Programming Handbook has this to say on the subject: The first implementation of the Cell Broadband Engine Architecture (CBEA) (the CBE processor) supports instructions with a graphics rounding mode. This mode allows programs written with vector/SIMD multimedia extension instructions to produce floating-point results that are equivalent in precision to those written in the SPU instruction set. In this mode, as in the SPU environment, the default rounding mode is round to zero, denormals are treated as zero, and there are no infinities or NaNs. | The Cell Broadband Engine Programming Handbook has this to say on the subject: The first implementation of the Cell Broadband Engine Architecture (CBEA) (the CBE processor) supports instructions with a graphics rounding mode. This mode allows programs written with vector/SIMD multimedia extension instructions to produce floating-point results that are equivalent in precision to those written in the SPU instruction set. In this mode, as in the SPU environment, the default rounding mode is round to zero, denormals are treated as zero, and there are no infinities or NaNs. | ||
To change this mode, bit 12 in the HID1 register (known as grap_md or grap_mode in various documents). HID1 is a HV privileged resource, hence to change the mode from Supervisor mode requires a HV call. | |||
Reference Documents: Cell Broadband Engine Programming Handbook V1.1 Cell Broadband Engine Registers V1.5 | Reference Documents: Cell Broadband Engine Programming Handbook V1.1 Cell Broadband Engine Registers V1.5 | ||
Line 2,273: | Line 2,246: | ||
When recompiled into Kernel module init function, accepts values of 0 and 1 for p1. All other values return -17 (LV1_ILLEGAL_PARAMETER_VALUE) | When recompiled into Kernel module init function, accepts values of 0 and 1 for p1. All other values return -17 (LV1_ILLEGAL_PARAMETER_VALUE) | ||
---- | ---- | ||
=== lv1_set_thread_switch_control_register === | === lv1_set_thread_switch_control_register === | ||
Line 2,382: | Line 2,354: | ||
Exists in PAL 1.7. Returns the same as [[HV_Syscall_Reference#lv1_undocumented_function_105|lv1_undocumented_function_105]]. | Exists in PAL 1.7. Returns the same as [[HV_Syscall_Reference#lv1_undocumented_function_105|lv1_undocumented_function_105]]. | ||
---- | ---- | ||
=== | === lv1_undocumented_function_110 === | ||
Exists in PAL 1.7. Returns -6 (LV1_NO_ENTRY) in R3, rest same as [[HV_Syscall_Reference#lv1_undocumented_function_105|lv1_undocumented_function_105]]. | |||
---- | |||
=== lv1_undocumented_function_111 === | |||
Exists in PAL 1.7. Returns -6 (LV1_NO_ENTRY) in R3, rest same as [[HV_Syscall_Reference#lv1_undocumented_function_105|lv1_undocumented_function_105]]. | |||
---- | |||
=== lv1_undocumented_function_112 === | |||
Exists in PAL 1.7. Returns -6 (LV1_NO_ENTRY) in R3, rest same as [[HV_Syscall_Reference#lv1_undocumented_function_105|lv1_undocumented_function_105]]. | |||
---- | |||
=== lv1_undocumented_function_114 === | |||
===== Parameters ===== | ===== Parameters ===== | ||
Line 2,393: | Line 2,377: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |start - | ||
|- | |- | ||
|R4 | |R4 | ||
| | |page_size - | ||
|- | |- | ||
|R5 | |R5 | ||
| | |size - | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 2,413: | Line 2,391: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |Status - 0 = OK, Other values are unknown, but indicate failure. | ||
|- | |- | ||
|R4 | |R4 | ||
| | |lpar_addr - | ||
|- | |- | ||
|} | |} | ||
---- | ---- | ||
=== | === lv1_undocumented_function_115 === | ||
===== Parameters ===== | ===== Parameters ===== | ||
Line 2,432: | Line 2,411: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |lpar_addr - | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 2,452: | Line 2,419: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |Status - 0 = OK, Other values are unknown, but indicate failure. | ||
|- | |- | ||
|} | |} | ||
---- | |||
=== | |||
---- | |||
=== lv1_allocate_io_segment === | |||
Allocate an io segment. | |||
===== kboot Call ===== | |||
result = lv1_allocate_io_segment( /*IN*/ ioas_id, segment_size, io_page_size, /*OUT*/ &ioif_addr ); | |||
===== Parameters ===== | ===== Parameters ===== | ||
Line 2,470: | Line 2,443: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |ioas_id - io address space id | ||
|- | |- | ||
|R4 | |R4 | ||
| | |segment_size - io segment size | ||
|- | |||
|R5 | |||
|io_page_size - io page size, 0xC, 0×10, 0×14 | |||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 2,481: | Line 2,457: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |Status - 0 = OK, Other values are unknown, but indicate failure. | ||
|- | |- | ||
|R4 | |R4 | ||
| | |ioif_addr - io interface address | ||
|- | |- | ||
|}---- | |} | ||
=== | |||
Notes: | |||
Code taken from kboot-10\dl\linux-2.6.16\sound\powerpc\snd_ps3pf.c (kboot-20061208) | |||
ret64 = lv1_allocate_io_segment(0, /* io space */ | |||
IO_SEGMENTSIZE, /* segment size */ | |||
IO_PAGESIZE_SHIFT, /* io page size */ | |||
&(ioif_map_info_array[current_segment].ioif_addr)); | |||
---- | |||
=== lv1_release_io_segment === | |||
Release an io segment. | |||
===== kboot Call ===== | |||
result = lv1_release_io_segment( /*IN*/ ioas_id, ioif_addr ); | |||
===== Parameters ===== | ===== Parameters ===== | ||
Line 2,498: | Line 2,489: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |ioas_id - io address space id | ||
|- | |- | ||
|R4 | |R4 | ||
| | |ioif_addr - io interface address | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 2,513: | Line 2,501: | ||
|R3 | |R3 | ||
|Status - 0 = OK, Other values are unknown, but indicate failure. | |Status - 0 = OK, Other values are unknown, but indicate failure. | ||
|- | |- | ||
|} | |} | ||
---- | Notes: | ||
=== | Code taken from kboot-10\dl\linux-2.6.16\sound\powerpc\snd_ps3pf.c (kboot-20061208) | ||
ret64 = lv1_release_io_segment(0, /* io space */ | |||
ioif_map_info_array[current_segment].ioif_addr); | |||
---- | |||
=== lv1_allocate_ioid === | |||
Not used in current kernel. | |||
===== Abstract Call ===== | |||
result = lv1_allocate_ioid( /*IN*/ p1, /*OUT*/ &v1 ); | |||
===== Parameters ===== | ===== Parameters ===== | ||
Line 2,532: | Line 2,527: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |SBZ | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 2,540: | Line 2,535: | ||
|- | |- | ||
|R3 | |R3 | ||
|Status - | |Status? | ||
|- | |||
|R4 | |||
|the ioid | |||
|- | |- | ||
|} | |} | ||
Notes: | |||
Info taken from kboot-10\dl\linux-2.6.16\include\asm-powerpc\lv1calltab.h (kboot-20061208) | |||
---- | ---- | ||
=== lv1_release_ioid === | |||
Not used in current Kernel. | |||
===== Abstract Call ===== | |||
result = lv1_release_ioid( /*IN*/ p1, p2 ); | |||
result = | |||
===== Parameters ===== | ===== Parameters ===== | ||
Line 2,564: | Line 2,563: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |p1 - Unknown | ||
|- | |- | ||
|R4 | |R4 | ||
| | |p2 - Unknown | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 2,578: | Line 2,574: | ||
|- | |- | ||
|R3 | |R3 | ||
|Status | |Status? | ||
|- | |- | ||
|} | |} | ||
Line 2,587: | Line 2,580: | ||
Notes: | Notes: | ||
Info taken from kboot-10\dl\linux-2.6.16\include\asm-powerpc\lv1calltab.h (kboot-20061208) | |||
---- | ---- | ||
=== | === lv1_construct_io_irq_outlet === | ||
Construct an outlet for a non-virtualized device interrupt. | |||
===== | ===== Kernel Call ===== | ||
result = | result = lv1_construct_io_irq_outlet( /*IN*/ interrupt_id, /*OUT*/ &outlet ); | ||
===== Parameters ===== | ===== Parameters ===== | ||
Line 2,610: | Line 2,599: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |interrupt_id - interrupt id | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 2,622: | Line 2,608: | ||
|R3 | |R3 | ||
|Status - 0 = OK, Other values are unknown, but indicate failure. | |Status - 0 = OK, Other values are unknown, but indicate failure. | ||
|- | |||
|R4 | |||
|outlet - interrupt outlet | |||
|- | |- | ||
|} | |} | ||
---- | ---- | ||
=== | === lv1_destruct_io_irq_outlet === | ||
Destruct a previously constructed device interrupt outlet. | |||
===== | ===== Kernel Call ===== | ||
result = | result = lv1_destruct_io_irq_outlet( /*IN*/ outlet ); | ||
===== Parameters ===== | ===== Parameters ===== | ||
Line 2,648: | Line 2,631: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |outlet - interrupt outlet | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 2,656: | Line 2,639: | ||
|- | |- | ||
|R3 | |R3 | ||
|Status | |Status - 0 = OK, Other values are unknown, but indicate failure. | ||
|} | |} | ||
---- | ---- | ||
=== | === lv1_map_htab === | ||
Map the hash page table. | |||
===== | ===== Kernel Call ===== | ||
result = | result = lv1_map_htab( /*IN*/ 0, /*OUT*/ &htab_addr ); | ||
===== Parameters ===== | ===== Parameters ===== | ||
Line 2,684: | Line 2,659: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |0 - Unknown (lpid?) | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 2,697: | Line 2,669: | ||
|Status? | |Status? | ||
|- | |- | ||
|R4 | |||
|htab_addr - hash page table address | |||
|} | |} | ||
Notes: | Notes: | ||
In “htab.c” return code is assigned, but not used. Must be translated and ioremapped before it can be used in the kernel. It’s 1MB long | |||
---- | ---- | ||
=== | === lv1_unmap_htab === | ||
Unmap the hash page table. | |||
===== Kernel Call ===== | ===== Kernel Call ===== | ||
lv1_unmap_htab( /*IN*/ htab_addr ); | |||
===== Parameters ===== | ===== Parameters ===== | ||
Line 2,720: | Line 2,694: | ||
|- | |- | ||
|R3 | |R3 | ||
| | |htab_addr - hash page table address | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 2,728: | Line 2,702: | ||
|- | |- | ||
|R3 | |R3 | ||
|Status | |Status? | ||
|} | |} | ||
---- | ---- | ||
=== | === lv1_undocumented_function_124 === | ||
Exists in PAL 1.7. Returns -6 (LV1_NO_ENTRY) in R3, rest same as [[HV_Syscall_Reference#lv1_undocumented_function_105|lv1_undocumented_function_105]]. | |||
---- | |||
=== lv1_undocumented_function_125 === | |||
=== | Exists in PAL 1.7. Returns -6 (LV1_NO_ENTRY) in R3, rest same as [[HV_Syscall_Reference#lv1_undocumented_function_105|lv1_undocumented_function_105]]. | ||
---- | |||
=== lv1_undocumented_function_126 === | |||
Exists in PAL 1.7. Returns -6 (LV1_NO_ENTRY) in R3, rest same as [[HV_Syscall_Reference#lv1_undocumented_function_105|lv1_undocumented_function_105]]. | |||
---- | ---- | ||
=== lv1_get_version_info === | === lv1_get_version_info === | ||
Line 4,157: | Line 3,934: | ||
===== Kernel Call ===== | ===== Kernel Call ===== | ||
result = lv1_allocate_device_dma_region( /*IN*/ bus_id, dev_id, io_size, io_pagesize, flag, | result = lv1_allocate_device_dma_region( /*IN*/ bus_id, dev_id, io_size, io_pagesize, flag, &dma_region ); | ||
===== Parameters ===== | ===== Parameters ===== | ||
Line 4,197: | Line 3,974: | ||
Notes: When the device is little endian, the mode must be set to 8 bit for 8 bit DMA to work as expected, otherwise the bytes will be read/written in the wrong order. OTOH, this mode requires that 16 and 32-bit values are byte-swapped by the CPU since they will appear as little endian in memory. | Notes: When the device is little endian, the mode must be set to 8 bit for 8 bit DMA to work as expected, otherwise the bytes will be read/written in the wrong order. OTOH, this mode requires that 16 and 32-bit values are byte-swapped by the CPU since they will appear as little endian in memory. | ||
---- | ---- | ||
=== lv1_free_device_dma_region === | === lv1_free_device_dma_region === | ||
Line 5,308: | Line 5,084: | ||
|- | |- | ||
|R4 | |R4 | ||
| | |0 - Unknown. Max value 512*1024. | ||
|- | |- | ||
|R5 | |R5 | ||
| | |0 - Unknown. Max value 3075*1024. | ||
|- | |- | ||
|R6 | |R6 | ||
| | |0 - Unknown. Max value 15. | ||
|- | |- | ||
|R7 | |R7 | ||
| | |0 - Unknown. Max value 8. | ||
|- | |- | ||
! colspan="2" | Outputs | ! colspan="2" | Outputs | ||
Line 6,132: | Line 5,908: | ||
|R4 | |R4 | ||
|IRQ Bitmap of all pending IRQ’s. This is a bitset. | |IRQ Bitmap of all pending IRQ’s. This is a bitset. | ||
0 | A bit = 0 means IRQ not pending, 1 = IRQ pending. | ||
Bit GPU_INTR_STATUS_VSYNC_0 = 0. IRQ for vsync on head A. Unused by Kernel | |||
Bit GPU_INTR_STATUS_VSYNC_1 = 1. IRQ for vsync on head B. Used by Kernel | |||
Bit GPU_INTR_STATUS_FLIP_0 = 2. IRQ for flip on head A. Unused by Kernel | |||
Bit GPU_INTR_STATUS_FLIP_1 = 3. IRQ for flip on head B. Unused by Kernel | |||
Bit GPU_INTR_STATUS_QUEUE_0 = 4. IRQ for queue on head A. Unused by Kernel | |||
Bit GPU_INTR_STATUS_QUEUE_1 = 5. IRQ for queue on head B. Unused by Kernel | |||
|- | |- | ||
|} | |} | ||
---- | ---- | ||
=== lv1_gpu_attribute === | === lv1_gpu_attribute === | ||