/openbmc/intel-ipmi-oem/include/ |
H A D | sensorutils.hpp | 8 // http://www.apache.org/licenses/LICENSE-2.0 26 static constexpr int16_t minInt10 = -0x200; 28 static constexpr int8_t minInt4 = -8; 34 static inline bool baseInRange(double base) in baseInRange() 36 auto min10 = static_cast<double>(minInt10); in baseInRange() 37 auto max10 = static_cast<double>(maxInt10); in baseInRange() 43 // Ensures floating-point "base" is within bounds, 46 // the floating-point "base" will be as large as possible, 53 // Returns true if successful, modifies values in-place 54 static inline bool scaleFloatExp(double& base, int8_t& expShift) in scaleFloatExp() [all …]
|
/openbmc/phosphor-host-ipmid/dbus-sdr/ |
H A D | sensorutils.cpp | 8 // http://www.apache.org/licenses/LICENSE-2.0 17 #include "dbus-sdr/sensorutils.hpp" 27 static bool baseInRange(double base) in baseInRange() 29 auto min10 = static_cast<double>(minInt10); in baseInRange() 30 auto max10 = static_cast<double>(maxInt10); in baseInRange() 36 // Ensures floating-point "base" is within bounds, 39 // the floating-point "base" will be as large as possible, 46 // Returns true if successful, modifies values in-place 47 static bool scaleFloatExp(double& base, int8_t& expShift) in scaleFloatExp() 49 // Comparing with zero should be OK, zero is special in floating-point in scaleFloatExp() [all …]
|
/openbmc/phosphor-host-ipmid/test/dbus-sdr/ |
H A D | sensorcommands_unittest.cpp | 1 #include "dbus-sdr/sensorutils.hpp" 13 // It scales based on the range of "y" 14 static constexpr double expectedSlopY = 0.01; 19 double ipmitool_y_from_x(uint8_t x, int m, int k2_rExp, int b, int k1_bExp, in ipmitool_y_from_x() 22 double result; in ipmitool_y_from_x() 26 double k1 = k1_bExp; in ipmitool_y_from_x() 27 double k2 = k2_rExp; in ipmitool_y_from_x() 33 switch (/*sensor->cmn.unit.*/ analog) in ipmitool_y_from_x() 36 result = (double)(((m * val) + (b * pow(10, k1))) * pow(10, k2)); in ipmitool_y_from_x() 45 (double)(((m * (int8_t)val) + (b * pow(10, k1))) * pow(10, k2)); in ipmitool_y_from_x() [all …]
|
/openbmc/intel-ipmi-oem/tests/ |
H A D | test_sensorcommands.cpp | 13 // It scales based on the range of "y" 14 static constexpr double expectedSlopY = 0.01; 19 double ipmitool_y_from_x(uint8_t x, int m, int k2_rExp, int b, int k1_bExp, in ipmitool_y_from_x() 22 double result; in ipmitool_y_from_x() 26 double k1 = k1_bExp; in ipmitool_y_from_x() 27 double k2 = k2_rExp; in ipmitool_y_from_x() 33 switch (/*sensor->cmn.unit.*/ analog) in ipmitool_y_from_x() 36 result = (double)(((m * val) + (b * pow(10, k1))) * pow(10, k2)); in ipmitool_y_from_x() 45 (double)(((m * (int8_t)val) + (b * pow(10, k1))) * pow(10, k2)); in ipmitool_y_from_x() 58 void testValue(int x, double y, int16_t M, int8_t rExp, int16_t B, int8_t bExp, in testValue() [all …]
|
/openbmc/phosphor-pid-control/sysfs/ |
H A D | sysfswrite.cpp | 8 * http://www.apache.org/licenses/LICENSE-2.0 25 void SysFsWritePercent::write(double value) in write() 27 double minimum = getMin(); in write() 28 double maximum = getMax(); in write() 30 double range = maximum - minimum; in write() local 31 double offset = range * value; in write() 32 double ovalue = offset + minimum; in write() 42 void SysFsWrite::write(double value) in write()
|
/openbmc/qemu/tests/bench/ |
H A D | qht-bench.c | 5 * See the COPYING file in the top-level directory. 30 * Seed is in the range [1..UINT64_MAX], because the RNG requires 31 * a non-zero seed. To use, subtract 1 and compare against the 60 static double resize_rate; /* 0.0 to 1.0 */ 65 static double update_rate; /* 0.0 to 1.0 */ 78 " -d = duration, in seconds\n" 79 " -n = number of threads\n" 81 " -o = offset at which keys start\n" 82 " -p = precompute hashes\n" 84 " -g = set -s,-k,-K,-l,-r to the same value\n" [all …]
|
/openbmc/phosphor-pid-control/examples/ |
H A D | README | 5 All sensors in phosphor-dbus-interfaces for OpenBMC use Sensor.Value as their 6 accessor. This provides read-only access to information. The goal of the 13 The min/max specified are to range a writePercent to the sensor. The current 18 expected to have a writePath set, and in this current version non-fan sensors 38 host-provided sensor. 44 * This can be left blank if the sensor is read-only. 46 * If min and max are non-zero, it'll convert the value to within the range. 58 "minThermalOutput": 3000.0, /* The minimum thermal RPM value. (double) */ 59 "failsafePercent": 75.0, /* The percent to use when the zone is in fail-safe mode. (double) */ 62 "name": "fan1-5", /* PID name */ [all …]
|
/openbmc/qemu/include/qapi/qmp/ |
H A D | qnum.h | 9 * Marc-André Lureau <marcandre.lureau@redhat.com> 12 * See the COPYING.LIB file in the top-level directory. 31 * concrete subtypes: floating-point, signed integer, unsigned 32 * integer. QNum implements this as a discriminated union of double, 36 * decimal point or an exponent, it is floating-point. Else if it 38 * uint64_t, it's unsigned integer. Else it's floating-point. 40 * Any number can serve as double: qnum_get_double() converts under 44 * in range: qnum_get_try_int() / qnum_get_try_uint() check range and 53 double dbl; 63 QNum *qnum_from_double(double value); [all …]
|
/openbmc/fb-ipmi-oem/include/ |
H A D | sensorutils.hpp | 3 * Copyright (c) 2018-present Facebook. 9 * http://www.apache.org/licenses/LICENSE-2.0 21 #include <phosphor-logging/log.hpp> 30 static constexpr int16_t minInt10 = -0x200; 32 static constexpr int8_t minInt4 = -8; 75 phosphor::logging::entry("ERRNO=0x%X", -ret)); in getSensorSubtree() 138 size_t typeStart = path.rfind("/", typeEnd - 1); in getSensorTypeStringFromPath() 145 return path.substr(typeStart, typeEnd - typeStart); in getSensorTypeStringFromPath() 155 sensorType = static_cast<uint8_t>(findSensor->second); in getSensorTypeFromPath() 168 const double max, const double min, int16_t& mValue, int8_t& rExp, in getSensorAttributes() [all …]
|
/openbmc/phosphor-pid-control/dbus/ |
H A D | dbuswrite.cpp | 8 // http://www.apache.org/licenses/LICENSE-2.0 21 #include <phosphor-logging/log.hpp> 45 connectionName = helper->getService(pwmInterface, path); in createDbusWrite() 55 void DbusWritePercent::write(double value) in write() 60 void DbusWritePercent::write(double value, bool force, int64_t* written) in write() 62 double minimum = getMin(); in write() 63 double maximum = getMax(); in write() 65 double range = maximum - minimum; in write() local 66 double offset = range * value; in write() 67 double ovalue = offset + minimum; in write() [all …]
|
/openbmc/linux/tools/perf/bench/ |
H A D | mem-functions.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * mem-memcpy.c 11 #include "../perf-sys.h" 12 #include <subcmd/parse-options.h> 17 #include "mem-memcpy-arch.h" 18 #include "mem-memset-arch.h" 73 cycles_fd = sys_perf_event_open(&cycle_attr, getpid(), -1, -1, perf_event_open_cloexec_flag()); in init_cycles() 77 return -1; in init_cycles() 94 static double timeval2double(struct timeval *ts) in timeval2double() 96 return (double)ts->tv_sec + (double)ts->tv_usec / (double)USEC_PER_SEC; in timeval2double() [all …]
|
/openbmc/qemu/scripts/oss-fuzz/ |
H A D | reorder_fuzzer_qtest_trace.py | 2 # -*- coding: utf-8 -*- 6 trace that you can feed into a standard qemu-system process. Example usage: 8 QEMU_FUZZ_ARGS="-machine q35,accel=qtest" QEMU_FUZZ_OBJECTS="*" \ 9 ./i386-softmmu/qemu-fuzz-i386 --fuzz-target=generic-pci-fuzz 12 QEMU_FUZZ_ARGS="-machine q35,accel=qtest" QEMU_FUZZ_OBJECTS="*" \ 13 ./i386-softmmu/qemu-fuzz-i386 --fuzz-target=generic-pci-fuzz 15 scripts/oss-fuzz/reorder_fuzzer_qtest_trace.py qtest_log_output > qtest_trace 16 ./i386-softmmu/qemu-fuzz-i386 -machine q35,accel=qtest \ 17 -qtest stdio < qtest_trace 21 Some fuzzer make use of hooks that allow us to populate some memory range, just [all …]
|
/openbmc/dbus-sensors/src/ |
H A D | PwmSensor.cpp | 8 // http://www.apache.org/licenses/LICENSE-2.0 34 static constexpr double sysPwmMax = 255.0; 35 static constexpr double psuPwmMax = 100.0; 36 static constexpr double defaultPwm = 30.0; 37 static constexpr double targetIfaceMax = sysPwmMax; 68 double fValue = 100.0 * (static_cast<double>(pwmValue) / pwmMax); in PwmSensor() 69 sensorInterface->register_property( in PwmSensor() 71 [this](const double& req, double& resp) { in PwmSensor() 74 // Reject attempted change, if to NaN or other non-numeric in PwmSensor() 75 return -1; in PwmSensor() [all …]
|
/openbmc/qemu/util/ |
H A D | throttle.c | 4 * Copyright (C) Nodalink, EURL. 2013-2014 38 double leak; in throttle_leak_bucket() 41 leak = (bkt->avg * (double) delta_ns) / NANOSECONDS_PER_SECOND; in throttle_leak_bucket() 44 bkt->level = MAX(bkt->level - leak, 0); in throttle_leak_bucket() 47 * keep track of bkt->burst_level so the bkt->max goal per second in throttle_leak_bucket() 49 if (bkt->burst_length > 1) { in throttle_leak_bucket() 50 leak = (bkt->max * (double) delta_ns) / NANOSECONDS_PER_SECOND; in throttle_leak_bucket() 51 bkt->burst_level = MAX(bkt->burst_level - leak, 0); in throttle_leak_bucket() 62 int64_t delta_ns = now - ts->previous_leak; in throttle_do_leak() 65 ts->previous_leak = now; in throttle_do_leak() [all …]
|
/openbmc/phosphor-pid-control/ |
H A D | interfaces.hpp | 10 double value = std::numeric_limits<double>::quiet_NaN(); 12 double unscaled = value; 16 return ((this->value == rhs.value) && (this->updated == rhs.updated) && in operator ==() 17 (this->unscaled == rhs.unscaled)); in operator ==() 23 // This is normalized to (0.0, 1.0) range, using configured min and max 24 double scaled; 27 double unscaled; 31 * A ReadInterface is a plug-in for the PluggableSensor and anyone implementing 50 * A WriteInterface is a plug-in for the PluggableSensor and anyone implementing 60 virtual void write(double value) = 0; [all …]
|
/openbmc/linux/Documentation/devicetree/bindings/regulator/ |
H A D | dlg,da9121.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Adam Ward <Adam.Ward.opensource@diasemi.com> 13 Dialog Semiconductor DA9121 Single-channel 10A double-phase buck converter 14 Dialog Semiconductor DA9122 Double-channel 5A single-phase buck converter 15 Dialog Semiconductor DA9220 Double-channel 3A single-phase buck converter 16 Dialog Semiconductor DA9217 Single-channel 6A double-phase buck converter 17 Dialog Semiconductor DA9130 Single-channel 10A double-phase buck converter 18 Dialog Semiconductor DA9131 Double-channel 5A single-phase buck converter [all …]
|
/openbmc/linux/include/sound/ac97/ |
H A D | regs.h | 1 /* SPDX-License-Identifier: GPL-2.0+ 33 /* range 0x28-0x3a - AUDIO AC'97 2.0 extensions */ 44 /* range 0x3c-0x58 - MODEM */ 59 /* range 0x5a-0x7b - Vendor Specific */ 62 /* range 0x60-0x6f (page 1) - extended codec registers */ 85 #define AC97_SLOT_PCM_LEFT_0 7 /* double rate operation */ 88 #define AC97_SLOT_PCM_RIGHT_0 8 /* double rate operation */ 93 #define AC97_SLOT_PCM_LEFT_1 10 /* double rate operation */ 96 #define AC97_SLOT_PCM_RIGHT_1 11 /* double rate operation */ 99 #define AC97_SLOT_PCM_CENTER_1 12 /* double rate operation */ [all …]
|
/openbmc/linux/fs/befs/ |
H A D | datastream.c | 1 // SPDX-License-Identifier: GPL-2.0 7 * Based on portions of file.c by Makoto Kato <m_kato@ga2.so-net.ne.jp> 39 * befs_read_datastream - get buffer_head containing data, starting from pos. 43 * @off: offset of data in buffer_head->b_data 56 befs_debug(sb, "---> %s %llu", __func__, pos); in befs_read_datastream() 57 block = pos >> BEFS_SB(sb)->block_shift; in befs_read_datastream() 59 *off = pos - (block << BEFS_SB(sb)->block_shift); in befs_read_datastream() 64 befs_debug(sb, "<--- %s ERROR", __func__); in befs_read_datastream() 74 befs_debug(sb, "<--- %s read data, starting at %llu", __func__, pos); in befs_read_datastream() 80 * befs_fblock2brun - give back block run for fblock [all …]
|
/openbmc/linux/sound/soc/ |
H A D | soc-ops.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 // soc-ops.c -- Generic ASoC operations 11 // with code, comments and ideas from :- 26 #include <sound/soc-dpcm.h> 30 * snd_soc_info_enum_double - enumerated double mixer info callback 34 * Callback to provide information about a double enumerated 42 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in snd_soc_info_enum_double() 44 return snd_ctl_enum_info(uinfo, e->shift_l == e->shift_r ? 1 : 2, in snd_soc_info_enum_double() 45 e->items, e->texts); in snd_soc_info_enum_double() 50 * snd_soc_get_enum_double - enumerated double mixer get callback [all …]
|
/openbmc/linux/tools/power/cpupower/utils/idle_monitor/ |
H A D | nhm_idle.c | 1 // SPDX-License-Identifier: GPL-2.0-only 16 #include "idle_monitor/cpupower-monitor.h" 29 static int nhm_get_count_percent(unsigned int self_id, double *percent, 37 .range = RANGE_CORE, 44 .range = RANGE_CORE, 52 .range = RANGE_PACKAGE, 59 .range = RANGE_PACKAGE, 93 return -1; in nhm_get_count() 96 return -1; in nhm_get_count() 101 static int nhm_get_count_percent(unsigned int id, double *percent, in nhm_get_count_percent() [all …]
|
/openbmc/phosphor-fan-presence/monitor/ |
H A D | tach_sensor.hpp | 3 #include <phosphor-logging/log.hpp> 29 * - init - only do the initialization steps 30 * - monitor - run normal monitoring algorithm 40 * - func - Transition to functional state timer 41 * - nonfunc - Transition to nonfunctional state timer 51 * - time - Use a percentage based deviation 52 * - count - Run up/down count fault detection 87 * @param[in] mode - mode of fan monitor 88 * @param[in] bus - the dbus object 89 * @param[in] fan - the parent fan object [all …]
|
/openbmc/phosphor-fan-presence/control/json/utils/ |
H A D | modifier.cpp | 8 * http://www.apache.org/licenses/LICENSE-2.0 22 #include <phosphor-logging/log.hpp> 51 * to LessThanOperator is out of range. 71 else if (std::holds_alternative<double>(val)) in getDefaultValue() 73 return std::numeric_limits<double>::quiet_NaN(); in getDefaultValue() 91 * With strings values, A - B removes all occurrences of B in A. 100 PropertyVariantType operator()(double val) override in operator ()() 102 return val - std::visit(ToTypeVisitor<double>(), arg); in operator ()() 107 return val - std::visit(ToTypeVisitor<int32_t>(), arg); in operator ()() 112 return val - std::visit(ToTypeVisitor<int64_t>(), arg); in operator ()() [all …]
|
/openbmc/linux/arch/xtensa/include/asm/ |
H A D | processor.h | 6 * Copyright (C) 2001 - 2008 Tensilica Inc. 53 * kernel, double); and their specific causes are reported via DEBUGCAUSE 62 * We use DEPC also as a flag to distinguish between double and regular 65 * valid double exception address. 83 * general-purpose interrupts. 86 #define LOCKLEVEL (PROFILING_INTLEVEL - 1) 98 #define WBBITS (XCHAL_NUM_AREGS_LOG2 - 2) /* width of WINDOWBASE in bits */ 118 * Note: 'text' is the address within the same 1GB range as the ra 139 * pointer sp. reg must be in the range [0..4). 141 #define SPILL_SLOT(sp, reg) (*(((unsigned long *)(sp)) - 4 + (reg))) [all …]
|
/openbmc/linux/drivers/ata/ |
H A D | pata_ftide010.c | 1 // SPDX-License-Identifier: GPL-2.0-only 24 * struct ftide010 - state container for the Faraday FTIDE010 48 /* Gemini-specific properties */ 99 * 1, 2, 3 and 4. Range 0..15. 101 * 1, 2, 3 and 4. Range 0..15. 103 * word DMA, Mode 0, 1, and 2 at 50 MHz. Range 0..15. 105 * multi word DMA, Mode 0, 1 and 2 at 50 MHz. Range 0..15. 107 * word DMA, Mode 0, 1 and 2 at 66 MHz. Range 0..15. 109 * multi word DMA, Mode 0, 1 and 2 at 66 MHz. Range 0..15. 111 * DMA, Mode 0, 1, 2, 3, 4 and 5 at 50 MHz. Range 0..7. [all …]
|
/openbmc/linux/include/linux/input/ |
H A D | adxl34x.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 33 * Setting the SUPPRESS bit suppresses Double Tap detection if 51 * behavior if Tap/Double Tap is enabled. 61 * value will prevent Tap/Double Tap functions from working. 71 * factor is 1.25 ms/LSB. A zero value will disable the Double Tap 82 * disable the Double Tap function. 152 * result in the function appearing un-responsive if the 162 * holds the threshold value for Free-Fall detection. 163 * The data format is unsigned. The root-sum-square(RSS) value 167 * result in undesirable behavior if Free-Fall interrupt is [all …]
|