⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 systherm.c

📁 For WorkBench2.31 的pentium4 BSP
💻 C
字号:
/* sysTherm.c - Thermal Monitor and Geyserville III mechanism BSP routines *//* Copyright 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01a,02sep02,hdn  written*//*DESCRIPTIONThis file contains routines to manipulate the Thermal Monitor, Clock Modulation and Geyserville III mechanism.  The Thermal Monitor is programmed to generate an interrupt to the processor when the thermal sensor is tripped.  Software Controlled Clock Modulation andthe Thermal Monitor are both enabled if the processor support them.In this case, if the thermal status of the processor is hot, Clock Modulation through the Thermal Monitor takes precedence and the clockis modulated at a 50% duty cycle, regardless of the setting of theon-demand Clock Modulation duty cycle.  Either the Clock Modulationor the Geyserville III technology is used to handle the performanceand power consumption state transition of the processor.  If theprocessor has both capabilities, the Geyserville III is used.  TheGeyserville III support is determined by CPU feature informationreturned by CPUID function 1.  Bit 7 returned in ECX denotes Geyserville III technology support.  Platforms supporting GeyservilleIII (and the required IVMP IV VR technology) will set the GV3_EN bitand the GV_SEL_LOCK bit in the IA32_MISC_ENABLE MSR during POST.The initialization routine gv3LibInit() has six parameters.  The first parameter is how to manage the processor performance and power consumption state.  They are:    - GV3_MAX_PERF (Maximum performance)      the highest performance state is used all the time.    - GV3_MAX_BATT (Maximum battery life)      the lowest performance state is used all the time.    - GV3_OPT_BATT (Optimized battery)      the highest performance state is used if power source is AC.      the lowest performance state is used if power source is Battery.    - GV3_AUTO (Automatic)      the performance state is adjusted to match the current processor      utilization.The next four parameters decide the state transition policy as follows.The second and third one is X and Y, fourth and fifth one is N and M, respectively.    - If CPU utilization is above X<95> % of state S for N<300>       millisecond, transition CPU to state S+1.    - If CPU utilization is below Y<95> % of state S for M<1000>       millisecond, transition CPU to state S-1.The last parameter is a function pointer to the routine that checks ifit is AC powered or Battery powered.  That routine returns TRUE if it is AC powered (default), FALSE otherwise.SEE ALSO: src/arch/i86/gv3Lib.c*/#include "vxWorks.h"#include "sysLib.h"#include "tickLib.h"#include "arch/i86/regsGv3.h"/* defines *//* externals *//* globals *//* locals *//* forward declarations */LOCAL VOID sysThermInt (void);		/* Thermal Monitor interrupt handler *//********************************************************************************* sysThermInit - Thermal Monitor initialization routine in the BSP** This routine initializes the Thermal Monitor library.** RETURN: OK, or ERROR if the processor is not capable of Thermal Monitor.*/STATUS sysThermInit (void)    {    INT32 value[2];		/* MSR 64 bits value */    /* set up the Thermal Monitor interrupt handler */    if (sysCpuId.featuresEdx & CPUID_ACPI)	{        *(int *)(loApicBase + LOAPIC_THERMAL) = LOAPIC_FIXED | 					        INT_NUM_LOAPIC_THERMAL;        cpuPwrThermIntConnect (INUM_TO_IVEC (INT_NUM_LOAPIC_THERMAL));	}    return (OK);    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -