Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ice/ice_bitops.h
/* SPDX-License-Identifier: BSD-3-Clause */ | /* SPDX-License-Identifier: BSD-3-Clause */ | ||||
/* Copyright (c) 2020, Intel Corporation | /* Copyright (c) 2021, Intel Corporation | ||||
* All rights reserved. | * All rights reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions are met: | * modification, are permitted provided that the following conditions are met: | ||||
* | * | ||||
* 1. Redistributions of source code must retain the above copyright notice, | * 1. Redistributions of source code must retain the above copyright notice, | ||||
* this list of conditions and the following disclaimer. | * this list of conditions and the following disclaimer. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 407 Lines • ▼ Show 20 Lines | |||||
* Note that this function assumes it is operating on a bitmap declared using | * Note that this function assumes it is operating on a bitmap declared using | ||||
* ice_declare_bitmap. | * ice_declare_bitmap. | ||||
*/ | */ | ||||
static inline void | static inline void | ||||
ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits) | ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits) | ||||
{ | { | ||||
u16 i; | u16 i; | ||||
for (i = pos; i < num_bits; i++) | for (i = pos; i < pos + num_bits; i++) | ||||
ice_set_bit(i, dst); | ice_set_bit(i, dst); | ||||
} | } | ||||
/** | /** | ||||
* ice_bitmap_hweight - hamming weight of bitmap | * ice_bitmap_hweight - hamming weight of bitmap | ||||
* @bm: bitmap pointer | * @bm: bitmap pointer | ||||
* @size: size of bitmap (in bits) | * @size: size of bitmap (in bits) | ||||
* | * | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |