1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Hypervisor calls
*/
#include <sys/asm_linkage.h>
#include <sys/machasi.h>
#include <sys/machparam.h>
#include <sys/hypervisor_api.h>
#if defined(lint) || defined(__lint)
/*ARGSUSED*/
uint64_t
hv_mach_exit(uint64_t exit_code)
{ return (0); }
uint64_t
hv_mach_sir(void)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_cpu_start(uint64_t cpuid, uint64_t pc, uint64_t rtba, uint64_t arg)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_cpu_stop(uint64_t cpuid)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_cpu_set_rtba(uint64_t *rtba)
{ return (0); }
/*ARGSUSED*/
int64_t
hv_cnputchar(uint8_t ch)
{ return (0); }
/*ARGSUSED*/
int64_t
hv_cngetchar(uint8_t *ch)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_tod_get(uint64_t *seconds)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_tod_set(uint64_t seconds)
{ return (0);}
/*ARGSUSED*/
uint64_t
hv_mmu_map_perm_addr(void *vaddr, int ctx, uint64_t tte, int flags)
{ return (0); }
/*ARGSUSED */
uint64_t
hv_mmu_fault_area_conf(void *raddr)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_mmu_unmap_perm_addr(void *vaddr, int ctx, int flags)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_set_ctx0(uint64_t ntsb_descriptor, uint64_t desc_ra)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_set_ctxnon0(uint64_t ntsb_descriptor, uint64_t desc_ra)
{ return (0); }
#ifdef SET_MMU_STATS
/*ARGSUSED*/
uint64_t
hv_mmu_set_stat_area(uint64_t rstatarea, uint64_t size)
{ return (0); }
#endif /* SET_MMU_STATS */
/*ARGSUSED*/
uint64_t
hv_cpu_qconf(int queue, uint64_t paddr, int size)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvio_intr_devino_to_sysino(uint64_t dev_hdl, uint32_t devino, uint64_t *sysino)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvio_intr_getvalid(uint64_t sysino, int *intr_valid_state)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvio_intr_setvalid(uint64_t sysino, int intr_valid_state)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvio_intr_getstate(uint64_t sysino, int *intr_state)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvio_intr_setstate(uint64_t sysino, int intr_state)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvio_intr_gettarget(uint64_t sysino, uint32_t *cpuid)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvio_intr_settarget(uint64_t sysino, uint32_t cpuid)
{ return (0); }
uint64_t
hv_cpu_yield(void)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_cpu_state(uint64_t cpuid, uint64_t *cpu_state)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_dump_buf_update(uint64_t paddr, uint64_t size, uint64_t *minsize)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_mem_scrub(uint64_t real_addr, uint64_t length, uint64_t *scrubbed_len)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_mem_sync(uint64_t real_addr, uint64_t length, uint64_t *flushed_len)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ttrace_buf_conf(uint64_t paddr, uint64_t size, uint64_t *size1)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ttrace_buf_info(uint64_t *paddr, uint64_t *size)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ttrace_enable(uint64_t enable, uint64_t *prev_enable)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ttrace_freeze(uint64_t freeze, uint64_t *prev_freeze)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_mach_desc(uint64_t buffer_ra, uint64_t *buffer_sizep)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ra2pa(uint64_t ra)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_hpriv(void *func, uint64_t arg1, uint64_t arg2, uint64_t arg3)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ldc_tx_qconf(uint64_t channel, uint64_t ra_base, uint64_t nentries)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ldc_tx_qinfo(uint64_t channel, uint64_t *ra_base, uint64_t *nentries)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ldc_tx_get_state(uint64_t channel,
uint64_t *headp, uint64_t *tailp, uint64_t *state)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ldc_tx_set_qtail(uint64_t channel, uint64_t tail)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ldc_rx_qconf(uint64_t channel, uint64_t ra_base, uint64_t nentries)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ldc_rx_qinfo(uint64_t channel, uint64_t *ra_base, uint64_t *nentries)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ldc_rx_get_state(uint64_t channel,
uint64_t *headp, uint64_t *tailp, uint64_t *state)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ldc_rx_set_qhead(uint64_t channel, uint64_t head)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ldc_send_msg(uint64_t channel, uint64_t msg_ra)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ldc_set_map_table(uint64_t channel, uint64_t tbl_ra, uint64_t tbl_entries)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_ldc_copy(uint64_t channel, uint64_t request, uint64_t cookie,
uint64_t raddr, uint64_t length, uint64_t *lengthp)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvldc_intr_getcookie(uint64_t dev_hdl, uint32_t devino, uint64_t *cookie)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvldc_intr_setcookie(uint64_t dev_hdl, uint32_t devino, uint64_t cookie)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvldc_intr_getvalid(uint64_t dev_hdl, uint32_t devino, int *intr_valid_state)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvldc_intr_setvalid(uint64_t dev_hdl, uint32_t devino, int intr_valid_state)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvldc_intr_getstate(uint64_t dev_hdl, uint32_t devino, int *intr_state)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvldc_intr_setstate(uint64_t dev_hdl, uint32_t devino, int intr_state)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvldc_intr_gettarget(uint64_t dev_hdl, uint32_t devino, uint32_t *cpuid)
{ return (0); }
/*ARGSUSED*/
uint64_t
hvldc_intr_settarget(uint64_t dev_hdl, uint32_t devino, uint32_t cpuid)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_api_get_version(uint64_t api_group, uint64_t *majorp, uint64_t *minorp)
{ return (0); }
/*ARGSUSED*/
uint64_t
hv_api_set_version(uint64_t api_group, uint64_t major, uint64_t minor,
uint64_t *supported_minor)
{ return (0); }
#else /* lint || __lint */
/*
* int hv_mach_exit(uint64_t exit_code)
*/
ENTRY(hv_mach_exit)
mov HV_MACH_EXIT, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_mach_exit)
/*
* uint64_t hv_mach_sir(void)
*/
ENTRY(hv_mach_sir)
mov HV_MACH_SIR, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_mach_sir)
/*
* hv_cpu_start(uint64_t cpuid, uint64_t pc, ui64_t rtba,
* uint64_t arg)
*/
ENTRY(hv_cpu_start)
mov HV_CPU_START, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_cpu_start)
/*
* hv_cpu_stop(uint64_t cpuid)
*/
ENTRY(hv_cpu_stop)
mov HV_CPU_STOP, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_cpu_stop)
/*
* hv_cpu_set_rtba(uint64_t *rtba)
*/
ENTRY(hv_cpu_set_rtba)
mov %o0, %o2
ldx [%o2], %o0
mov HV_CPU_SET_RTBA, %o5
ta FAST_TRAP
stx %o1, [%o2]
retl
nop
SET_SIZE(hv_cpu_set_rtba)
/*
* int64_t hv_cnputchar(uint8_t ch)
*/
ENTRY(hv_cnputchar)
mov CONS_PUTCHAR, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_cnputchar)
/*
* int64_t hv_cngetchar(uint8_t *ch)
*/
ENTRY(hv_cngetchar)
mov %o0, %o2
mov CONS_GETCHAR, %o5
ta FAST_TRAP
brnz,a %o0, 1f ! failure, just return error
nop
cmp %o1, H_BREAK
be 1f
mov %o1, %o0
cmp %o1, H_HUP
be 1f
mov %o1, %o0
stb %o1, [%o2] ! success, save character and return 0
mov 0, %o0
1:
retl
nop
SET_SIZE(hv_cngetchar)
ENTRY(hv_tod_get)
mov %o0, %o4
mov TOD_GET, %o5
ta FAST_TRAP
retl
stx %o1, [%o4]
SET_SIZE(hv_tod_get)
ENTRY(hv_tod_set)
mov TOD_SET, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_tod_set)
/*
* Map permanent address
* arg0 vaddr (%o0)
* arg1 context (%o1)
* arg2 tte (%o2)
* arg3 flags (%o3) 0x1=d 0x2=i
*/
ENTRY(hv_mmu_map_perm_addr)
mov MAP_PERM_ADDR, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_mmu_map_perm_addr)
/*
* hv_mmu_fault_area_conf(void *raddr)
*/
ENTRY(hv_mmu_fault_area_conf)
mov %o0, %o2
ldx [%o2], %o0
mov MMU_SET_INFOPTR, %o5
ta FAST_TRAP
stx %o1, [%o2]
retl
nop
SET_SIZE(hv_mmu_fault_area_conf)
/*
* Unmap permanent address
* arg0 vaddr (%o0)
* arg1 context (%o1)
* arg2 flags (%o2) 0x1=d 0x2=i
*/
ENTRY(hv_mmu_unmap_perm_addr)
mov UNMAP_PERM_ADDR, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_mmu_unmap_perm_addr)
/*
* Set TSB for context 0
* arg0 ntsb_descriptor (%o0)
* arg1 desc_ra (%o1)
*/
ENTRY(hv_set_ctx0)
mov MMU_TSB_CTX0, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_set_ctx0)
/*
* Set TSB for context non0
* arg0 ntsb_descriptor (%o0)
* arg1 desc_ra (%o1)
*/
ENTRY(hv_set_ctxnon0)
mov MMU_TSB_CTXNON0, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_set_ctxnon0)
#ifdef SET_MMU_STATS
/*
* Returns old stat area on success
*/
ENTRY(hv_mmu_set_stat_area)
mov MMU_STAT_AREA, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_mmu_set_stat_area)
#endif /* SET_MMU_STATS */
/*
* CPU Q Configure
* arg0 queue (%o0)
* arg1 Base address RA (%o1)
* arg2 Size (%o2)
*/
ENTRY(hv_cpu_qconf)
mov HV_CPU_QCONF, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_cpu_qconf)
/*
* arg0 - devhandle
* arg1 - devino
*
* ret0 - status
* ret1 - sysino
*/
ENTRY(hvio_intr_devino_to_sysino)
mov HVIO_INTR_DEVINO2SYSINO, %o5
ta FAST_TRAP
brz,a %o0, 1f
stx %o1, [%o2]
1: retl
nop
SET_SIZE(hvio_intr_devino_to_sysino)
/*
* arg0 - sysino
*
* ret0 - status
* ret1 - intr_valid_state
*/
ENTRY(hvio_intr_getvalid)
mov %o1, %o2
mov HVIO_INTR_GETVALID, %o5
ta FAST_TRAP
brz,a %o0, 1f
stuw %o1, [%o2]
1: retl
nop
SET_SIZE(hvio_intr_getvalid)
/*
* arg0 - sysino
* arg1 - intr_valid_state
*
* ret0 - status
*/
ENTRY(hvio_intr_setvalid)
mov HVIO_INTR_SETVALID, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hvio_intr_setvalid)
/*
* arg0 - sysino
*
* ret0 - status
* ret1 - intr_state
*/
ENTRY(hvio_intr_getstate)
mov %o1, %o2
mov HVIO_INTR_GETSTATE, %o5
ta FAST_TRAP
brz,a %o0, 1f
stuw %o1, [%o2]
1: retl
nop
SET_SIZE(hvio_intr_getstate)
/*
* arg0 - sysino
* arg1 - intr_state
*
* ret0 - status
*/
ENTRY(hvio_intr_setstate)
mov HVIO_INTR_SETSTATE, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hvio_intr_setstate)
/*
* arg0 - sysino
*
* ret0 - status
* ret1 - cpu_id
*/
ENTRY(hvio_intr_gettarget)
mov %o1, %o2
mov HVIO_INTR_GETTARGET, %o5
ta FAST_TRAP
brz,a %o0, 1f
stuw %o1, [%o2]
1: retl
nop
SET_SIZE(hvio_intr_gettarget)
/*
* arg0 - sysino
* arg1 - cpu_id
*
* ret0 - status
*/
ENTRY(hvio_intr_settarget)
mov HVIO_INTR_SETTARGET, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hvio_intr_settarget)
/*
* hv_cpu_yield(void)
*/
ENTRY(hv_cpu_yield)
mov HV_CPU_YIELD, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_cpu_yield)
/*
* int hv_cpu_state(uint64_t cpuid, uint64_t *cpu_state);
*/
ENTRY(hv_cpu_state)
mov %o1, %o4 ! save datap
mov HV_CPU_STATE, %o5
ta FAST_TRAP
brz,a %o0, 1f
stx %o1, [%o4]
1:
retl
nop
SET_SIZE(hv_cpu_state)
/*
* HV state dump zone Configure
* arg0 real adrs of dump buffer (%o0)
* arg1 size of dump buffer (%o1)
* ret0 status (%o0)
* ret1 size of buffer on success and min size on EINVAL (%o1)
* hv_dump_buf_update(uint64_t paddr, uint64_t size, uint64_t *ret_size)
*/
ENTRY(hv_dump_buf_update)
mov DUMP_BUF_UPDATE, %o5
ta FAST_TRAP
retl
stx %o1, [%o2]
SET_SIZE(hv_dump_buf_update)
/*
* For memory scrub
* int hv_mem_scrub(uint64_t real_addr, uint64_t length,
* uint64_t *scrubbed_len);
* Retun %o0 -- status
* %o1 -- bytes scrubbed
*/
ENTRY(hv_mem_scrub)
mov %o2, %o4
mov HV_MEM_SCRUB, %o5
ta FAST_TRAP
retl
stx %o1, [%o4]
SET_SIZE(hv_mem_scrub)
/*
* Flush ecache
* int hv_mem_sync(uint64_t real_addr, uint64_t length,
* uint64_t *flushed_len);
* Retun %o0 -- status
* %o1 -- bytes flushed
*/
ENTRY(hv_mem_sync)
mov %o2, %o4
mov HV_MEM_SYNC, %o5
ta FAST_TRAP
retl
stx %o1, [%o4]
SET_SIZE(hv_mem_sync)
/*
* TTRACE_BUF_CONF Configure
* arg0 RA base of buffer (%o0)
* arg1 buf size in no. of entries (%o1)
* ret0 status (%o0)
* ret1 minimum size in no. of entries on failure,
* actual size in no. of entries on success (%o1)
*/
ENTRY(hv_ttrace_buf_conf)
mov TTRACE_BUF_CONF, %o5
ta FAST_TRAP
retl
stx %o1, [%o2]
SET_SIZE(hv_ttrace_buf_conf)
/*
* TTRACE_BUF_INFO
* ret0 status (%o0)
* ret1 RA base of buffer (%o1)
* ret2 size in no. of entries (%o2)
*/
ENTRY(hv_ttrace_buf_info)
mov %o0, %o3
mov %o1, %o4
mov TTRACE_BUF_INFO, %o5
ta FAST_TRAP
stx %o1, [%o3]
retl
stx %o2, [%o4]
SET_SIZE(hv_ttrace_buf_info)
/*
* TTRACE_ENABLE
* arg0 enable/ disable (%o0)
* ret0 status (%o0)
* ret1 previous enable state (%o1)
*/
ENTRY(hv_ttrace_enable)
mov %o1, %o2
mov TTRACE_ENABLE, %o5
ta FAST_TRAP
retl
stx %o1, [%o2]
SET_SIZE(hv_ttrace_enable)
/*
* TTRACE_FREEZE
* arg0 enable/ freeze (%o0)
* ret0 status (%o0)
* ret1 previous freeze state (%o1)
*/
ENTRY(hv_ttrace_freeze)
mov %o1, %o2
mov TTRACE_FREEZE, %o5
ta FAST_TRAP
retl
stx %o1, [%o2]
SET_SIZE(hv_ttrace_freeze)
/*
* MACH_DESC
* arg0 buffer real address
* arg1 pointer to uint64_t for size of buffer
* ret0 status
* ret1 return required size of buffer / returned data size
*/
ENTRY(hv_mach_desc)
mov %o1, %o4 ! save datap
ldx [%o1], %o1
mov HV_MACH_DESC, %o5
ta FAST_TRAP
retl
stx %o1, [%o4]
SET_SIZE(hv_mach_desc)
/*
* hv_ra2pa(uint64_t ra)
*
* MACH_DESC
* arg0 Real address to convert
* ret0 Returned physical address or -1 on error
*/
ENTRY(hv_ra2pa)
mov HV_RA2PA, %o5
ta FAST_TRAP
cmp %o0, 0
move %xcc, %o1, %o0
movne %xcc, -1, %o0
retl
nop
SET_SIZE(hv_ra2pa)
/*
* hv_hpriv(void *func, uint64_t arg1, uint64_t arg2, uint64_t arg3)
*
* MACH_DESC
* arg0 OS function to call
* arg1 First arg to OS function
* arg2 Second arg to OS function
* arg3 Third arg to OS function
* ret0 Returned value from function
*/
ENTRY(hv_hpriv)
mov HV_HPRIV, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_hpriv)
/*
* hv_ldc_tx_qconf(uint64_t channel, uint64_t ra_base,
* uint64_t nentries);
*/
ENTRY(hv_ldc_tx_qconf)
mov LDC_TX_QCONF, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_ldc_tx_qconf)
/*
* hv_ldc_tx_qinfo(uint64_t channel, uint64_t *ra_base,
* uint64_t *nentries);
*/
ENTRY(hv_ldc_tx_qinfo)
mov %o1, %g1
mov %o2, %g2
mov LDC_TX_QINFO, %o5
ta FAST_TRAP
stx %o1, [%g1]
retl
stx %o2, [%g2]
SET_SIZE(hv_ldc_tx_qinfo)
/*
* hv_ldc_tx_get_state(uint64_t channel,
* uint64_t *headp, uint64_t *tailp, uint64_t *state);
*/
ENTRY(hv_ldc_tx_get_state)
mov LDC_TX_GET_STATE, %o5
mov %o1, %g1
mov %o2, %g2
mov %o3, %g3
ta FAST_TRAP
stx %o1, [%g1]
stx %o2, [%g2]
retl
stx %o3, [%g3]
SET_SIZE(hv_ldc_tx_get_state)
/*
* hv_ldc_tx_set_qtail(uint64_t channel, uint64_t tail)
*/
ENTRY(hv_ldc_tx_set_qtail)
mov LDC_TX_SET_QTAIL, %o5
ta FAST_TRAP
retl
SET_SIZE(hv_ldc_tx_set_qtail)
/*
* hv_ldc_rx_qconf(uint64_t channel, uint64_t ra_base,
* uint64_t nentries);
*/
ENTRY(hv_ldc_rx_qconf)
mov LDC_RX_QCONF, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_ldc_rx_qconf)
/*
* hv_ldc_rx_qinfo(uint64_t channel, uint64_t *ra_base,
* uint64_t *nentries);
*/
ENTRY(hv_ldc_rx_qinfo)
mov %o1, %g1
mov %o2, %g2
mov LDC_RX_QINFO, %o5
ta FAST_TRAP
stx %o1, [%g1]
retl
stx %o2, [%g2]
SET_SIZE(hv_ldc_rx_qinfo)
/*
* hv_ldc_rx_get_state(uint64_t channel,
* uint64_t *headp, uint64_t *tailp, uint64_t *state);
*/
ENTRY(hv_ldc_rx_get_state)
mov LDC_RX_GET_STATE, %o5
mov %o1, %g1
mov %o2, %g2
mov %o3, %g3
ta FAST_TRAP
stx %o1, [%g1]
stx %o2, [%g2]
retl
stx %o3, [%g3]
SET_SIZE(hv_ldc_rx_get_state)
/*
* hv_ldc_rx_set_qhead(uint64_t channel, uint64_t head)
*/
ENTRY(hv_ldc_rx_set_qhead)
mov LDC_RX_SET_QHEAD, %o5
ta FAST_TRAP
retl
SET_SIZE(hv_ldc_rx_set_qhead)
/*
* hv_ldc_set_map_table(uint64_t channel, uint64_t tbl_ra,
* uint64_t tbl_entries)
*/
ENTRY(hv_ldc_set_map_table)
mov LDC_SET_MAP_TABLE, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_ldc_set_map_table)
/*
* hv_ldc_get_map_table(uint64_t channel, uint64_t *tbl_ra,
* uint64_t *tbl_entries)
*/
ENTRY(hv_ldc_get_map_table)
mov %o1, %g1
mov %o2, %g2
mov LDC_GET_MAP_TABLE, %o5
ta FAST_TRAP
stx %o1, [%g1]
retl
stx %o2, [%g2]
SET_SIZE(hv_ldc_get_map_table)
/*
* hv_ldc_copy(uint64_t channel, uint64_t request, uint64_t cookie,
* uint64_t raddr, uint64_t length, uint64_t *lengthp);
*/
ENTRY(hv_ldc_copy)
mov %o5, %g1
mov LDC_COPY, %o5
ta FAST_TRAP
retl
stx %o1, [%g1]
SET_SIZE(hv_ldc_copy)
/*
* hv_ldc_mapin(uint64_t channel, uint64_t cookie, uint64_t *raddr,
* uint64_t *perm)
*/
ENTRY(hv_ldc_mapin)
mov %o2, %g1
mov %o3, %g2
mov LDC_MAPIN, %o5
ta FAST_TRAP
stx %o1, [%g1]
retl
stx %o2, [%g2]
SET_SIZE(hv_ldc_mapin)
/*
* hv_ldc_unmap(uint64_t raddr)
*/
ENTRY(hv_ldc_unmap)
mov LDC_UNMAP, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_ldc_unmap)
/*
* hv_ldc_revoke(uint64_t raddr)
*/
ENTRY(hv_ldc_revoke)
mov LDC_REVOKE, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hv_ldc_revoke)
/*
* hvldc_intr_getcookie(uint64_t dev_hdl, uint32_t devino,
* uint64_t *cookie);
*/
ENTRY(hvldc_intr_getcookie)
mov %o2, %g1
mov VINTR_GET_COOKIE, %o5
ta FAST_TRAP
retl
stx %o1, [%g1]
SET_SIZE(hvldc_intr_getcookie)
/*
* hvldc_intr_setcookie(uint64_t dev_hdl, uint32_t devino,
* uint64_t cookie);
*/
ENTRY(hvldc_intr_setcookie)
mov VINTR_SET_COOKIE, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hvldc_intr_setcookie)
/*
* hvldc_intr_getvalid(uint64_t dev_hdl, uint32_t devino,
* int *intr_valid_state);
*/
ENTRY(hvldc_intr_getvalid)
mov %o2, %g1
mov VINTR_GET_VALID, %o5
ta FAST_TRAP
retl
stuw %o1, [%g1]
SET_SIZE(hvldc_intr_getvalid)
/*
* hvldc_intr_setvalid(uint64_t dev_hdl, uint32_t devino,
* int intr_valid_state);
*/
ENTRY(hvldc_intr_setvalid)
mov VINTR_SET_VALID, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hvldc_intr_setvalid)
/*
* hvldc_intr_getstate(uint64_t dev_hdl, uint32_t devino,
* int *intr_state);
*/
ENTRY(hvldc_intr_getstate)
mov %o2, %g1
mov VINTR_GET_STATE, %o5
ta FAST_TRAP
retl
stuw %o1, [%g1]
SET_SIZE(hvldc_intr_getstate)
/*
* hvldc_intr_setstate(uint64_t dev_hdl, uint32_t devino,
* int intr_state);
*/
ENTRY(hvldc_intr_setstate)
mov VINTR_SET_STATE, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hvldc_intr_setstate)
/*
* hvldc_intr_gettarget(uint64_t dev_hdl, uint32_t devino,
* uint32_t *cpuid);
*/
ENTRY(hvldc_intr_gettarget)
mov %o2, %g1
mov VINTR_GET_TARGET, %o5
ta FAST_TRAP
retl
stuw %o1, [%g1]
SET_SIZE(hvldc_intr_gettarget)
/*
* hvldc_intr_settarget(uint64_t dev_hdl, uint32_t devino,
* uint32_t cpuid);
*/
ENTRY(hvldc_intr_settarget)
mov VINTR_SET_TARGET, %o5
ta FAST_TRAP
retl
nop
SET_SIZE(hvldc_intr_settarget)
/*
* hv_api_get_version(uint64_t api_group, uint64_t *majorp,
* uint64_t *minorp)
*
* API_GET_VERSION
* arg0 API group
* ret0 status
* ret1 major number
* ret2 minor number
*/
ENTRY(hv_api_get_version)
mov %o1, %o3
mov %o2, %o4
mov API_GET_VERSION, %o5
ta CORE_TRAP
stx %o1, [%o3]
retl
stx %o2, [%o4]
SET_SIZE(hv_api_get_version)
/*
* hv_api_set_version(uint64_t api_group, uint64_t major,
* uint64_t minor, uint64_t *supported_minor)
*
* API_SET_VERSION
* arg0 API group
* arg1 major number
* arg2 requested minor number
* ret0 status
* ret1 actual minor number
*/
ENTRY(hv_api_set_version)
mov %o3, %o4
mov API_SET_VERSION, %o5
ta CORE_TRAP
retl
stx %o1, [%o4]
SET_SIZE(hv_api_set_version)
#endif /* lint || __lint */
|