diff options
author | Angel Pons <th3fanbus@gmail.com> | 2020-06-05 19:10:03 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2020-09-18 12:06:38 +0000 |
commit | 64a6b6cb1f0476087ec538c6d55791506d5e9576 (patch) | |
tree | 3913db709870ef295f0ca9e323319af691c94942 /src/include/device/pnp_ops.h | |
parent | 1502494cbac65282f5344b2b0b7ca5ea03cd0c76 (diff) |
src/include: Add PnP/HWM unset_and_set functions
RMW (read/modify/write) ops on PnP devices has never been so simple.
The semantics also allow the compiler to emit valid warnings if the
input parameters would overflow, which are silenced when the cast is
placed outside of the function.
Change-Id: Ica01211af2a9a00aed98880844a836f6b7957b14
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42134
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include/device/pnp_ops.h')
-rw-r--r-- | src/include/device/pnp_ops.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/device/pnp_ops.h b/src/include/device/pnp_ops.h index 15acf367e4..15d31156ed 100644 --- a/src/include/device/pnp_ops.h +++ b/src/include/device/pnp_ops.h @@ -21,6 +21,12 @@ static __always_inline uint8_t pnp_read_config( return pnp_read_index(dev >> 8, reg); } +static __always_inline void pnp_unset_and_set_config( + pnp_devfn_t dev, uint8_t reg, uint8_t unset, uint8_t set) +{ + pnp_unset_and_set_index(dev >> 8, reg, unset, set); +} + static __always_inline void pnp_set_logical_device(pnp_devfn_t dev) { |