Index: head/sys/powerpc/ps3/ps3-hvcall.S =================================================================== --- head/sys/powerpc/ps3/ps3-hvcall.S (revision 228688) +++ head/sys/powerpc/ps3/ps3-hvcall.S (revision 228689) @@ -1,1254 +1,1278 @@ /* $FreeBSD$ */ #include #define hc .long 0x44000022 ASENTRY(lv1_allocate_memory) mflr %r0 std %r0,16(%r1) stdu %r1,-64(%r1) std %r7,48(%r1) std %r8,56(%r1) li %r11,0 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_write_htab_entry) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,1 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_construct_virtual_address_space) mflr %r0 std %r0,16(%r1) stdu %r1,-64(%r1) std %r6,48(%r1) std %r7,56(%r1) li %r11,2 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_get_virtual_address_space_id_of_ppe) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r4,48(%r1) li %r11,4 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_query_logical_partition_address_region_info) mflr %r0 std %r0,16(%r1) stdu %r1,-88(%r1) std %r4,48(%r1) std %r5,56(%r1) std %r6,64(%r1) std %r7,72(%r1) std %r8,80(%r1) li %r11,6 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r11,64(%r1) std %r6,0(%r11) ld %r11,72(%r1) std %r7,0(%r11) ld %r11,80(%r1) std %r8,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_select_virtual_address_space) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,7 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_pause) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,9 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_destruct_virtual_address_space) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,10 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_configure_irq_state_bitmap) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,11 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_connect_irq_plug_ext) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,12 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_release_memory) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,13 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_put_iopte) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,15 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_disconnect_irq_plug_ext) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,17 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_construct_event_receive_port) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r3,48(%r1) li %r11,18 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_destruct_event_receive_port) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,19 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_send_event_locally) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,24 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_end_of_interrupt) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,27 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_connect_irq_plug) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,28 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_disconnect_irq_plus) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,29 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_end_of_interrupt_ext) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,30 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_did_update_interrupt_mask) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,31 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_shutdown_logical_partition) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,44 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_destruct_logical_spe) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,54 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_construct_logical_spe) mflr %r0 std %r0,16(%r1) stdu %r1,-96(%r1) std %r10,48(%r1) ld %r11,208(%r1) std %r11,56(%r1) ld %r11,216(%r1) std %r11,64(%r1) ld %r11,224(%r1) std %r11,72(%r1) ld %r11,232(%r1) std %r11,80(%r1) ld %r11,240(%r1) std %r11,88(%r1) li %r11,57 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r11,64(%r1) std %r6,0(%r11) ld %r11,72(%r1) std %r7,0(%r11) ld %r11,80(%r1) std %r8,0(%r11) ld %r11,88(%r1) std %r9,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_set_spe_interrupt_mask) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,61 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_disable_logical_spe) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,65 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_clear_spe_interrupt_status) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,66 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_get_spe_interrupt_status) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r5,48(%r1) li %r11,67 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_get_logical_ppe_id) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r3,48(%r1) li %r11,69 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_get_logical_partition_id) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r3,48(%r1) li %r11,74 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_get_spe_irq_outlet) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r5,48(%r1) li %r11,78 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_set_spe_privilege_state_area_1_register) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,79 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_get_repository_node_value) mflr %r0 std %r0,16(%r1) stdu %r1,-64(%r1) std %r8,48(%r1) std %r9,56(%r1) li %r11,91 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_read_htab_entries) mflr %r0 std %r0,16(%r1) stdu %r1,-88(%r1) std %r5,48(%r1) std %r6,56(%r1) std %r7,64(%r1) std %r8,72(%r1) std %r9,80(%r1) li %r11,95 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r11,64(%r1) std %r6,0(%r11) ld %r11,72(%r1) std %r7,0(%r11) ld %r11,80(%r1) std %r8,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_set_dabr) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,96 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_allocate_io_segment) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r6,48(%r1) li %r11,116 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_release_io_segment) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,117 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_construct_io_irq_outlet) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r4,48(%r1) li %r11,120 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_destruct_io_irq_outlet) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,121 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_map_htab) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r4,48(%r1) li %r11,122 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_unmap_htab) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,123 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_get_version_info) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r3,48(%r1) li %r11,127 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_insert_htab_entry) mflr %r0 std %r0,16(%r1) stdu %r1,-72(%r1) std %r9,48(%r1) std %r10,56(%r1) ld %r11,184(%r1) std %r11,64(%r1) li %r11,158 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r11,64(%r1) std %r6,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_read_virtual_uart) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r6,48(%r1) li %r11,162 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_write_virtual_uart) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r6,48(%r1) li %r11,163 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_set_virtual_uart_param) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,164 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_get_virtual_uart_param) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r5,48(%r1) li %r11,165 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_configure_virtual_uart) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r4,48(%r1) li %r11,166 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_open_device) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,170 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_close_device) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,171 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_map_device_mmio_region) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r8,48(%r1) li %r11,172 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_unmap_device_mmio_region) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,173 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_allocate_device_dma_region) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r8,48(%r1) li %r11,174 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_free_device_dma_region) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,175 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_map_device_dma_region) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,176 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_unmap_device_dma_region) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,177 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_read_pci_config) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r9,48(%r1) li %r11,178 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_write_pci_config) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,179 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_net_add_multicast_address) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,185 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_net_remove_multicast_address) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,186 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_net_start_tx_dma) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,187 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_net_stop_tx_dma) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,188 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_net_start_rx_dma) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,189 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_net_stop_rx_dma) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,190 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_net_set_interrupt_status_indicator) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,191 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_net_set_interrupt_mask) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,193 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_net_control) mflr %r0 std %r0,16(%r1) stdu %r1,-64(%r1) std %r9,48(%r1) std %r10,56(%r1) li %r11,194 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_connect_interrupt_event_receive_port) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,197 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_disconnect_interrupt_event_receive_port) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,198 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_deconfigure_virtual_uart_irq) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,202 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_enable_logical_spe) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,207 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_gpu_open) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,210 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_gpu_close) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,211 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_gpu_device_map) mflr %r0 std %r0,16(%r1) stdu %r1,-64(%r1) std %r4,48(%r1) std %r5,56(%r1) li %r11,212 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_gpu_device_unmap) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,213 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_gpu_memory_allocate) mflr %r0 std %r0,16(%r1) stdu %r1,-64(%r1) std %r8,48(%r1) std %r9,56(%r1) li %r11,214 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_gpu_memory_free) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,216 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_gpu_context_allocate) mflr %r0 std %r0,16(%r1) - stdu %r1,-56(%r1) + stdu %r1,-88(%r1) std %r5,48(%r1) + std %r6,56(%r1) + std %r7,64(%r1) + std %r8,72(%r1) + std %r9,80(%r1) li %r11,217 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) + ld %r11,56(%r1) + std %r5,0(%r11) + ld %r11,64(%r1) + std %r6,0(%r11) + ld %r11,72(%r1) + std %r7,0(%r11) + ld %r11,80(%r1) + std %r8,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_gpu_context_free) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,218 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_gpu_context_iomap) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,221 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_gpu_context_attribute) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,225 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_gpu_context_intr) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r4,48(%r1) li %r11,227 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) + ld %r1,0(%r1) + ld %r0,16(%r1) + mtlr %r0 + blr + +ASENTRY(lv1_gpu_attribute) + mflr %r0 + std %r0,16(%r1) + stdu %r1,-48(%r1) + li %r11,228 + hc + extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_get_rtc) mflr %r0 std %r0,16(%r1) stdu %r1,-64(%r1) std %r3,48(%r1) std %r4,56(%r1) li %r11,232 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_storage_read) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r9,48(%r1) li %r11,245 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_storage_write) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r9,48(%r1) li %r11,246 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_storage_send_device_command) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r9,48(%r1) li %r11,248 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_storage_get_async_status) mflr %r0 std %r0,16(%r1) stdu %r1,-64(%r1) std %r4,48(%r1) std %r5,56(%r1) li %r11,249 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r11,56(%r1) std %r5,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_storage_check_async_status) mflr %r0 std %r0,16(%r1) stdu %r1,-56(%r1) std %r5,48(%r1) li %r11,254 hc extsw %r3,%r3 ld %r11,48(%r1) std %r4,0(%r11) ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr ASENTRY(lv1_panic) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) li %r11,255 hc extsw %r3,%r3 ld %r1,0(%r1) ld %r0,16(%r1) mtlr %r0 blr Index: head/sys/powerpc/ps3/ps3-hvcall.h =================================================================== --- head/sys/powerpc/ps3/ps3-hvcall.h (revision 228688) +++ head/sys/powerpc/ps3/ps3-hvcall.h (revision 228689) @@ -1,138 +1,139 @@ /* * Playstation 3 LV1 hypercall interface * * $FreeBSD$ */ #include enum lpar_id { PS3_LPAR_ID_CURRENT = 0x00, PS3_LPAR_ID_PME = 0x01, }; /* Return codes from hypercalls */ #define LV1_SUCCESS 0 #define LV1_RESOURCE_SHORTAGE -2 #define LV1_NO_PRIVILEGE -3 #define LV1_DENIED_BY_POLICY -4 #define LV1_ACCESS_VIOLATION -5 #define LV1_NO_ENTRY -6 #define LV1_DUPLICATE_ENTRY -7 #define LV1_TYPE_MISMATCH -8 #define LV1_BUSY -9 #define LV1_EMPTY -10 #define LV1_WRONG_STATE -11 #define LV1_NO_MATCH -13 #define LV1_ALREADY_CONNECTED -14 #define LV1_UNSUPPORTED_PARAMETER_VALUE -15 #define LV1_CONDITION_NOT_SATISFIED -16 #define LV1_ILLEGAL_PARAMETER_VALUE -17 #define LV1_BAD_OPTION -18 #define LV1_IMPLEMENTATION_LIMITATION -19 #define LV1_NOT_IMPLEMENTED -20 #define LV1_INVALID_CLASS_ID -21 #define LV1_CONSTRAINT_NOT_SATISFIED -22 #define LV1_ALIGNMENT_ERROR -23 #define LV1_HARDWARE_ERROR -24 #define LV1_INVALID_DATA_FORMAT -25 #define LV1_INVALID_OPERATION -26 #define LV1_INTERNAL_ERROR -32768 static inline uint64_t lv1_repository_string(const char *str) { uint64_t ret = 0; strncpy((char *)&ret, str, sizeof(ret)); return (ret); } int lv1_allocate_memory(uint64_t size, uint64_t log_page_size, uint64_t zero, uint64_t flags, uint64_t *base_addr, uint64_t *muid); int lv1_write_htab_entry(uint64_t vas_id, uint64_t slot, uint64_t pte_hi, uint64_t pte_lo); int lv1_construct_virtual_address_space(uint64_t log_pteg_count, uint64_t n_sizes, uint64_t page_sizes, uint64_t *vas_id, uint64_t *hv_pteg_count); int lv1_get_virtual_address_space_id_of_ppe(uint64_t ppe_id, uint64_t *vas_id); int lv1_query_logical_partition_address_region_info(uint64_t lpar_id, uint64_t *base_addr, uint64_t *size, uint64_t *access_right, uint64_t *max_page_size, uint64_t *flags); int lv1_select_virtual_address_space(uint64_t vas_id); int lv1_pause(uint64_t mode); int lv1_destruct_virtual_address_space(uint64_t vas_id); int lv1_configure_irq_state_bitmap(uint64_t ppe_id, uint64_t cpu_id, uint64_t bitmap_addr); int lv1_connect_irq_plug_ext(uint64_t ppe_id, uint64_t cpu_id, uint64_t virq, uint64_t outlet, uint64_t zero); int lv1_release_memory(uint64_t base_addr); int lv1_put_iopte(uint64_t ioas_id, uint64_t ioif_addr, uint64_t lpar_addr, uint64_t io_id, uint64_t flags); int lv1_disconnect_irq_plug_ext(uint64_t ppe_id, uint64_t cpu_id, uint64_t virq); int lv1_construct_event_receive_port(uint64_t *outlet); int lv1_destruct_event_receive_port(uint64_t outlet); int lv1_send_event_locally(uint64_t outlet); int lv1_end_of_interrupt(uint64_t irq); int lv1_connect_irq_plug(uint64_t virq, uint64_t irq); int lv1_disconnect_irq_plus(uint64_t virq); int lv1_end_of_interrupt_ext(uint64_t ppe_id, uint64_t cpu_id, uint64_t virq); int lv1_did_update_interrupt_mask(uint64_t ppe_id, uint64_t cpu_id); int lv1_shutdown_logical_partition(uint64_t cmd); int lv1_destruct_logical_spe(uint64_t spe_id); int lv1_construct_logical_spe(uint64_t pshift1, uint64_t pshift2, uint64_t pshift3, uint64_t pshift4, uint64_t pshift5, uint64_t vas_id, uint64_t spe_type, uint64_t *priv2_addr, uint64_t *problem_phys, uint64_t *local_store_phys, uint64_t *unused, uint64_t *shadow_addr, uint64_t *spe_id); int lv1_set_spe_interrupt_mask(uint64_t spe_id, uint64_t class, uint64_t mask); int lv1_disable_logical_spe(uint64_t spe_id, uint64_t zero); int lv1_clear_spe_interrupt_status(uint64_t spe_id, uint64_t class, uint64_t stat, uint64_t zero); int lv1_get_spe_interrupt_status(uint64_t spe_id, uint64_t class, uint64_t *stat); int lv1_get_logical_ppe_id(uint64_t *ppe_id); int lv1_get_logical_partition_id(uint64_t *lpar_id); int lv1_get_spe_irq_outlet(uint64_t spe_id, uint64_t class, uint64_t *outlet); int lv1_set_spe_privilege_state_area_1_register(uint64_t spe_id, uint64_t offset, uint64_t value); int lv1_get_repository_node_value(uint64_t lpar_id, uint64_t n1, uint64_t n2, uint64_t n3, uint64_t n4, uint64_t *v1, uint64_t *v2); int lv1_read_htab_entries(uint64_t vas_id, uint64_t slot, uint64_t *hi1, uint64_t *hi2, uint64_t *hi3, uint64_t *hi4, uint64_t *rcbits); int lv1_set_dabr(uint64_t dabr, uint64_t flags); int lv1_allocate_io_segment(uint64_t ioas_id, uint64_t seg_size, uint64_t io_pagesize, uint64_t *ioif_addr); int lv1_release_io_segment(uint64_t ioas_id, uint64_t ioif_addr); int lv1_construct_io_irq_outlet(uint64_t interrupt_id, uint64_t *outlet); int lv1_destruct_io_irq_outlet(uint64_t outlet); int lv1_map_htab(uint64_t lpar_id, uint64_t *htab_addr); int lv1_unmap_htab(uint64_t htab_addr); int lv1_get_version_info(uint64_t *firm_vers); int lv1_insert_htab_entry(uint64_t vas_id, uint64_t pteg, uint64_t pte_hi, uint64_t pte_lo, uint64_t lockflags, uint64_t flags, uint64_t *index, uint64_t *evicted_hi, uint64_t *evicted_lo); int lv1_read_virtual_uart(uint64_t port, uint64_t buffer, uint64_t bytes, uint64_t *bytes_read); int lv1_write_virtual_uart(uint64_t port, uint64_t buffer, uint64_t bytes, uint64_t *bytes_written); int lv1_set_virtual_uart_param(uint64_t port, uint64_t param, uint64_t value); int lv1_get_virtual_uart_param(uint64_t port, uint64_t param, uint64_t *value); int lv1_configure_virtual_uart(uint64_t lpar_addr, uint64_t *outlet); int lv1_open_device(uint64_t bus, uint64_t dev, uint64_t zero); int lv1_close_device(uint64_t bus, uint64_t dev); int lv1_map_device_mmio_region(uint64_t bus, uint64_t dev, uint64_t bus_addr, uint64_t size, uint64_t page_size, uint64_t *lpar_addr); int lv1_unmap_device_mmio_region(uint64_t bus, uint64_t dev, uint64_t lpar_addr); int lv1_allocate_device_dma_region(uint64_t bus, uint64_t dev, uint64_t io_size, uint64_t io_pagesize, uint64_t flag, uint64_t *dma_region); int lv1_free_device_dma_region(uint64_t bus, uint64_t dev, uint64_t dma_region); int lv1_map_device_dma_region(uint64_t bus, uint64_t dev, uint64_t lpar_addr, uint64_t dma_region, uint64_t size, uint64_t flags); int lv1_unmap_device_dma_region(uint64_t bus, uint64_t dev, uint64_t dma_region, uint64_t size); int lv1_read_pci_config(uint64_t ps3bus, uint64_t bus, uint64_t dev, uint64_t func, uint64_t offset, uint64_t size, uint64_t *result); int lv1_write_pci_config(uint64_t ps3bus, uint64_t bus, uint64_t dev, uint64_t func, uint64_t offset, uint64_t size, uint64_t data); int lv1_net_add_multicast_address(uint64_t bus, uint64_t dev, uint64_t addr, uint64_t flags); int lv1_net_remove_multicast_address(uint64_t bus, uint64_t dev, uint64_t zero, uint64_t one); int lv1_net_start_tx_dma(uint64_t bus, uint64_t dev, uint64_t bus_addr, uint64_t zero); int lv1_net_stop_tx_dma(uint64_t bus, uint64_t dev, uint64_t zero); int lv1_net_start_rx_dma(uint64_t bus, uint64_t dev, uint64_t bus_addr, uint64_t zero); int lv1_net_stop_rx_dma(uint64_t bus, uint64_t dev, uint64_t zero); int lv1_net_set_interrupt_status_indicator(uint64_t bus, uint64_t dev, uint64_t irq_status_addr, uint64_t zero); int lv1_net_set_interrupt_mask(uint64_t bus, uint64_t dev, uint64_t mask, uint64_t zero); int lv1_net_control(uint64_t bus, uint64_t dev, uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t *v1, uint64_t *v2); int lv1_connect_interrupt_event_receive_port(uint64_t bus, uint64_t dev, uint64_t outlet, uint64_t irq); int lv1_disconnect_interrupt_event_receive_port(uint64_t bus, uint64_t dev, uint64_t outlet, uint64_t irq); int lv1_deconfigure_virtual_uart_irq(void); int lv1_enable_logical_spe(uint64_t spe_id, uint64_t resource_id); int lv1_gpu_open(uint64_t zero); int lv1_gpu_close(void); int lv1_gpu_device_map(uint64_t dev, uint64_t *lpar_addr, uint64_t *lpar_size); int lv1_gpu_device_unmap(uint64_t dev); int lv1_gpu_memory_allocate(uint64_t ddr_size, uint64_t zero1, uint64_t zero2, uint64_t zero3, uint64_t zero4, uint64_t *handle, uint64_t *ddr_lpar); int lv1_gpu_memory_free(uint64_t handle); -int lv1_gpu_context_allocate(uint64_t handle, uint64_t , uint64_t *zero); +int lv1_gpu_context_allocate(uint64_t handle, uint64_t flags, uint64_t *chandle, uint64_t *lpar_dma_control, uint64_t *lpar_driver_info, uint64_t *lpar_reports, uint64_t *lpar_reports_size); int lv1_gpu_context_free(uint64_t chandle); int lv1_gpu_context_iomap(uint64_t changle, uint64_t gpu_ioif, uint64_t xdr_lpar, uint64_t fbsize, uint64_t ioflags); int lv1_gpu_context_attribute(uint64_t chandle, uint64_t op, uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4); int lv1_gpu_context_intr(uint64_t chandle, uint64_t *v1); +int lv1_gpu_attribute(uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t p5); int lv1_get_rtc(uint64_t *rtc_val, uint64_t *timebase); int lv1_storage_read(uint64_t dev, uint64_t region, uint64_t sector, uint64_t nsectors, uint64_t flags, uint64_t buf, uint64_t *dma_tag); int lv1_storage_write(uint64_t dev, uint64_t region, uint64_t sector, uint64_t nsectors, uint64_t flags, uint64_t buf, uint64_t *dma_tag); int lv1_storage_send_device_command(uint64_t dev, uint64_t cmd_id, uint64_t cmd_block, uint64_t cmd_size, uint64_t data_buf, uint64_t blocks, uint64_t *dma_tag); int lv1_storage_get_async_status(uint64_t dev, uint64_t *dma_tag, uint64_t *status); int lv1_storage_check_async_status(uint64_t dev, uint64_t dma_tag, uint64_t *status); int lv1_panic(uint64_t howto); Index: head/sys/powerpc/ps3/ps3-hvcall.master =================================================================== --- head/sys/powerpc/ps3/ps3-hvcall.master (revision 228688) +++ head/sys/powerpc/ps3/ps3-hvcall.master (revision 228689) @@ -1,139 +1,140 @@ /* * Playstation 3 LV1 hypercall interface * * $FreeBSD$ */ #include enum lpar_id { PS3_LPAR_ID_CURRENT = 0x00, PS3_LPAR_ID_PME = 0x01, }; /* Return codes from hypercalls */ #define LV1_SUCCESS 0 #define LV1_RESOURCE_SHORTAGE -2 #define LV1_NO_PRIVILEGE -3 #define LV1_DENIED_BY_POLICY -4 #define LV1_ACCESS_VIOLATION -5 #define LV1_NO_ENTRY -6 #define LV1_DUPLICATE_ENTRY -7 #define LV1_TYPE_MISMATCH -8 #define LV1_BUSY -9 #define LV1_EMPTY -10 #define LV1_WRONG_STATE -11 #define LV1_NO_MATCH -13 #define LV1_ALREADY_CONNECTED -14 #define LV1_UNSUPPORTED_PARAMETER_VALUE -15 #define LV1_CONDITION_NOT_SATISFIED -16 #define LV1_ILLEGAL_PARAMETER_VALUE -17 #define LV1_BAD_OPTION -18 #define LV1_IMPLEMENTATION_LIMITATION -19 #define LV1_NOT_IMPLEMENTED -20 #define LV1_INVALID_CLASS_ID -21 #define LV1_CONSTRAINT_NOT_SATISFIED -22 #define LV1_ALIGNMENT_ERROR -23 #define LV1_HARDWARE_ERROR -24 #define LV1_INVALID_DATA_FORMAT -25 #define LV1_INVALID_OPERATION -26 #define LV1_INTERNAL_ERROR -32768 static inline uint64_t lv1_repository_string(const char *str) { uint64_t ret = 0; strncpy((char *)&ret, str, sizeof(ret)); return (ret); } # Code Name Inputs Outputs HVCALL 0 lv1_allocate_memory size,log_page_size,zero,flags base_addr,muid HVCALL 1 lv1_write_htab_entry vas_id,slot,pte_hi,pte_lo HVCALL 2 lv1_construct_virtual_address_space log_pteg_count,n_sizes,page_sizes vas_id,hv_pteg_count HVCALL 4 lv1_get_virtual_address_space_id_of_ppe ppe_id vas_id HVCALL 6 lv1_query_logical_partition_address_region_info lpar_id base_addr,size,access_right,max_page_size,flags HVCALL 7 lv1_select_virtual_address_space vas_id HVCALL 9 lv1_pause mode HVCALL 10 lv1_destruct_virtual_address_space vas_id HVCALL 11 lv1_configure_irq_state_bitmap ppe_id,cpu_id,bitmap_addr HVCALL 12 lv1_connect_irq_plug_ext ppe_id,cpu_id,virq,outlet,zero HVCALL 13 lv1_release_memory base_addr HVCALL 15 lv1_put_iopte ioas_id,ioif_addr,lpar_addr,io_id,flags HVCALL 17 lv1_disconnect_irq_plug_ext ppe_id,cpu_id,virq HVCALL 18 lv1_construct_event_receive_port UNUSED outlet HVCALL 19 lv1_destruct_event_receive_port outlet HVCALL 24 lv1_send_event_locally outlet HVCALL 27 lv1_end_of_interrupt irq HVCALL 28 lv1_connect_irq_plug virq,irq HVCALL 29 lv1_disconnect_irq_plus virq HVCALL 30 lv1_end_of_interrupt_ext ppe_id,cpu_id,virq HVCALL 31 lv1_did_update_interrupt_mask ppe_id,cpu_id HVCALL 44 lv1_shutdown_logical_partition cmd HVCALL 54 lv1_destruct_logical_spe spe_id HVCALL 57 lv1_construct_logical_spe pshift1,pshift2,pshift3,pshift4,pshift5,vas_id,spe_type priv2_addr,problem_phys,local_store_phys,unused,shadow_addr,spe_id HVCALL 61 lv1_set_spe_interrupt_mask spe_id,class,mask HVCALL 65 lv1_disable_logical_spe spe_id,zero HVCALL 66 lv1_clear_spe_interrupt_status spe_id,class,stat,zero HVCALL 67 lv1_get_spe_interrupt_status spe_id,class stat HVCALL 69 lv1_get_logical_ppe_id UNUSED ppe_id HVCALL 74 lv1_get_logical_partition_id UNUSED lpar_id HVCALL 78 lv1_get_spe_irq_outlet spe_id,class outlet HVCALL 79 lv1_set_spe_privilege_state_area_1_register spe_id,offset,value HVCALL 91 lv1_get_repository_node_value lpar_id,n1,n2,n3,n4 v1,v2 HVCALL 95 lv1_read_htab_entries vas_id,slot hi1,hi2,hi3,hi4,rcbits HVCALL 96 lv1_set_dabr dabr,flags HVCALL 116 lv1_allocate_io_segment ioas_id,seg_size,io_pagesize ioif_addr HVCALL 117 lv1_release_io_segment ioas_id,ioif_addr HVCALL 120 lv1_construct_io_irq_outlet interrupt_id outlet HVCALL 121 lv1_destruct_io_irq_outlet outlet HVCALL 122 lv1_map_htab lpar_id htab_addr HVCALL 123 lv1_unmap_htab htab_addr HVCALL 127 lv1_get_version_info UNUSED firm_vers HVCALL 158 lv1_insert_htab_entry vas_id,pteg,pte_hi,pte_lo,lockflags,flags index,evicted_hi,evicted_lo HVCALL 162 lv1_read_virtual_uart port,buffer,bytes bytes_read HVCALL 163 lv1_write_virtual_uart port,buffer,bytes bytes_written HVCALL 164 lv1_set_virtual_uart_param port,param,value HVCALL 165 lv1_get_virtual_uart_param port,param value HVCALL 166 lv1_configure_virtual_uart lpar_addr outlet HVCALL 170 lv1_open_device bus,dev,zero HVCALL 171 lv1_close_device bus,dev HVCALL 172 lv1_map_device_mmio_region bus,dev,bus_addr,size,page_size lpar_addr HVCALL 173 lv1_unmap_device_mmio_region bus,dev,lpar_addr HVCALL 174 lv1_allocate_device_dma_region bus,dev,io_size,io_pagesize,flag dma_region HVCALL 175 lv1_free_device_dma_region bus,dev,dma_region HVCALL 176 lv1_map_device_dma_region bus,dev,lpar_addr,dma_region,size,flags HVCALL 177 lv1_unmap_device_dma_region bus,dev,dma_region,size HVCALL 178 lv1_read_pci_config ps3bus,bus,dev,func,offset,size result HVCALL 179 lv1_write_pci_config ps3bus,bus,dev,func,offset,size,data HVCALL 185 lv1_net_add_multicast_address bus,dev,addr,flags HVCALL 186 lv1_net_remove_multicast_address bus,dev,zero,one HVCALL 187 lv1_net_start_tx_dma bus,dev,bus_addr,zero HVCALL 188 lv1_net_stop_tx_dma bus,dev,zero HVCALL 189 lv1_net_start_rx_dma bus,dev,bus_addr,zero HVCALL 190 lv1_net_stop_rx_dma bus,dev,zero HVCALL 191 lv1_net_set_interrupt_status_indicator bus,dev,irq_status_addr,zero HVCALL 193 lv1_net_set_interrupt_mask bus,dev,mask,zero HVCALL 194 lv1_net_control bus,dev,p1,p2,p3,p4 v1,v2 HVCALL 197 lv1_connect_interrupt_event_receive_port bus,dev,outlet,irq HVCALL 198 lv1_disconnect_interrupt_event_receive_port bus,dev,outlet,irq HVCALL 202 lv1_deconfigure_virtual_uart_irq HVCALL 207 lv1_enable_logical_spe spe_id,resource_id HVCALL 210 lv1_gpu_open zero HVCALL 211 lv1_gpu_close HVCALL 212 lv1_gpu_device_map dev lpar_addr,lpar_size HVCALL 213 lv1_gpu_device_unmap dev HVCALL 214 lv1_gpu_memory_allocate ddr_size,zero1,zero2,zero3,zero4 handle,ddr_lpar HVCALL 216 lv1_gpu_memory_free handle -HVCALL 217 lv1_gpu_context_allocate handle, zero chandle,lpar_dma_control,lpar_driver_info,lpar_reports,lpar_reports_size +HVCALL 217 lv1_gpu_context_allocate handle,flags chandle,lpar_dma_control,lpar_driver_info,lpar_reports,lpar_reports_size HVCALL 218 lv1_gpu_context_free chandle HVCALL 221 lv1_gpu_context_iomap changle,gpu_ioif,xdr_lpar,fbsize,ioflags HVCALL 225 lv1_gpu_context_attribute chandle,op,p1,p2,p3,p4 HVCALL 227 lv1_gpu_context_intr chandle v1 +HVCALL 228 lv1_gpu_attribute p1,p2,p3,p4,p5 HVCALL 232 lv1_get_rtc UNUSED rtc_val,timebase HVCALL 245 lv1_storage_read dev,region,sector,nsectors,flags,buf dma_tag HVCALL 246 lv1_storage_write dev,region,sector,nsectors,flags,buf dma_tag HVCALL 248 lv1_storage_send_device_command dev,cmd_id,cmd_block,cmd_size,data_buf,blocks dma_tag HVCALL 249 lv1_storage_get_async_status dev dma_tag,status HVCALL 254 lv1_storage_check_async_status dev,dma_tag status HVCALL 255 lv1_panic howto Index: head/sys/powerpc/ps3/ps3_syscons.c =================================================================== --- head/sys/powerpc/ps3/ps3_syscons.c (revision 228688) +++ head/sys/powerpc/ps3/ps3_syscons.c (revision 228689) @@ -1,757 +1,772 @@ /*- * Copyright (c) 2003 Peter Grehan * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ps3-hvcall.h" #define PS3FB_SIZE (4*1024*1024) #define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET 0x0100 #define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC 0x0101 #define L1GPU_DISPLAY_SYNC_HSYNC 1 #define L1GPU_DISPLAY_SYNC_VSYNC 2 #define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP 0x0102 extern u_char dflt_font_16[]; extern u_char dflt_font_14[]; extern u_char dflt_font_8[]; static int ps3fb_configure(int flags); void ps3fb_remap(void); static vi_probe_t ps3fb_probe; static vi_init_t ps3fb_init; static vi_get_info_t ps3fb_get_info; static vi_query_mode_t ps3fb_query_mode; static vi_set_mode_t ps3fb_set_mode; static vi_save_font_t ps3fb_save_font; static vi_load_font_t ps3fb_load_font; static vi_show_font_t ps3fb_show_font; static vi_save_palette_t ps3fb_save_palette; static vi_load_palette_t ps3fb_load_palette; static vi_set_border_t ps3fb_set_border; static vi_save_state_t ps3fb_save_state; static vi_load_state_t ps3fb_load_state; static vi_set_win_org_t ps3fb_set_win_org; static vi_read_hw_cursor_t ps3fb_read_hw_cursor; static vi_set_hw_cursor_t ps3fb_set_hw_cursor; static vi_set_hw_cursor_shape_t ps3fb_set_hw_cursor_shape; static vi_blank_display_t ps3fb_blank_display; static vi_mmap_t ps3fb_mmap; static vi_ioctl_t ps3fb_ioctl; static vi_clear_t ps3fb_clear; static vi_fill_rect_t ps3fb_fill_rect; static vi_bitblt_t ps3fb_bitblt; static vi_diag_t ps3fb_diag; static vi_save_cursor_palette_t ps3fb_save_cursor_palette; static vi_load_cursor_palette_t ps3fb_load_cursor_palette; static vi_copy_t ps3fb_copy; static vi_putp_t ps3fb_putp; static vi_putc_t ps3fb_putc; static vi_puts_t ps3fb_puts; static vi_putm_t ps3fb_putm; struct ps3fb_softc { video_adapter_t sc_va; struct cdev *sc_si; int sc_console; intptr_t sc_addr; int sc_height; int sc_width; int sc_stride; int sc_ncol; int sc_nrow; int sc_xmargin; int sc_ymargin; u_char *sc_font; int sc_font_height; + + uint64_t sc_fbhandle; + uint64_t sc_fbcontext; + uint64_t sc_dma_control; + uint64_t sc_driver_info; + uint64_t sc_reports; + uint64_t sc_reports_size; }; static video_switch_t ps3fbvidsw = { .probe = ps3fb_probe, .init = ps3fb_init, .get_info = ps3fb_get_info, .query_mode = ps3fb_query_mode, .set_mode = ps3fb_set_mode, .save_font = ps3fb_save_font, .load_font = ps3fb_load_font, .show_font = ps3fb_show_font, .save_palette = ps3fb_save_palette, .load_palette = ps3fb_load_palette, .set_border = ps3fb_set_border, .save_state = ps3fb_save_state, .load_state = ps3fb_load_state, .set_win_org = ps3fb_set_win_org, .read_hw_cursor = ps3fb_read_hw_cursor, .set_hw_cursor = ps3fb_set_hw_cursor, .set_hw_cursor_shape = ps3fb_set_hw_cursor_shape, .blank_display = ps3fb_blank_display, .mmap = ps3fb_mmap, .ioctl = ps3fb_ioctl, .clear = ps3fb_clear, .fill_rect = ps3fb_fill_rect, .bitblt = ps3fb_bitblt, .diag = ps3fb_diag, .save_cursor_palette = ps3fb_save_cursor_palette, .load_cursor_palette = ps3fb_load_cursor_palette, .copy = ps3fb_copy, .putp = ps3fb_putp, .putc = ps3fb_putc, .puts = ps3fb_puts, .putm = ps3fb_putm, }; VIDEO_DRIVER(ps3fb, ps3fbvidsw, ps3fb_configure); extern sc_rndr_sw_t txtrndrsw; RENDERER(ps3fb, 0, txtrndrsw, gfb_set); RENDERER_MODULE(ps3fb, gfb_set); /* * Define the iso6429-1983 colormap */ static struct { uint8_t red; uint8_t green; uint8_t blue; } ps3fb_cmap[16] = { /* # R G B Color */ /* - - - - ----- */ { 0x00, 0x00, 0x00 }, /* 0 0 0 0 Black */ { 0x00, 0x00, 0xaa }, /* 1 0 0 2/3 Blue */ { 0x00, 0xaa, 0x00 }, /* 2 0 2/3 0 Green */ { 0x00, 0xaa, 0xaa }, /* 3 0 2/3 2/3 Cyan */ { 0xaa, 0x00, 0x00 }, /* 4 2/3 0 0 Red */ { 0xaa, 0x00, 0xaa }, /* 5 2/3 0 2/3 Magenta */ { 0xaa, 0x55, 0x00 }, /* 6 2/3 1/3 0 Brown */ { 0xaa, 0xaa, 0xaa }, /* 7 2/3 2/3 2/3 White */ { 0x55, 0x55, 0x55 }, /* 8 1/3 1/3 1/3 Gray */ { 0x55, 0x55, 0xff }, /* 9 1/3 1/3 1 Bright Blue */ { 0x55, 0xff, 0x55 }, /* 10 1/3 1 1/3 Bright Green */ { 0x55, 0xff, 0xff }, /* 11 1/3 1 1 Bright Cyan */ { 0xff, 0x55, 0x55 }, /* 12 1 1/3 1/3 Bright Red */ { 0xff, 0x55, 0xff }, /* 13 1 1/3 1 Bright Magenta */ { 0xff, 0xff, 0x80 }, /* 14 1 1 1/3 Bright Yellow */ { 0xff, 0xff, 0xff } /* 15 1 1 1 Bright White */ }; #define TODO printf("%s: unimplemented\n", __func__) static u_int16_t ps3fb_static_window[ROW*COL]; static struct ps3fb_softc ps3fb_softc; static __inline int ps3fb_background(uint8_t attr) { return (attr >> 4); } static __inline int ps3fb_foreground(uint8_t attr) { return (attr & 0x0f); } static u_int ps3fb_pix32(int attr) { u_int retval; retval = (ps3fb_cmap[attr].red << 16) | (ps3fb_cmap[attr].green << 8) | ps3fb_cmap[attr].blue; return (retval); } static int ps3fb_configure(int flags) { struct ps3fb_softc *sc; int disable; char compatible[64]; #if 0 phandle_t root; #endif static int done = 0; disable = 0; TUNABLE_INT_FETCH("hw.syscons.disable", &disable); if (disable != 0) return (0); if (done != 0) return (0); done = 1; sc = &ps3fb_softc; #if 0 root = OF_finddevice("/"); if (OF_getprop(root, "compatible", compatible, sizeof(compatible)) <= 0) return (0); if (strncmp(compatible, "sony,ps3", sizeof(compatible)) != 0) return (0); #else TUNABLE_STR_FETCH("hw.platform", compatible, sizeof(compatible)); if (strcmp(compatible, "ps3") != 0) return (0); #endif sc->sc_console = 1; /* XXX: get from HV repository */ sc->sc_height = 480; sc->sc_width = 720; sc->sc_stride = sc->sc_width*4; /* * The loader puts the FB at 0x10000000, so use that for now. */ sc->sc_addr = 0x10000000; ps3fb_init(0, &sc->sc_va, 0); return (0); } void ps3fb_remap(void) { + struct ps3fb_softc *sc; vm_offset_t va, fb_paddr; - uint64_t fbhandle, fbcontext; + sc = &ps3fb_softc; + lv1_gpu_close(); lv1_gpu_open(0); lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET, 0,0,0,0); lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET, 0,0,1,0); lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, 0,L1GPU_DISPLAY_SYNC_VSYNC,0,0); lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, 1,L1GPU_DISPLAY_SYNC_VSYNC,0,0); - lv1_gpu_memory_allocate(PS3FB_SIZE, 0, 0, 0, 0, &fbhandle, &fb_paddr); - lv1_gpu_context_allocate(fbhandle, 0, &fbcontext); + lv1_gpu_memory_allocate(PS3FB_SIZE, 0, 0, 0, 0, &sc->sc_fbhandle, &fb_paddr); + lv1_gpu_context_allocate(sc->sc_fbhandle, 0, &sc->sc_fbcontext, &sc->sc_dma_control, + &sc->sc_driver_info, &sc->sc_reports, &sc->sc_reports_size); - lv1_gpu_context_attribute(fbcontext, + lv1_gpu_context_attribute(sc->sc_fbcontext, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0); - lv1_gpu_context_attribute(fbcontext, + lv1_gpu_context_attribute(sc->sc_fbcontext, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0); for (va = 0; va < PS3FB_SIZE; va += PAGE_SIZE) pmap_kenter_attr(0x10000000 + va, fb_paddr + va, VM_MEMATTR_WRITE_COMBINING); } static int ps3fb_probe(int unit, video_adapter_t **adp, void *arg, int flags) { TODO; return (0); } static int ps3fb_init(int unit, video_adapter_t *adp, int flags) { struct ps3fb_softc *sc; video_info_t *vi; int cxborder, cyborder; int font_height; sc = (struct ps3fb_softc *)adp; vi = &adp->va_info; vid_init_struct(adp, "ps3fb", -1, unit); /* The default font size can be overridden by loader */ font_height = 16; TUNABLE_INT_FETCH("hw.syscons.fsize", &font_height); if (font_height == 8) { sc->sc_font = dflt_font_8; sc->sc_font_height = 8; } else if (font_height == 14) { sc->sc_font = dflt_font_14; sc->sc_font_height = 14; } else { /* default is 8x16 */ sc->sc_font = dflt_font_16; sc->sc_font_height = 16; } /* The user can set a border in chars - default is 1 char width */ cxborder = 8; cyborder = 2; TUNABLE_INT_FETCH("hw.syscons.xborder", &cxborder); TUNABLE_INT_FETCH("hw.syscons.yborder", &cyborder); vi->vi_cheight = sc->sc_font_height; vi->vi_width = sc->sc_width/8 - 2*cxborder; vi->vi_height = sc->sc_height/sc->sc_font_height - 2*cyborder; vi->vi_cwidth = 8; /* * Clamp width/height to syscons maximums */ if (vi->vi_width > COL) vi->vi_width = COL; if (vi->vi_height > ROW) vi->vi_height = ROW; sc->sc_xmargin = (sc->sc_width - (vi->vi_width * vi->vi_cwidth)) / 2; sc->sc_ymargin = (sc->sc_height - (vi->vi_height * vi->vi_cheight))/2; /* * Avoid huge amounts of conditional code in syscons by * defining a dummy h/w text display buffer. */ adp->va_window = (vm_offset_t) ps3fb_static_window; /* * Enable future font-loading and flag color support, as well as * adding V_ADP_MODECHANGE so that we ps3fb_set_mode() gets called * when the X server shuts down. This enables us to get the console * back when X disappears. */ adp->va_flags |= V_ADP_FONT | V_ADP_COLOR | V_ADP_MODECHANGE; ps3fb_set_mode(&sc->sc_va, 0); vid_register(&sc->sc_va); return (0); } static int ps3fb_get_info(video_adapter_t *adp, int mode, video_info_t *info) { bcopy(&adp->va_info, info, sizeof(*info)); return (0); } static int ps3fb_query_mode(video_adapter_t *adp, video_info_t *info) { TODO; return (0); } static int ps3fb_set_mode(video_adapter_t *adp, int mode) { struct ps3fb_softc *sc; sc = (struct ps3fb_softc *)adp; /* XXX: no real mode setting at the moment */ ps3fb_blank_display(&sc->sc_va, V_DISPLAY_ON); + + lv1_gpu_context_attribute(sc->sc_fbcontext, + L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0); + lv1_gpu_context_attribute(sc->sc_fbcontext, + L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0); return (0); } static int ps3fb_save_font(video_adapter_t *adp, int page, int size, int width, u_char *data, int c, int count) { TODO; return (0); } static int ps3fb_load_font(video_adapter_t *adp, int page, int size, int width, u_char *data, int c, int count) { struct ps3fb_softc *sc; sc = (struct ps3fb_softc *)adp; /* * syscons code has already determined that current width/height * are unchanged for this new font */ sc->sc_font = data; return (0); } static int ps3fb_show_font(video_adapter_t *adp, int page) { return (0); } static int ps3fb_save_palette(video_adapter_t *adp, u_char *palette) { /* TODO; */ return (0); } static int ps3fb_load_palette(video_adapter_t *adp, u_char *palette) { /* TODO; */ return (0); } static int ps3fb_set_border(video_adapter_t *adp, int border) { /* XXX Be lazy for now and blank entire screen */ return (ps3fb_blank_display(adp, border)); } static int ps3fb_save_state(video_adapter_t *adp, void *p, size_t size) { TODO; return (0); } static int ps3fb_load_state(video_adapter_t *adp, void *p) { TODO; return (0); } static int ps3fb_set_win_org(video_adapter_t *adp, off_t offset) { TODO; return (0); } static int ps3fb_read_hw_cursor(video_adapter_t *adp, int *col, int *row) { *col = 0; *row = 0; return (0); } static int ps3fb_set_hw_cursor(video_adapter_t *adp, int col, int row) { return (0); } static int ps3fb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, int celsize, int blink) { return (0); } static int ps3fb_blank_display(video_adapter_t *adp, int mode) { struct ps3fb_softc *sc; int i; uint32_t *addr; sc = (struct ps3fb_softc *)adp; addr = (uint32_t *) sc->sc_addr; for (i = 0; i < (sc->sc_stride/4)*sc->sc_height; i++) *(addr + i) = ps3fb_pix32(ps3fb_background(SC_NORM_ATTR)); return (0); } static int ps3fb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, int prot, vm_memattr_t *memattr) { struct ps3fb_softc *sc; sc = (struct ps3fb_softc *)adp; /* * This might be a legacy VGA mem request: if so, just point it at the * framebuffer, since it shouldn't be touched */ if (offset < sc->sc_stride*sc->sc_height) { *paddr = sc->sc_addr + offset; return (0); } return (EINVAL); } static int ps3fb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data) { return (0); } static int ps3fb_clear(video_adapter_t *adp) { TODO; return (0); } static int ps3fb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) { TODO; return (0); } static int ps3fb_bitblt(video_adapter_t *adp, ...) { TODO; return (0); } static int ps3fb_diag(video_adapter_t *adp, int level) { TODO; return (0); } static int ps3fb_save_cursor_palette(video_adapter_t *adp, u_char *palette) { TODO; return (0); } static int ps3fb_load_cursor_palette(video_adapter_t *adp, u_char *palette) { TODO; return (0); } static int ps3fb_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n) { TODO; return (0); } static int ps3fb_putp(video_adapter_t *adp, vm_offset_t off, uint32_t p, uint32_t a, int size, int bpp, int bit_ltor, int byte_ltor) { TODO; return (0); } static int ps3fb_putc(video_adapter_t *adp, vm_offset_t off, uint8_t c, uint8_t a) { struct ps3fb_softc *sc; int row; int col; int i, j, k; uint32_t *addr; u_char *p; sc = (struct ps3fb_softc *)adp; row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; p = sc->sc_font + c*sc->sc_font_height; addr = (uint32_t *)sc->sc_addr + (row + sc->sc_ymargin)*(sc->sc_stride/4) + col + sc->sc_xmargin; for (i = 0; i < sc->sc_font_height; i++) { for (j = 0, k = 7; j < 8; j++, k--) { if ((p[i] & (1 << k)) == 0) *(addr + j) = ps3fb_pix32(ps3fb_background(a)); else *(addr + j) = ps3fb_pix32(ps3fb_foreground(a)); } addr += (sc->sc_stride/4); } return (0); } static int ps3fb_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len) { int i; for (i = 0; i < len; i++) { ps3fb_putc(adp, off + i, s[i] & 0xff, (s[i] & 0xff00) >> 8); } return (0); } static int ps3fb_putm(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, uint32_t pixel_mask, int size, int width) { struct ps3fb_softc *sc; int i, j, k; uint32_t fg, bg; uint32_t *addr; sc = (struct ps3fb_softc *)adp; addr = (uint32_t *)sc->sc_addr + (y + sc->sc_ymargin)*(sc->sc_stride/4) + x + sc->sc_xmargin; fg = ps3fb_pix32(ps3fb_foreground(SC_NORM_ATTR)); bg = ps3fb_pix32(ps3fb_background(SC_NORM_ATTR)); for (i = 0; i < size && i+y < sc->sc_height - 2*sc->sc_ymargin; i++) { for (j = 0, k = width; j < 8; j++, k--) { if (x + j >= sc->sc_width - 2*sc->sc_xmargin) continue; if (pixel_image[i] & (1 << k)) *(addr + j) = (*(addr + j) == fg) ? bg : fg; } addr += (sc->sc_stride/4); } return (0); } /* * Define the syscons nexus device attachment */ static void ps3fb_scidentify(driver_t *driver, device_t parent) { device_t child; /* * Add with a priority guaranteed to make it last on * the device list */ if (strcmp(installed_platform(), "ps3") == 0) child = BUS_ADD_CHILD(parent, INT_MAX, SC_DRIVER_NAME, 0); } static int ps3fb_scprobe(device_t dev) { int error; if (strcmp(installed_platform(), "ps3") != 0) return (ENXIO); device_set_desc(dev, "System console"); error = sc_probe_unit(device_get_unit(dev), device_get_flags(dev) | SC_AUTODETECT_KBD); if (error != 0) return (error); /* This is a fake device, so make sure we added it ourselves */ return (BUS_PROBE_NOWILDCARD); } static int ps3fb_scattach(device_t dev) { return (sc_attach_unit(device_get_unit(dev), device_get_flags(dev) | SC_AUTODETECT_KBD)); } static device_method_t ps3fb_sc_methods[] = { DEVMETHOD(device_identify, ps3fb_scidentify), DEVMETHOD(device_probe, ps3fb_scprobe), DEVMETHOD(device_attach, ps3fb_scattach), { 0, 0 } }; static driver_t ps3fb_sc_driver = { SC_DRIVER_NAME, ps3fb_sc_methods, sizeof(sc_softc_t), }; static devclass_t sc_devclass; DRIVER_MODULE(sc, nexus, ps3fb_sc_driver, sc_devclass, 0, 0); /* * Define a stub keyboard driver in case one hasn't been * compiled into the kernel */ #include #include static int dummy_kbd_configure(int flags); keyboard_switch_t ps3dummysw; static int dummy_kbd_configure(int flags) { return (0); } KEYBOARD_DRIVER(ps3dummy, ps3dummysw, dummy_kbd_configure);