mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-05-02 08:38:25 +00:00
To reduce type conversion in HV:
Update return type of function ffs64 and ffz64 as uint16;
For ffs64, when the input is zero, INVALID_BIT_INDEX is returned;
Update temporary variable type and return value check of caller
when it call ffs64 or ffz64;
Note: In the allocate_mem, there is no return value checking for
calling ffz64, this will be updated latter.
V1-->V2:
INVALID_BIT_INDEX instead of INVALID_NUMBER
Coding style fixing;
INVALID_CPU_ID instead of INVALID_PCPU_ID or INVALID_VCPU_ID;
"%hu" is used to print vcpu id (uint16_t);
Add "U/UL" for constant value as needed.
V2-->V3:
ffs64 return INVALID_BIT_INDEX directly when
the input value is zero;
Remove excess "%hu" updates.
V3-->V4:
Clean up the comments of ffs64;
Add "U" for constant value as needed.
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
24 lines
542 B
C
24 lines
542 B
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef SOFTIRQ_H
|
|
#define SOFTIRQ_H
|
|
|
|
#define SOFTIRQ_TIMER 0U
|
|
#define SOFTIRQ_DEV_ASSIGN 1U
|
|
#define SOFTIRQ_MAX 2U
|
|
#define SOFTIRQ_MASK ((1UL<<SOFTIRQ_MAX)-1)
|
|
|
|
/* used for atomic value for prevent recursive */
|
|
#define SOFTIRQ_ATOMIC 63U
|
|
|
|
void enable_softirq(uint16_t cpu_id);
|
|
void disable_softirq(uint16_t cpu_id);
|
|
void init_softirq(void);
|
|
void raise_softirq(int softirq_id);
|
|
void exec_softirq(void);
|
|
#endif /* SOFTIRQ_H */
|