1/* 2 * Playstation 3 LV1 hypercall interface 3 * 4 * $FreeBSD$ 5 */ 6 7#include <sys/types.h> 8 9enum lpar_id { 10 PS3_LPAR_ID_CURRENT = 0x00, 11 PS3_LPAR_ID_PME = 0x01, 12}; 13 14static inline uint64_t 15lv1_repository_string(const char *str) 16{ 17 uint64_t ret = 0; 18 strncpy((char *)&ret, str, sizeof(ret)); 19 return (ret); 20} 21 22# Code Name Inputs Outputs 23HVCALL 0 lv1_allocate_memory size,log_page_size,zero,flags base_addr,muid 24HVCALL 1 lv1_write_htab_entry vas_id,slot,pte_hi,pte_lo 25HVCALL 2 lv1_construct_virtual_address_space log_pteg_count,n_sizes,page_sizes vas_id,hv_pteg_count 26HVCALL 4 lv1_get_virtual_address_space_id_of_ppe ppe_id vas_id 27HVCALL 6 lv1_query_logical_partition_address_region_info lpar_id base_addr,size,access_right,max_page_size,flags 28HVCALL 7 lv1_select_virtual_address_space vas_id 29HVCALL 9 lv1_pause mode 30HVCALL 10 lv1_destruct_virtual_address_space vas_id 31HVCALL 11 lv1_configure_irq_state_bitmap ppe_id,cpu_id,bitmap_addr 32HVCALL 12 lv1_connect_irq_plug_ext ppe_id,cpu_id,virq,outlet,zero 33HVCALL 13 lv1_release_memory base_addr 34HVCALL 15 lv1_put_iopte ioas_id,ioif_addr,lpar_addr,io_id,flags 35HVCALL 17 lv1_disconnect_irq_plug_ext ppe_id,cpu_id,virq 36HVCALL 18 lv1_construct_event_receive_port UNUSED outlet 37HVCALL 19 lv1_destruct_event_receive_port outlet 38HVCALL 24 lv1_send_event_locally outlet 39HVCALL 27 lv1_end_of_interrupt irq 40HVCALL 28 lv1_connect_irq_plug virq,irq 41HVCALL 29 lv1_disconnect_irq_plus virq 42HVCALL 30 lv1_end_of_interrupt_ext ppe_id,cpu_id,virq 43HVCALL 31 lv1_did_update_interrupt_mask ppe_id,cpu_id 44HVCALL 44 lv1_shutdown_logical_partition cmd 45HVCALL 54 lv1_destruct_logical_spe spe_id 46HVCALL 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 47HVCALL 61 lv1_set_spe_interrupt_mask spe_id,class,mask 48HVCALL 65 lv1_disable_logical_spe spe_id,zero 49HVCALL 66 lv1_clear_spe_interrupt_status spe_id,class,stat,zero 50HVCALL 67 lv1_get_spe_interrupt_status spe_id,class stat 51HVCALL 69 lv1_get_logical_ppe_id UNUSED ppe_id 52HVCALL 74 lv1_get_logical_partition_id UNUSED lpar_id 53HVCALL 78 lv1_get_spe_irq_outlet spe_id,class outlet 54HVCALL 79 lv1_set_spe_privilege_state_area_1_register spe_id,offset,value 55HVCALL 91 lv1_get_repository_node_value lpar_id,n1,n2,n3,n4 v1,v2 56HVCALL 95 lv1_read_htab_entries vas_id,slot hi1,hi2,hi3,hi4,rcbits 57HVCALL 96 lv1_set_dabr dabr,flags 58HVCALL 116 lv1_allocate_io_segment ioas_id,seg_size,io_pagesize ioif_addr 59HVCALL 117 lv1_release_io_segment ioas_id,ioif_addr 60HVCALL 120 lv1_construct_io_irq_outlet interrupt_id outlet 61HVCALL 121 lv1_destruct_io_irq_outlet outlet 62HVCALL 122 lv1_map_htab lpar_id htab_addr 63HVCALL 123 lv1_unmap_htab htab_addr 64HVCALL 127 lv1_get_version_info UNUSED firm_vers 65HVCALL 158 lv1_insert_htab_entry vas_id,pteg,pte_hi,pte_lo,lockflags,flags index,evicted_hi,evicted_lo 66HVCALL 162 lv1_read_virtual_uart port,buffer,bytes bytes_read 67HVCALL 163 lv1_write_virtual_uart port,buffer,bytes bytes_written 68HVCALL 164 lv1_set_virtual_uart_param port,param,value 69HVCALL 165 lv1_get_virtual_uart_param port,param value 70HVCALL 166 lv1_configure_virtual_uart lpar_addr outlet 71HVCALL 170 lv1_open_device bus,dev,zero 72HVCALL 171 lv1_close_device bus,dev 73HVCALL 172 lv1_map_device_mmio_region bus,dev,bus_addr,size,page_size lpar_addr 74HVCALL 173 lv1_unmap_device_mmio_region bus,dev,lpar_addr 75HVCALL 174 lv1_allocate_device_dma_region bus,dev,io_size,io_pagesize,flag dma_region 76HVCALL 175 lv1_free_device_dma_region bus,dev,dma_region 77HVCALL 176 lv1_map_device_dma_region bus,dev,lpar_addr,dma_region,size,flags 78HVCALL 177 lv1_unmap_device_dma_region bus,dev,dma_region,size 79HVCALL 178 lv1_read_pci_config ps3bus,bus,dev,func,offset,size result 80HVCALL 179 lv1_write_pci_config ps3bus,bus,dev,func,offset,size,data 81HVCALL 185 lv1_net_add_multicast_address bus,dev,addr,flags 82HVCALL 186 lv1_net_remove_multicast_address bus,dev,zero,one 83HVCALL 187 lv1_net_start_tx_dma bus,dev,bus_addr,zero 84HVCALL 188 lv1_net_stop_tx_dma bus,dev,zero 85HVCALL 189 lv1_net_start_rx_dma bus,dev,bus_addr,zero 86HVCALL 190 lv1_net_stop_rx_dma bus,dev,zero 87HVCALL 191 lv1_net_set_interrupt_status_indicator bus,dev,irq_status_addr,zero 88HVCALL 193 lv1_net_set_interrupt_mask bus,dev,mask,zero 89HVCALL 194 lv1_net_control bus,dev,p1,p2,p3,p4 v1,v2 90HVCALL 197 lv1_connect_interrupt_event_receive_port bus,dev,outlet,irq 91HVCALL 198 lv1_disconnect_interrupt_event_receive_port bus,dev,outlet,irq 92HVCALL 202 lv1_deconfigure_virtual_uart_irq 93HVCALL 207 lv1_enable_logical_spe spe_id,resource_id 94HVCALL 210 lv1_gpu_open zero 95HVCALL 211 lv1_gpu_close 96HVCALL 212 lv1_gpu_device_map dev lpar_addr,lpar_size 97HVCALL 213 lv1_gpu_device_unmap dev 98HVCALL 214 lv1_gpu_memory_allocate ddr_size,zero1,zero2,zero3,zero4 handle,ddr_lpar 99HVCALL 216 lv1_gpu_memory_free handle 100HVCALL 217 lv1_gpu_context_allocate handle, zero chandle,lpar_dma_control,lpar_driver_info,lpar_reports,lpar_reports_size 101HVCALL 218 lv1_gpu_context_free chandle 102HVCALL 221 lv1_gpu_context_iomap changle,gpu_ioif,xdr_lpar,fbsize,ioflags 103HVCALL 225 lv1_gpu_context_attribute chandle,op,p1,p2,p3,p4 104HVCALL 227 lv1_gpu_context_intr chandle v1 105HVCALL 232 lv1_get_rtc UNUSED rtc_val,timebase 106HVCALL 245 lv1_storage_read dev,region,sector,nsectors,flags,buf dma_tag 107HVCALL 246 lv1_storage_write dev,region,sector,nsectors,flags,buf dma_tag 108HVCALL 248 lv1_storage_send_device_command dev,cmd_id,cmd_block,cmd_size,data_buf,blocks dma_tag 109HVCALL 249 lv1_storage_get_async_status dev dma_tag,status 110HVCALL 254 lv1_storage_check_async_status dev,dma_tag status 111HVCALL 255 lv1_panic howto 112