summaryrefslogtreecommitdiff
path: root/ReferenceCode/AcpiTables/Dsdt/THERMAL.ASL
blob: f38392fb3cc1165a33513fa76e341b1f8d4ed094 (plain)
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
/**************************************************************************;
;*                                                                        *;
;*    Intel Confidential                                                  *;
;*                                                                        *;
;*    Intel Corporation - ACPI Reference Code for the Haswell             *;
;*    Family of Customer Reference Boards.                                *;
;*                                                                        *;
;*                                                                        *;
;*    Copyright (c)  1999 - 2013 Intel Corporation. All rights reserved   *;
;*    This software and associated documentation (if any) is furnished    *;
;*    under a license and may only be used or copied in accordance        *;
;*    with the terms of the license. Except as permitted by such          *;
;*    license, no part of this software or documentation may be           *;
;*    reproduced, stored in a retrieval system, or transmitted in any     *;
;*    form or by any means without the express written consent of         *;
;*    Intel Corporation.                                                  *;
;*                                                                        *;
;*                                                                        *;
;**************************************************************************/
/*++
  This file contains a 'Sample Driver' and is licensed as such  
  under the terms of your license agreement with Intel or your  
  vendor.  This file may be modified by the user, subject to    
  the additional terms of the license agreement                 
--*/
External(\_PR.APSV)
External(\_PR.ACRT)
External(\_PR.AAC0)

// THERMAL.ASL represents a Thermal Zone to be used for testing on the
// Customer Reference Boards.
Scope(\_TZ)
{

  // Notes:
  //  1) WIN2K strictly uses interrupt driven thermal events.
  //  2) Temperature values are stored in tenths of Kelvin to
  //    eliminate the decimal place.
  //  3) Kelvin = Celsius + 273.2.
  //  4) All temperature must be >= 289K.

  Name(ETMD, 1)

  // Temprature Threshold in Celsius, used to guard against hardware returning bad temprature readings
  Name(THLD, 120) 

  //
  // YBTx --  _ACx Thermal Trip Points for YellowBluff platform
  //
  // Matrix of Thermal Trip points & Fan Control (YellowBluff Platform)
  //        T('C)   PWM Duty Cycle
  Name(YBT4, 55)     //  35
  Name(YBT3, 64)     //  55
  Name(YBT2, 73)     //  75
  Name(YBT1, 80)     //  90
  Name(YBT0, 91)     // 100

  // Fan 0 = Package Processor Fan - Maximum speed
  PowerResource(FN00, 0, 0)
  {
    Method(_STA, 0, Serialized)
    { 
        // Return Virtual Fan 0 status.
        Return(VFN0)
    }

    // This method is called when the temprature goes above _AC0.
    // Regardless of other FAN states, set to ACF0 since this is max cooling state: temp > _AC0
    Method(_ON, 0, Serialized)
    {
        // Set Virtual Fan 0 On.
        Store(1,VFN0)

        // If EC access is enabled.
        If(LAnd(ECON, ETMD))
        {
            \_SB.PCI0.LPCB.H_EC.ECWT(AC0F, RefOf(\_SB.PCI0.LPCB.H_EC.PENV))
            \_SB.PCI0.LPCB.H_EC.ECMD(0x1a)
        }
    }

    // This method is called when the temprature goes below _AC0.
    // If FAN1 is on, use its value (AC1F): _AC0 > temp > _AC1
	// If FAN1 is off, use FAN2 value (AC2F): _AC0 > _AC1 > temp 
    Method(_OFF, 0, Serialized)
    {
        // Set Virtual Fan 0 Off.
        Store(0,VFN0)

        // If EC access is enabled.
        If(LAnd(ECON, ETMD))
        {
            If(LNotEqual(VFN1,0))
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(AC1F, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC1F
            } 
            Else
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(0, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC2F = 0
            }
            \_SB.PCI0.LPCB.H_EC.ECMD(0x1a)
        }
    }
  }

  // Associate Virtual Fan 0 Power Resource with the FAN0 Device.
  Device(FAN0)
  {
    Name(_HID, EISAID("PNP0C0B"))
    Name(_UID, 0)
    Name(_PR0, Package(1){FN00})
#if defined(ASL_CRB_EC_SUPPORT) && (ASL_CRB_EC_SUPPORT == 1)
    Method(_DEP) // Fan method depends on EC Wrapper Op Region to be available
    {
      Return(Package() {\_SB.PCI0.LPCB.H_EC})
    }
#endif
  }

  // Fan 1 = Package Processor Fan.
  PowerResource(FN01,0,0)
  {
    Method(_STA,0,Serialized)
    { 
        // Return Virtual Fan 1 status.
        Return(VFN1)
    }

    // This method is called when the temprature goes above _AC1.
    // If FAN0 is on, do nothing since we're already at AC0F: temp > _AC0 > _AC1
    // If FAN0 is off, use FAN1 value (AC1F): _AC0 > temp > _AC1
    Method(_ON,0,Serialized)
    {
        // Set Virtual Fan 1 On.
        Store(1,VFN1)

        // If EC access is enabled.
        If(LAnd(ECON, ETMD))
        {
            If(LEqual(VFN0,0))
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(AC1F, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC1F
                \_SB.PCI0.LPCB.H_EC.ECMD(0x1a)
            }
        }
    }

    // This method is called when the temprature goes below _AC1.
    // If FAN2 is on, use its value (AC2F): _AC1 > temp > _AC2
	// If FAN2 is off, use FAN3 value (AC3F): _AC1 > _AC2 > temp 
    Method(_OFF,0,Serialized)
    {
        // Set Virtual Fan 1 Off.
        Store(0,VFN1)

        // If EC access is enabled.
        If(LAnd(ECON, ETMD))
        {
            If(LNotEqual(VFN2,0))
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(0, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC2F = 0
            } 
            Else
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(0, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC3F = 0
            }
            \_SB.PCI0.LPCB.H_EC.ECMD(0x1a)
        }
    }
  }

  // Associate Virtual Fan 1 Power Resource with the FAN1 Device.
  Device(FAN1)
  {
    Name(_HID, EISAID("PNP0C0B"))
    Name(_UID, 1)
    Name(_PR0, Package(1){FN01})
#if defined(ASL_CRB_EC_SUPPORT) && (ASL_CRB_EC_SUPPORT == 1)
    Method(_DEP) // Fan method depends on EC Wrapper Op Region to be available
    {
      Return(Package() {\_SB.PCI0.LPCB.H_EC})
    }
#endif
  }


  // Fan 2 = Package Processor Fan.
  PowerResource(FN02,0,0)
  {
    Method(_STA,0,Serialized)
    { 
        // Return Virtual Fan 2 status.
        Return(VFN2)
    }

    // This method is called when the temprature goes above _AC2.
    // If FAN1 is on, do nothing since we're already at AC1F or greater: temp > _AC1 > _AC2
	// If FAN1 is off, use FAN2 value (AC2F): _AC1 > temp > _AC2
    Method(_ON,0,Serialized)
    {
        // Set Virtual Fan 2 On.
        Store(1,VFN2)

        // If EC access is enabled.
        If(LAnd(ECON, ETMD))
        {
            If(LEqual(VFN1,0))
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(0, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC2F = 0
                \_SB.PCI0.LPCB.H_EC.ECMD(0x1a)
            }
        }
    }

    // This method is called when the temprature goes below _AC2.
    // If FAN3 is on, use its value (AC3F): _AC2 > temp > _AC3
	// If FAN3 is off, use FAN4 value (AC4F): _AC2 > _AC3 > temp 
    Method(_OFF,0,Serialized)
    {
        // Set Virtual Fan 2 Off.
        Store(0,VFN2)

        // If EC access is enabled.
        If(LAnd(ECON, ETMD))
        {
            If(LNotEqual(VFN3,0))
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(0, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC3F = 0
            } 
            Else
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(0, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC4F = 0
            }
            \_SB.PCI0.LPCB.H_EC.ECMD(0x1a)
        }
    }
  }

  // Associate Virtual Fan 2 Power Resource with the FAN0 Device.
  Device(FAN2)
  {
    Name(_HID, EISAID("PNP0C0B"))
    Name(_UID, 2)
    Name(_PR0, Package(1){FN02})
#if defined(ASL_CRB_EC_SUPPORT) && (ASL_CRB_EC_SUPPORT == 1)
    Method(_DEP) // Fan method depends on EC Wrapper Op Region to be available
    {
      Return(Package() {\_SB.PCI0.LPCB.H_EC})
    }
#endif
  }

  // Fan 3 = Package Processor Fan.
  PowerResource(FN03,0,0)
  {
    Method(_STA,0,Serialized)
    { 
        // Return Virtual Fan 3 status.
        Return(VFN3)
    }

    // This method is called when the temprature goes above _AC3.
    // If FAN2 is on, do nothing since we're already at AC2F or greater: temp > _AC2 > _AC3
	// If FAN2 is off, use FAN3 value (AC3F): _AC2 > temp > _AC3
    Method(_ON,0,Serialized)
    {
        // Set Virtual Fan 3 On.
        Store(1,VFN3)

        // If EC access is enabled.
        If(LAnd(ECON, ETMD))
        {
            If(LEqual(VFN2,0))
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(0, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC3F = 0
                \_SB.PCI0.LPCB.H_EC.ECMD(0x1a)
            }
        }
    }

    // This method is called when the temprature goes below _AC3.
    // If FAN4 is on, use its value (AC4F): _AC3 > temp > _AC4
	// If FAN4 is off, use FAN5 value (AC5F): _AC3 > _AC4 > temp 
    Method(_OFF,0,Serialized)
    {
        // Set Virtual Fan 3 Off.
        Store(0,VFN3)

        // If EC access is enabled.
        If(LAnd(ECON, ETMD))
        {
            If(LNotEqual(VFN4,0))
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(0, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC4F = 0
            } 
            Else
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(0, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC5F = 0
            }
            \_SB.PCI0.LPCB.H_EC.ECMD(0x1a)
        }
    }
  }

  // Associate Virtual Fan 3 Power Resource with the FAN3 Device.
  Device(FAN3)
  {
    Name(_HID, EISAID("PNP0C0B"))
    Name(_UID, 3)
    Name(_PR0, Package(1){FN03})
#if defined(ASL_CRB_EC_SUPPORT) && (ASL_CRB_EC_SUPPORT == 1)
    Method(_DEP) // Fan method depends on EC Wrapper Op Region to be available
    {
      Return(Package() {\_SB.PCI0.LPCB.H_EC})
    }
#endif
  }

  // Fan 4 = Package Processor Fan - Lowest Fan Speed
  PowerResource(FN04,0,0)
  {
    Method(_STA,0,Serialized)
    { 
        // Return Virtual Fan 4 status.
        Return(VFN4)
    }

    // This method is called when the temprature goes above _AC4.
    // If FAN3 is on, do nothing since we're already at AC3F or greater: temp > _AC3 > _AC4
	// If FAN3 is off, use FAN4 value (AC4F): _AC3 > temp > _AC4
    Method(_ON,0,Serialized)
    {
        // Set Virtual Fan 4 On.
        Store(1,VFN4)

        // If EC access is enabled.
        If(LAnd(ECON, ETMD))
        {
            If(LEqual(VFN3,0))
            {
                \_SB.PCI0.LPCB.H_EC.ECWT(0, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC4F = 0
                \_SB.PCI0.LPCB.H_EC.ECMD(0x1a)
            }
        }
    }

    // This method is called when the temprature goes below _AC4.
    // FAN4 is the lowest FAN state defined, so we simply go to AC4F
    Method(_OFF,0,Serialized)
    {
        // Set Virtual Fan 4 Off.
        Store(0,VFN4)

        // If EC access is enabled.
        If(LAnd(ECON, ETMD))
        {
            \_SB.PCI0.LPCB.H_EC.ECWT(0, RefOf(\_SB.PCI0.LPCB.H_EC.PENV)) // AC4F = 0
            \_SB.PCI0.LPCB.H_EC.ECMD(0x1a)
        }
    }
  }

  // Associate Virtual Fan 4 Power Resource with the FAN4 Device.
  Device(FAN4)
  {
    Name(_HID, EISAID("PNP0C0B"))
    Name(_UID, 4)
    Name(_PR0, Package(1){FN04})
#if defined(ASL_CRB_EC_SUPPORT) && (ASL_CRB_EC_SUPPORT == 1)
    Method(_DEP) // Fan method depends on EC Wrapper Op Region to be available
    {
      Return(Package() {\_SB.PCI0.LPCB.H_EC})
    }
#endif
  }

  // Thermal Zone 0 = Package Thermal Zone.
  // Package Thermal Zone is used for Active and Critical Policy Control
  // Package Thermal Zone returns the maximum temperature 
  // of all components within the package
  ThermalZone(TZ00)
  {
    // Temporary variable for holding the current temprature reading
    Name(PTMP,3000)

    // Notifies ASL Code the current cooling mode.
    //  0 - Active cooling
    //  1 - Passive cooling
    Method(_SCP, 1, Serialized)
    {
        Store(Arg0, CTYP)
    }

    // Return the temperature at which the OS performs Critical Shutdown
    Method(_CRT, 0, Serialized)
    {         
        // Returns automatic thermal reporting temperature for CPU throttling if available and valid.
        If(CondRefOf(\_PR.ACRT))
        {
            If(LNotEqual(\_PR.ACRT,0))
            {
                Return(Add(2732, Multiply(\_PR.ACRT, 10)))
            }
        }

        Return(Add(2732, Multiply(CRTT, 10)))
    }

    // Return the temperature(s) at which the OS initiates Active Cooling.
    Method(_AC0, 0, Serialized)
    {
        // Returns automatic thermal reporting temperature for CPU throttling if available and valid.
        If(CondRefOf(\_PR.AAC0))
        {
            If(LNotEqual(\_PR.AAC0,0))
            {
                Return(Add(2732, Multiply(\_PR.AAC0, 10)))
            }
        }
        Return(Add(2732, Multiply(ACTT, 10)))
        
    }

    Method(_AC1, 0, Serialized)
    {
        Return(Add(2732, Multiply(ACT1, 10)))
    }

    Method(_AC2, 0, Serialized)
    {
        Return(Add(2732, Multiply(0, 10)))  
       
    }

    Method(_AC3, 0, Serialized)
    {
        Return(Add(2732, Multiply(0, 10)))  
        
    }

    Method(_AC4, 0, Serialized)
    {
        Return(Add(2732, Multiply(0, 10)))  
        
    }

    // Return the device(s) to turn on when _ACx is exceeded.
    Name(_AL0, Package(){FAN0})
    Name(_AL1, Package(){FAN1})
    Name(_AL2, Package(){FAN2})
    Name(_AL3, Package(){FAN3})
    Name(_AL4, Package(){FAN4})

    // Return the Package Temperature.
    //    Source 1: CPU DTS temperature  
    //    Source 2: Max Platform temprature returned by EC 
    Method(_TMP, 0, Serialized)
    {

        If (LNot(ETMD))    // If Legacy TM is disabled, return static value
        {
            Return (3000)
        }

        If (LEqual(DTSE, 0x3)) //Out Of Spec Condition occurred. Return critical temperature for OS shutdown
        {
            Return(Add(2832,Multiply(CRTT,10)))
        }

        // Source 1: If DTS SMM enabled 
        // 
        // If Package Temp MSR is available, then send Package DTS Temp
        // otherwise send Core DTS Temp  
        If(LEqual(DTSE, 0x01))    
        {
            If(LEqual(PKGA, 0x01))
            {
            Store(PDTS, Local0)
            Return(Add(2732, Multiply(Local0, 10)))
            } 
            //
            // Package DTS not support. Report MAX temperature between all cores to OS.
            //
            Store(DTS1,Local0)
            If(LGreater(DTS2, Local0))
            {
                Store(DTS2,Local0)
            } 
            If(LGreater(DTS3, Local0))
            {
                Store(DTS3,Local0)
            } 
            If(LGreater(DTS4, Local0))
            {
                Store(DTS4,Local0)
            } 
            Return(Add(2732, Multiply(Local0, 10)))
        }

        // Source 2: Max Platform temprature returned by EC         
        // If EC enabled/avaialable 
        If(ECON)
        {  
          // Store current reading in temporary variable  
          Store(\_SB.PCI0.LPCB.H_EC.ECRD(RefOf(\_SB.PCI0.LPCB.H_EC.PLMX)), Local0) // Max Platform temprature                                   
          Add(2732, Multiply(Local0, 10), Local0 )
          Store(Local0, PTMP) 
          Return(Local0)
        }
        

        // Return a static value if no source is available.
        Return(3010)
    }
  }

  // Thermal Zone 1 = CPU Thermal Zone.
  // CPU Thermal Zone is used for Passive Policy Control
  // Since Passive Control implies reducing CPU IA core performance states,
  // Only CPU's temperature must be used for that purpose.
  ThermalZone(TZ01)
  {

    // Temporary variable for holding the current temprature reading
    Name(PTMP,3000)

    // Notifies ASL Code the current cooling mode.
    //  0 - Active cooling
    //  1 - Passive cooling
    Method(_SCP, 1, Serialized)
    {
        Store(Arg0,CTYP)
    }

    // Return the temperature at which the OS performs Critical Shutdown
    Method(_CRT, 0, Serialized)
    {          
        // Returns automatic thermal reporting temperature for CPU throttling if available and valid.
        If(CondRefOf(\_PR.ACRT))
        {
            If(LNotEqual(\_PR.ACRT,0))
            {
                Return(Add(2732, Multiply(\_PR.ACRT, 10)))
            }
        }

        Return(Add(2732, Multiply(CRTT, 10)))
    }

    // Return the CPU Temperature to the OS.
    // CPU Temperature is the maximum temperature of all CPU IA cores
    // Source 1: CPU temprature reported by DTS SMM
    // Source 2: CPU temprature reported by EC via PECI
    Method(_TMP,0,Serialized)
    {

        If (LNot(ETMD))    // If Legacy TM is disabled, return static value
        {
            Return (3020)
        }

        If (LEqual(DTSE, 0x3)) //Out Of Spec Condition occurred. Return critical temperature for OS shutdown
        {
            Return(Add(2832,Multiply(CRTT,10)))
        }

        // Source 1: If DTS SMM enabled
        // If Package Temp MSR is available, then send Package DTS Temp
        // otherwise send Core DTS Temp  
        If(LEqual(DTSE, 0x01))    
        {
            If(LEqual(PKGA, 0x01))
            {
            Store(PDTS, Local0)
            Return(Add(2732, Multiply(Local0, 10)))
            } 
            //
            // Package DTS not support. Report MAX temperature between all cores to OS.
            //
            Store(DTS1,Local0)
            If(LGreater(DTS2, Local0))
            {
                Store(DTS2,Local0)
            } 
            If(LGreater(DTS3, Local0))
            {
                Store(DTS3,Local0)
            } 
            If(LGreater(DTS4, Local0))
            {
                Store(DTS4,Local0)
            } 
            Return(Add(2732, Multiply(Local0, 10)))
         }
        
        // If EC avialable/enabled
        If(ECON)
        {
 
          // Source 2: CPU temprature reported by EC via PECI
          // Store current Integer part of reading in temporary variable  
          Store(\_SB.PCI0.LPCB.H_EC.ECRD(RefOf(\_SB.PCI0.LPCB.H_EC.PECH)), Local0)
          Multiply(Local0, 10, Local0) 

          // Fractional part of temprature 
          // Fractional part is in 1/64C, Fractional value = (PECL >> 2 ) * 1/64  
          Store(\_SB.PCI0.LPCB.H_EC.ECRD(RefOf(\_SB.PCI0.LPCB.H_EC.PECL)), Local1)
          ShiftRight(Local1, 2, Local1)
          Store(Divide( Multiply(Local1, 10), 64), Local1)
          
          // Add fractional part to decimal part 
          Add( Local0, Local1, Local0)
          
          Add(2732, Local0, Local0 )
          Store(Local0, PTMP) 
          Return(Local0)
        }


        // Return a static value if no source is available.
        Return(3030)
    }

    // Return the Processor(s) used for Passive Cooling.
    Method(_PSL, 0, Serialized)
    {
        If(LEqual(TCNT, 8))
        {
            //  CMP - Throttling controls eight logical CPUs.
            Return(Package(){\_PR.CPU0,\_PR.CPU1,\_PR.CPU2,\_PR.CPU3,\_PR.CPU4,\_PR.CPU5,\_PR.CPU6,\_PR.CPU7})
        }
        
        If(LEqual(TCNT, 4))
        {
            //  CMP - Throttling controls four logical CPUs.
            Return(Package(){\_PR.CPU0,\_PR.CPU1,\_PR.CPU2,\_PR.CPU3})
        }

        If(LEqual(TCNT, 2))
        {
            //  CMP - Throttling controls both CPUs.
            Return(Package(){\_PR.CPU0,\_PR.CPU1})
        }

        Return(Package(){\_PR.CPU0})
    }
        
    // Returns the temperature at which the OS initiates CPU throttling.
    Method(_PSV, 0, Serialized)
    {
        // Returns automatic thermal reporting temperature for CPU throttling if available and valid.
        If(CondRefOf(\_PR.APSV))
        {
            If(LNotEqual(\_PR.APSV,0))
            {
                Return(Add(2732, Multiply(\_PR.APSV, 10)))
            }
        }

        Return(Add(2732, Multiply(PSVT, 10)))
    }

    // Returns TC1 value used in the passive cooling formula.
    Method(_TC1, 0, Serialized)
    {
        Return(TC1V)
    }
    
    // Returns TC2 value used in the passive cooling formula.
    Method(_TC2, 0, Serialized)
    {
        Return(TC2V)
    } 

    // Returns the sampling period used in the passive cooling formula.
    Method(_TSP, 0, Serialized)
    {
        Return(TSPV)
    }
  }
}