/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ /* $Source: src/occ_405/sensor/sensor.h $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2011,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ /* You may obtain a copy of the License at */ /* */ /* http://www.apache.org/licenses/LICENSE-2.0 */ /* */ /* Unless required by applicable law or agreed to in writing, software */ /* distributed under the License is distributed on an "AS IS" BASIS, */ /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ /* implied. See the License for the specific language governing */ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ #ifndef _sensor_h #define _sensor_h #include // defines for uint8_t,uint3_t..etc #include // For errlHndl_t #include // Common OCC defines #include // For Sensor Enum // Macro to get mini sensor value. It gives the mini sensor value for // the given occId at given the given field. If occId is out of range, it will // return 0. #define MINI_SENSOR_VALUE(occId,fieldNm) \ ( (occId < MAX_OCCS) ? G_dcom_slv_outbox[occId].fieldNm : 0x0) // Make a AMEC Number out of mantissa & exponent. #define AMEFP(mantissa,exp) (((UINT32)mantissa << 8) | (UINT32)((UINT8) 256 + (UINT8)exp)) // Get pointer to sensor based on GSID #define AMECSENSOR_PTR(sensor) G_amec_sensor_list[sensor] #define AMECSENSOR_ARRAY_PTR(sensor_base,idx) G_amec_sensor_list[sensor_base+idx] #define AMECSENSOR_2D_ARRAY_PTR(sensor_base,idx,idx2) G_amec_sensor_list[sensor_base+idx+idx2] #define AMEC_SENSOR_NONUM 0xFF #define SENSOR_TYPE_ALL 0xFFFF #define SENSOR_LOC_ALL 0xFFFF #define MAX_VECTOR_SENSORS 32 #define MAX_SENSOR_NAME_SZ 16 // including NULL #define MAX_SENSOR_UNIT_SZ 4 // including NULL #define MAX_AMEC_SENSORS 710 #define VECTOR_SENSOR_DEFAULT_VAL 0xFF // AMEC_SENSOR_TYPE_INVALID can not be used to identify sensor type. // A bit vector mask is used to specify sensor types that AMESTER is // probed for, and hence when a new sensor type is defined, it has to // have only one bit set in its value (e.g., 0x01<