@@ -86,15 +86,15 @@ static int get_vcpu_px_data(struct vmctx *ctx, int vcpu_id,
86
86
/* _PPC: Performance Present Capabilities
87
87
* hard code _PPC to 0, all states are available.
88
88
*/
89
- void dsdt_write_ppc (void )
89
+ static void dsdt_write_ppc (void )
90
90
{
91
91
dsdt_line (" Name (_PPC, Zero)" );
92
92
}
93
93
94
94
/* _PCT: Performance Control
95
95
* Both Performance Control and Status Register are set to FFixedHW
96
96
*/
97
- void dsdt_write_pct (void )
97
+ static void dsdt_write_pct (void )
98
98
{
99
99
dsdt_line (" Method (_PCT, 0, NotSerialized)" );
100
100
dsdt_line (" {" );
@@ -124,7 +124,7 @@ void dsdt_write_pct(void)
124
124
125
125
/* _PSS: Performance Supported States
126
126
*/
127
- void dsdt_write_pss (struct vmctx * ctx , int vcpu_id )
127
+ static void dsdt_write_pss (struct vmctx * ctx , int vcpu_id )
128
128
{
129
129
uint8_t vcpu_px_cnt ;
130
130
struct cpu_px_data * vcpu_px_data ;
@@ -183,3 +183,45 @@ void dsdt_write_pss(struct vmctx *ctx, int vcpu_id)
183
183
free (vcpu_px_data );
184
184
185
185
}
186
+
187
+ void pm_write_dsdt (struct vmctx * ctx , int ncpu )
188
+ {
189
+ /* Scope (_PR) */
190
+ dsdt_line ("" );
191
+ dsdt_line (" Scope (_PR)" );
192
+ dsdt_line (" {" );
193
+ for (int i = 0 ; i < ncpu ; i ++ ) {
194
+ dsdt_line (" Processor (CPU%d, 0x%02X, 0x00000000, 0x00) {}" ,
195
+ i , i );
196
+ }
197
+ dsdt_line (" }" );
198
+ dsdt_line ("" );
199
+
200
+ /* Scope (_PR.CPU(N)) */
201
+ for (int i = 0 ; i < ncpu ; i ++ ) {
202
+ dsdt_line (" Scope (_PR.CPU%d)" , i );
203
+ dsdt_line (" {" );
204
+ dsdt_line ("" );
205
+
206
+ dsdt_write_pss (ctx , i );
207
+
208
+ /* hard code _PPC and _PCT for all vpu */
209
+ if (i == 0 ) {
210
+ dsdt_write_ppc ();
211
+ dsdt_write_pct ();
212
+ } else {
213
+ dsdt_line (" Method (_PPC, 0, NotSerialized)" );
214
+ dsdt_line (" {" );
215
+ dsdt_line (" Return (^^CPU0._PPC)" );
216
+ dsdt_line (" }" );
217
+ dsdt_line ("" );
218
+ dsdt_line (" Method (_PCT, 0, NotSerialized)" );
219
+ dsdt_line (" {" );
220
+ dsdt_line (" Return (^^CPU0._PCT)" );
221
+ dsdt_line (" }" );
222
+ dsdt_line ("" );
223
+ }
224
+
225
+ dsdt_line (" }" );
226
+ }
227
+ }
0 commit comments