docstring stringlengths 22 576 | signature stringlengths 9 317 | prompt stringlengths 57 886 | code stringlengths 20 1.36k | repository stringclasses 49
values | language stringclasses 2
values | license stringclasses 9
values | stars int64 15 21.3k |
|---|---|---|---|---|---|---|---|
/* Common ACMP interrupt handler.
This function handles ACMP edge trigger interrupt request */ | void ACMP0_IRQHandler(void) | /* Common ACMP interrupt handler.
This function handles ACMP edge trigger interrupt request */
void ACMP0_IRQHandler(void) | {
rt_interrupt_enter();
if (ACMP0->IF & ACMP_IF_EDGE)
{
if (acmpCbTable[0].cbFunc != RT_NULL)
{
(acmpCbTable[0].cbFunc)(acmpCbTable[0].userPtr);
}
BITBAND_Peripheral(&(ACMP0->IFC), _ACMP_IF_EDGE_SHIFT, 0x1UL);
}
if (ACMP1->IF & ACMP_IF_EDGE)
{
... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Sets the Energy harvesting mode.
Needs the I2C Password presentation to be effective. */ | int32_t ST25DV_WriteEHMode(ST25DV_Object_t *pObj, const ST25DV_EH_MODE_STATUS EH_mode) | /* Sets the Energy harvesting mode.
Needs the I2C Password presentation to be effective. */
int32_t ST25DV_WriteEHMode(ST25DV_Object_t *pObj, const ST25DV_EH_MODE_STATUS EH_mode) | {
uint8_t reg_value;
reg_value = (uint8_t)EH_mode;
return st25dv_set_eh_mode(&(pObj->Ctx), ®_value);
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Clear the FIFO buffer of the specified SPI port. */ | void SPIFIFOClear(unsigned long ulBase, unsigned long ulRxTx) | /* Clear the FIFO buffer of the specified SPI port. */
void SPIFIFOClear(unsigned long ulBase, unsigned long ulRxTx) | {
xASSERT(ulBase == SPI0_BASE);
xASSERT((ulRxTx == SPI_FSR_RX) || (ulRxTx == SPI_FSR_TX));
if(ulRxTx == SPI_FSR_RX)
{
xHWREG(ulBase + SPI_FCR) |= SPI_FCR_RFPR;
}
else
{
xHWREG(ulBase + SPI_FCR) |= SPI_FCR_TFPR;
}
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* We get here from the send completion handler, when the adapter tells us the ACK frame was sent. */ | void rds_ib_ack_send_complete(struct rds_ib_connection *ic) | /* We get here from the send completion handler, when the adapter tells us the ACK frame was sent. */
void rds_ib_ack_send_complete(struct rds_ib_connection *ic) | {
clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
rds_ib_attempt_ack(ic);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* On hardware prior to Power 4 these exceptions were asynchronous which means we can't tell exactly where it occurred and so we can't recover. */ | int pSeries_machine_check_exception(struct pt_regs *regs) | /* On hardware prior to Power 4 these exceptions were asynchronous which means we can't tell exactly where it occurred and so we can't recover. */
int pSeries_machine_check_exception(struct pt_regs *regs) | {
struct rtas_error_log *errp;
if (fwnmi_active) {
errp = fwnmi_get_errinfo(regs);
fwnmi_release_errinfo();
if (errp && recover_mce(regs, errp))
return 1;
}
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* If 64-bit I/O port operations are not supported, then ASSERT(). If Port is not aligned on a 64-bit boundary, then ASSERT(). */ | UINT64 EFIAPI IoAndThenOr64(IN UINTN Port, IN UINT64 AndData, IN UINT64 OrData) | /* If 64-bit I/O port operations are not supported, then ASSERT(). If Port is not aligned on a 64-bit boundary, then ASSERT(). */
UINT64 EFIAPI IoAndThenOr64(IN UINTN Port, IN UINT64 AndData, IN UINT64 OrData) | {
return IoWrite64 (Port, (IoRead64 (Port) & AndData) | OrData);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* You must not currently be polling on the #GPollFD returned by g_wakeup_get_pollfd(), or the result is undefined. */ | void g_wakeup_free(GWakeup *wakeup) | /* You must not currently be polling on the #GPollFD returned by g_wakeup_get_pollfd(), or the result is undefined. */
void g_wakeup_free(GWakeup *wakeup) | {
close (wakeup->fds[0]);
if (wakeup->fds[1] != -1)
close (wakeup->fds[1]);
g_slice_free (GWakeup, wakeup);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* param base The LPI2C peripheral base address. param handle Pointer to the LPI2C master driver handle. param count Number of bytes transferred so far by the non-blocking transaction. retval #kStatus_Success retval #kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. */ | status_t LPI2C_MasterTransferGetCountEDMA(LPI2C_Type *base, lpi2c_master_edma_handle_t *handle, size_t *count) | /* param base The LPI2C peripheral base address. param handle Pointer to the LPI2C master driver handle. param count Number of bytes transferred so far by the non-blocking transaction. retval #kStatus_Success retval #kStatus_NoTransferInProgress There is not a DMA transaction currently in progress. */
status_t LPI2C_M... | {
assert(handle);
if (NULL == count)
{
return kStatus_InvalidArgument;
}
if (!handle->isBusy)
{
*count = 0;
return kStatus_NoTransferInProgress;
}
uint32_t remaining = handle->transfer.dataSize;
if (EDMA_GetNextTCDAddress(handle->tx) == 0U)
{
if (h... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Used to check for read/write/execute permissions on an inode. We use "fsuid" for this, letting us set arbitrary permissions for filesystem access without changing the "normal" uids which are used for other things. */ | int inode_permission(struct inode *inode, int mask) | /* Used to check for read/write/execute permissions on an inode. We use "fsuid" for this, letting us set arbitrary permissions for filesystem access without changing the "normal" uids which are used for other things. */
int inode_permission(struct inode *inode, int mask) | {
int retval;
if (mask & MAY_WRITE) {
umode_t mode = inode->i_mode;
if (IS_RDONLY(inode) &&
(S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
return -EROFS;
if (IS_IMMUTABLE(inode))
return -EACCES;
}
if (inode->i_op->permission)
retval = inode->i_op->permission(inode, mask);
else
retval = ge... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Start a memory to a peripheral ping-pong DMA transfer. */ | Ecode_t DMADRV_MemoryPeripheralPingPong(unsigned int channelId, DMADRV_PeripheralSignal_t peripheralSignal, void *dst, void *src0, void *src1, bool srcInc, int len, DMADRV_DataSize_t size, DMADRV_Callback_t callback, void *cbUserParam) | /* Start a memory to a peripheral ping-pong DMA transfer. */
Ecode_t DMADRV_MemoryPeripheralPingPong(unsigned int channelId, DMADRV_PeripheralSignal_t peripheralSignal, void *dst, void *src0, void *src1, bool srcInc, int len, DMADRV_DataSize_t size, DMADRV_Callback_t callback, void *cbUserParam) | {
return StartTransfer(dmaModePingPong,
dmaDirectionMemToPeripheral,
channelId,
peripheralSignal,
dst,
src0,
src1,
srcInc,
len,
... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Sets LRO on or off for a particular queue set. the device's features flag is updated to reflect the LRO capability when all queues belonging to the device are in the same state. */ | static void set_qset_lro(struct net_device *dev, int qset_idx, int val) | /* Sets LRO on or off for a particular queue set. the device's features flag is updated to reflect the LRO capability when all queues belonging to the device are in the same state. */
static void set_qset_lro(struct net_device *dev, int qset_idx, int val) | {
struct port_info *pi = netdev_priv(dev);
struct adapter *adapter = pi->adapter;
adapter->params.sge.qset[qset_idx].lro = !!val;
adapter->sge.qs[qset_idx].lro_enabled = !!val;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The caller might have already read an initial dot. */ | static int read_numeral(LexState *ls, SemInfo *seminfo) | /* The caller might have already read an initial dot. */
static int read_numeral(LexState *ls, SemInfo *seminfo) | {
if (check_next2(ls, expo))
check_next2(ls, "-+");
else if (lisxdigit(ls->current) || ls->current == '.')
save_and_next(ls);
else break;
}
if (lislalpha(ls->current))
save_and_next(ls);
save(ls, '\0');
if (luaO_str2num(luaZ_buffer(ls->buff), &obj) == 0)
lexerror(ls, "malformed n... | Nicholas3388/LuaNode | C++ | Other | 1,055 |
/* Sets @value to its default value as specified in @pspec. */ | void g_param_value_set_default(GParamSpec *pspec, GValue *value) | /* Sets @value to its default value as specified in @pspec. */
void g_param_value_set_default(GParamSpec *pspec, GValue *value) | {
g_return_if_fail (G_IS_PARAM_SPEC (pspec));
g_return_if_fail (G_IS_VALUE (value));
g_return_if_fail (PSPEC_APPLIES_TO_VALUE (pspec, value));
g_value_reset (value);
G_PARAM_SPEC_GET_CLASS (pspec)->value_set_default (pspec, value);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* wait_for_device_probe Wait for device probing to be completed. */ | void wait_for_device_probe(void) | /* wait_for_device_probe Wait for device probing to be completed. */
void wait_for_device_probe(void) | {
wait_event(probe_waitqueue, atomic_read(&probe_count) == 0);
async_synchronize_full();
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Checks whether the specified interrupt has occurred or not. */ | uint8_t DMA_ReadIntFlag(DMA_INT_FLAG_T flag) | /* Checks whether the specified interrupt has occurred or not. */
uint8_t DMA_ReadIntFlag(DMA_INT_FLAG_T flag) | {
uint32_t status;
if((flag & 0x10000000) == SET)
{
status = DMA2->INTSTS & ((uint32_t)flag & 0x000FFFFF);
}
else
{
status = DMA1->INTSTS & ((uint32_t)flag & 0x0FFFFFFF);
}
if (status == flag)
{
return SET;
}
return RESET;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* This is called to free all resources allocated by @gether_setup(). */ | void gether_cleanup(void) | /* This is called to free all resources allocated by @gether_setup(). */
void gether_cleanup(void) | {
if (!the_dev)
return;
unregister_netdev(the_dev->net);
free_netdev(the_dev->net);
flush_scheduled_work();
the_dev = NULL;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* register types requiring automatic updates
Note that this function should be called by the component initialization function. */ | IX_ETH_DB_PUBLIC UINT32 ixEthDBUpdateTypeRegister(BOOL *typeArray) | /* register types requiring automatic updates
Note that this function should be called by the component initialization function. */
IX_ETH_DB_PUBLIC UINT32 ixEthDBUpdateTypeRegister(BOOL *typeArray) | {
typeArray[IX_ETH_DB_FILTERING_RECORD] = TRUE;
typeArray[IX_ETH_DB_FILTERING_VLAN_RECORD] = TRUE;
return 2;
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* This function prohibits access to the SMRAM region. This function is usually implemented such that it is a write-once operation. */ | STATIC EFI_STATUS EFIAPI SmmAccess2DxeLock(IN EFI_SMM_ACCESS2_PROTOCOL *This) | /* This function prohibits access to the SMRAM region. This function is usually implemented such that it is a write-once operation. */
STATIC EFI_STATUS EFIAPI SmmAccess2DxeLock(IN EFI_SMM_ACCESS2_PROTOCOL *This) | {
return SmramAccessLock (&This->LockState, &This->OpenState);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This is only a psuedo I2C interface. We can't use the standard kernel routines as the interface is write only. We just assume the data is acked... */ | static void lcdtg_ssp_i2c_send(struct corgi_lcd *lcd, uint8_t data) | /* This is only a psuedo I2C interface. We can't use the standard kernel routines as the interface is write only. We just assume the data is acked... */
static void lcdtg_ssp_i2c_send(struct corgi_lcd *lcd, uint8_t data) | {
corgi_ssp_lcdtg_send(lcd, POWERREG0_ADRS, data);
udelay(10);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Check if the USART Transmit Holding Register is empty or not in SPI mode. */ | uint32_t usart_spi_is_tx_ready(volatile avr32_usart_t *p_usart) | /* Check if the USART Transmit Holding Register is empty or not in SPI mode. */
uint32_t usart_spi_is_tx_ready(volatile avr32_usart_t *p_usart) | {
return usart_tx_ready(p_usart);
} | memfault/zero-to-main | C++ | null | 200 |
/* send a data packet to the USB device */ | usbh_status usbh_data_send(usb_core_driver *udev, uint8_t *buf, uint8_t pp_num, uint16_t len) | /* send a data packet to the USB device */
usbh_status usbh_data_send(usb_core_driver *udev, uint8_t *buf, uint8_t pp_num, uint16_t len) | {
usb_pipe *pp = &udev->host.pipe[pp_num];
pp->xfer_buf = buf;
pp->xfer_len = len;
switch (pp->ep.type) {
case USB_EPTYPE_CTRL:
if (0U == len) {
pp->data_toggle_out = 1U;
}
pp->DPID = PIPE_DPID[pp->data_toggle_out];
break;
case USB_EPTYPE_INTR:
... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Initializes the Low Level portion of the Device driver. */ | USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev) | /* Initializes the Low Level portion of the Device driver. */
USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev) | {
NVIC_SetPriority (SysTick_IRQn, 0);
hpcd.Instance = USB_OTG_FS;
hpcd.Init.dev_endpoints = 4;
hpcd.Init.use_dedicated_ep1 = 0;
hpcd.Init.dma_enable = 0;
hpcd.Init.low_power_enable = 0;
hpcd.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd.Init.Sof_enable = 0;
hpcd.Init.speed = PCD_SPEED_FULL;
hpcd.Init... | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* receive zero lzngth packet on the ctl pipe */ | void usb_ctrlstatusrx(usb_core_instance *pdev) | /* receive zero lzngth packet on the ctl pipe */
void usb_ctrlstatusrx(usb_core_instance *pdev) | {
pdev->dev.device_state = USB_EP0_STATUS_OUT;
usb_readytorx(pdev, 0U, pdev->dev.setup_pkt_buf, 0U);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Refer to SD Physical Layer Simplified Spec 4.1 Section 4.7 for details. */ | EFI_STATUS SdPeimSendStatus(IN SD_PEIM_HC_SLOT *Slot, IN UINT16 Rca, OUT UINT32 *DevStatus) | /* Refer to SD Physical Layer Simplified Spec 4.1 Section 4.7 for details. */
EFI_STATUS SdPeimSendStatus(IN SD_PEIM_HC_SLOT *Slot, IN UINT16 Rca, OUT UINT32 *DevStatus) | {
SD_COMMAND_BLOCK SdCmdBlk;
SD_STATUS_BLOCK SdStatusBlk;
SD_COMMAND_PACKET Packet;
EFI_STATUS Status;
ZeroMem (&SdCmdBlk, sizeof (SdCmdBlk));
ZeroMem (&SdStatusBlk, sizeof (SdStatusBlk));
ZeroMem (&Packet, sizeof (Packet));
Packet.SdCmdBlk = &SdCmdBlk;
Packet.SdStatusBlk = &SdStatusB... | tianocore/edk2 | C++ | Other | 4,240 |
/* Read header/entry members in little-endian format. Returns the offset upto which the read was performed. */ | static size_t read_member(void *src, size_t offset, size_t size_bytes, void *dst) | /* Read header/entry members in little-endian format. Returns the offset upto which the read was performed. */
static size_t read_member(void *src, size_t offset, size_t size_bytes, void *dst) | {
switch (size_bytes) {
case 1:
*(uint8_t *)dst = read_at_le8(src, offset);
break;
case 2:
*(uint16_t *)dst = read_at_le16(src, offset);
break;
case 4:
*(uint32_t *)dst = read_at_le32(src, offset);
break;
case 8:
*(uint64_t *)dst = read_at_le64(src, offset);
break;
default:
ERROR("Read size not ... | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* The function creates a memory based bbt by scanning the device for manufacturer / software marked good / bad blocks. */ | static int nand_memory_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) | /* The function creates a memory based bbt by scanning the device for manufacturer / software marked good / bad blocks. */
static int nand_memory_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) | {
struct nand_chip *this = mtd_to_nand(mtd);
return create_bbt(mtd, this->buffers->databuf, bd, -1);
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Infinite loop procedure to be run on specified CPU. */ | VOID InfiniteLoopProcedure(IN OUT VOID *Buffer) | /* Infinite loop procedure to be run on specified CPU. */
VOID InfiniteLoopProcedure(IN OUT VOID *Buffer) | {
volatile BOOLEAN InfiniteLoop;
InfiniteLoop = TRUE;
while (InfiniteLoop) {
}
} | tianocore/edk2 | C++ | Other | 4,240 |
/* History: <time> <author> <version > <desc> Kingvan 1.0 build this file Find the frame interval closest to the requested frame interval for the given frame format and size. This should be done by the device as part of the Video Probe and Commit negotiation, but some hardware don't implement that feature. */ | static __u32 uvc_try_frame_interval(struct uvc_frame *frame, __u32 interval) | /* History: <time> <author> <version > <desc> Kingvan 1.0 build this file Find the frame interval closest to the requested frame interval for the given frame format and size. This should be done by the device as part of the Video Probe and Commit negotiation, but some hardware don't implement that feature. */
static ... | {
__u32 i;
if (frame->bFrameIntervalType) {
__u32 best = -1, dist;
for (i = 0; i < frame->bFrameIntervalType; ++i) {
dist = interval > frame->dwFrameInterval[i]
? interval - frame->dwFrameInterval[i]
: frame->dwFrameInterval[i] - interval;
... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* param base FlexIO I2S peripheral base address. param handle FlexIO I2S DMA handle pointer. */ | void FLEXIO_I2S_TransferAbortReceiveEDMA(FLEXIO_I2S_Type *base, flexio_i2s_edma_handle_t *handle) | /* param base FlexIO I2S peripheral base address. param handle FlexIO I2S DMA handle pointer. */
void FLEXIO_I2S_TransferAbortReceiveEDMA(FLEXIO_I2S_Type *base, flexio_i2s_edma_handle_t *handle) | {
assert(handle);
EDMA_AbortTransfer(handle->dmaHandle);
FLEXIO_I2S_RxEnableDMA(base, false);
handle->state = kFLEXIO_I2S_Idle;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Adds the result of SDNV which is a time since 2000 to tree. Returns bytes in SDNV or 0 if something goes wrong. */ | static int add_sdnv_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_sdnv_time) | /* Adds the result of SDNV which is a time since 2000 to tree. Returns bytes in SDNV or 0 if something goes wrong. */
static int add_sdnv_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_sdnv_time) | {
nstime_t dtn_time;
int sdnv_length;
int sdnv_value;
sdnv_value = evaluate_sdnv(tvb, offset, &sdnv_length);
if (sdnv_value < 0) {
return 0;
}
dtn_time.secs = (time_t)(sdnv_value + 946684800);
dtn_time.nsecs = 0;
proto_tree_add_time(tree, hf_sdnv_time, tvb, offset, ... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Whoa nelly now it gets really hairy. For some functions (e.g. steal lock for eckd devices) the currently running request has to be terminated and be put back to status queued, before the special request is added to the head of the queue. Then the special request is waited on normally. */ | static int _dasd_term_running_cqr(struct dasd_device *device) | /* Whoa nelly now it gets really hairy. For some functions (e.g. steal lock for eckd devices) the currently running request has to be terminated and be put back to status queued, before the special request is added to the head of the queue. Then the special request is waited on normally. */
static int _dasd_term_runni... | {
struct dasd_ccw_req *cqr;
if (list_empty(&device->ccw_queue))
return 0;
cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, devlist);
return device->discipline->term_IO(cqr);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Get the number of buttons on a joystick */ | int SDL_JoystickNumButtons(SDL_Joystick *joystick) | /* Get the number of buttons on a joystick */
int SDL_JoystickNumButtons(SDL_Joystick *joystick) | {
if ( ! ValidJoystick(&joystick) ) {
return(-1);
}
return(joystick->nbuttons);
} | DC-SWAT/DreamShell | C++ | null | 404 |
/* Change Logs: Date Author Notes Bernard first implementation flyingcys add realtek ameba */ | int main(void) | /* Change Logs: Date Author Notes Bernard first implementation flyingcys add realtek ameba */
int main(void) | {
rt_kprintf("build time: %s %s\n", __DATE__, __TIME__);
rt_kprintf("Hello RT-Thread!\n");
rt_wlan_set_mode(RT_WLAN_DEVICE_STA_NAME, RT_WLAN_STATION);
return 0;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* NOTE. Care should be taken that the channel isn't actually being used by anything when this call is made. */ | void relay_reset(struct rchan *chan) | /* NOTE. Care should be taken that the channel isn't actually being used by anything when this call is made. */
void relay_reset(struct rchan *chan) | {
unsigned int i;
if (!chan)
return;
if (chan->is_global && chan->buf[0]) {
__relay_reset(chan->buf[0], 0);
return;
}
mutex_lock(&relay_channels_mutex);
for_each_possible_cpu(i)
if (chan->buf[i])
__relay_reset(chan->buf[i], 0);
mutex_unlock(&relay_channels_mutex);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Writes an address/data control type register. There are several of these and they all have the format address << 8 | data and bit 31 is polled for completion. */ | s32 igb_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg, u32 offset, u8 data) | /* Writes an address/data control type register. There are several of these and they all have the format address << 8 | data and bit 31 is polled for completion. */
s32 igb_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg, u32 offset, u8 data) | {
u32 i, regvalue = 0;
s32 ret_val = 0;
regvalue = ((u32)data) | (offset << E1000_GEN_CTL_ADDRESS_SHIFT);
wr32(reg, regvalue);
for (i = 0; i < E1000_GEN_POLL_TIMEOUT; i++) {
udelay(5);
regvalue = rd32(reg);
if (regvalue & E1000_GEN_CTL_READY)
break;
}
if (!(regvalue & E1000_GEN_CTL_READY)) {
hw_dbg("R... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Take the ticker API semaphore (if applicable) and wait for operation complete.
In case of synchronous ticker operation, the result is already known at entry, and semaphore is only taken if ret_cb has been updated. This is done to balance take/give counts. If *ret_cb is still TICKER_STATUS_BUSY, but ret is not, the ... | uint32_t ull_ticker_status_take(uint32_t ret, uint32_t volatile *ret_cb) | /* Take the ticker API semaphore (if applicable) and wait for operation complete.
In case of synchronous ticker operation, the result is already known at entry, and semaphore is only taken if ret_cb has been updated. This is done to balance take/give counts. If *ret_cb is still TICKER_STATUS_BUSY, but ret is not, the ... | {
if ((ret == TICKER_STATUS_BUSY) || (*ret_cb != TICKER_STATUS_BUSY)) {
k_sem_take(&sem_ticker_api_cb, K_FOREVER);
return *ret_cb;
}
return ret;
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Function for preparing of flash before receiving SoftDevice image.
This function will erase current application area to ensure sufficient amount of storage for the SoftDevice image. Upon erase complete a callback will be done. See dfu_bank_prepare_t for further details. */ | static void dfu_prepare_func_app_erase(uint32_t image_size) | /* Function for preparing of flash before receiving SoftDevice image.
This function will erase current application area to ensure sufficient amount of storage for the SoftDevice image. Upon erase complete a callback will be done. See dfu_bank_prepare_t for further details. */
static void dfu_prepare_func_app_erase(ui... | {
uint32_t err_code;
mp_storage_handle_active = &m_storage_handle_app;
m_dfu_state = DFU_STATE_PREPARING;
err_code = pstorage_clear(&m_storage_handle_app, m_image_size);
APP_ERROR_CHECK(err_code);
} | labapart/polymcu | C++ | null | 201 |
/* Copy a eeprom memory section to a RAM buffer. */ | static void mem_eeprom_read(void *dst, isp_addr_t src, uint16_t nbytes) | /* Copy a eeprom memory section to a RAM buffer. */
static void mem_eeprom_read(void *dst, isp_addr_t src, uint16_t nbytes) | {
nvm_eeprom_read_buffer( src, dst, nbytes );
} | memfault/zero-to-main | C++ | null | 200 |
/* Clears the ZONE_OOM_LOCKED flag for all zones in the zonelist so that failed allocation attempts with zonelists containing them may now recall the OOM killer, if necessary. */ | void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_mask) | /* Clears the ZONE_OOM_LOCKED flag for all zones in the zonelist so that failed allocation attempts with zonelists containing them may now recall the OOM killer, if necessary. */
void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_mask) | {
struct zoneref *z;
struct zone *zone;
spin_lock(&zone_scan_lock);
for_each_zone_zonelist(zone, z, zonelist, gfp_zone(gfp_mask)) {
zone_clear_flag(zone, ZONE_OOM_LOCKED);
}
spin_unlock(&zone_scan_lock);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Read register content, clear bitmask and write back to register. */ | void ksz8851_reg_clrbits(uint16_t reg, uint16_t bits_to_clr) | /* Read register content, clear bitmask and write back to register. */
void ksz8851_reg_clrbits(uint16_t reg, uint16_t bits_to_clr) | {
uint16_t temp;
temp = ksz8851_reg_read(reg);
temp &= ~(uint32_t) bits_to_clr;
ksz8851_reg_write(reg, temp);
} | memfault/zero-to-main | C++ | null | 200 |
/* Multiply an integer by the 'A24' constant (121665). Partial reduction is performed (down to less than twice the modulus). */ | static void f255_mul_a24(uint32_t *d, const uint32_t *a) | /* Multiply an integer by the 'A24' constant (121665). Partial reduction is performed (down to less than twice the modulus). */
static void f255_mul_a24(uint32_t *d, const uint32_t *a) | {
int i;
uint64_t cc, w;
cc = 0;
for (i = 0; i < 9; i ++) {
w = MUL31(a[i], 121665) + cc;
d[i] = (uint32_t)w & 0x3FFFFFFF;
cc = w >> 30;
}
cc = MUL31((uint32_t)(w >> 15), 19);
d[8] &= 0x7FFF;
for (i = 0; i < 9; i ++) {
w = (uint64_t)d[i] + cc;
d[i] = w & 0x3FFFFFFF;
cc = w >> 30;
}
} | RavenSystem/esp-homekit-devices | C++ | Other | 2,577 |
/* Mark all devices that are children of this device as failed. Mark the device driver too, so that it can see the failure immediately; this is critical, since some drivers poll status registers in interrupts ... If a driver is polling, and the slot is frozen, then the driver can deadlock in an interrupt context, which... | static void __eeh_mark_slot(struct device_node *parent, int mode_flag) | /* Mark all devices that are children of this device as failed. Mark the device driver too, so that it can see the failure immediately; this is critical, since some drivers poll status registers in interrupts ... If a driver is polling, and the slot is frozen, then the driver can deadlock in an interrupt context, which... | {
struct device_node *dn;
for_each_child_of_node(parent, dn) {
if (PCI_DN(dn)) {
struct pci_dev *dev = PCI_DN(dn)->pcidev;
PCI_DN(dn)->eeh_mode |= mode_flag;
if (dev && dev->driver)
dev->error_state = pci_channel_io_frozen;
__eeh_mark_slot(dn, mode_flag);
}
}
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* stinger_interrupt() is called by the low level driver when characters are ready for us. We then buffer them for further processing, or call the packet processing routine. */ | static irqreturn_t stinger_interrupt(struct serio *serio, unsigned char data, unsigned int flags) | /* stinger_interrupt() is called by the low level driver when characters are ready for us. We then buffer them for further processing, or call the packet processing routine. */
static irqreturn_t stinger_interrupt(struct serio *serio, unsigned char data, unsigned int flags) | {
struct stinger *stinger = serio_get_drvdata(serio);
if (stinger->idx < STINGER_MAX_LENGTH)
stinger->data[stinger->idx++] = data;
if (stinger->idx == 4) {
stinger_process_packet(stinger);
stinger->idx = 0;
}
return IRQ_HANDLED;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This object's fields can be written-to by Lua during the read-based function callbacks. In other words, when the Lua plugin's */ | CaptureInfo* push_CaptureInfo(lua_State *L, wtap *wth, const gboolean first_time) | /* This object's fields can be written-to by Lua during the read-based function callbacks. In other words, when the Lua plugin's */
CaptureInfo* push_CaptureInfo(lua_State *L, wtap *wth, const gboolean first_time) | {
luaL_error(L, "Internal error: wth is NULL!");
return NULL;
}
f = (CaptureInfo) g_malloc0(sizeof(struct _wslua_captureinfo));
f->wth = wth;
f->wdh = NULL;
f->expired = FALSE;
if (first_time) {
wth->file_encap = WTAP_ENCAP_UNKNOWN;
wth->file_tsprec = WTAP_TSPREC_... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Determine the "type" of a string: check each character against a supplied "mask". */ | static int type_str(unsigned long value, void *arg) | /* Determine the "type" of a string: check each character against a supplied "mask". */
static int type_str(unsigned long value, void *arg) | {
unsigned long types;
types = *((unsigned long *)arg);
if ((types & B_ASN1_PRINTABLESTRING) && !is_printable(value))
types &= ~B_ASN1_PRINTABLESTRING;
if ((types & B_ASN1_IA5STRING) && (value > 127))
types &= ~B_ASN1_IA5STRING;
if ((types & B_ASN1_T61STRING) && (value > 0xff))
... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* RCU notes: this function is called when a mesh plink transitions from PLINK_ESTAB to any other state, since PLINK_ESTAB state is the only one that allows path creation. This will happen before the sta can be freed (because sta_info_destroy() calls this) so any reader in a rcu read block will be protected against the... | void mesh_path_flush_by_nexthop(struct sta_info *sta) | /* RCU notes: this function is called when a mesh plink transitions from PLINK_ESTAB to any other state, since PLINK_ESTAB state is the only one that allows path creation. This will happen before the sta can be freed (because sta_info_destroy() calls this) so any reader in a rcu read block will be protected against the... | {
struct mesh_path *mpath;
struct mpath_node *node;
struct hlist_node *p;
int i;
for_each_mesh_entry(mesh_paths, p, node, i) {
mpath = node->mpath;
if (mpath->next_hop == sta)
mesh_path_del(mpath->dst, mpath->sdata);
}
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Master transmits the address byte to select the slave device. */ | void I2C_SetSlaveAddress(I2C_TypeDef *I2Cx, u16 Address) | /* Master transmits the address byte to select the slave device. */
void I2C_SetSlaveAddress(I2C_TypeDef *I2Cx, u16 Address) | {
u32 tar = I2Cx->IC_TAR & ~(BIT_CTRL_IC_TAR);
assert_param(IS_I2C_ALL_PERIPH(I2Cx));
I2Cx->IC_TAR = (Address & BIT_CTRL_IC_TAR) | tar;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Calculates the EEPROM checksum by reading/adding each word of the EEPROM and then verifies that the sum of the EEPROM is equal to 0xBABA. */ | s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw) | /* Calculates the EEPROM checksum by reading/adding each word of the EEPROM and then verifies that the sum of the EEPROM is equal to 0xBABA. */
s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw) | {
s32 ret_val;
u16 checksum = 0;
u16 i, nvm_data;
for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
ret_val = e1000_read_nvm(hw, i, 1, &nvm_data);
if (ret_val) {
e_dbg("NVM Read Error\n");
return ret_val;
}
checksum += nvm_data;
}
if (checksum != (u16) NVM_SUM) {
e_dbg("NVM Checksum Invalid\n");
re... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Check if the env is ready for execute specified TRB. */ | EFI_STATUS EmmcPeimCheckTrbEnv(IN UINTN Bar, IN EMMC_TRB *Trb) | /* Check if the env is ready for execute specified TRB. */
EFI_STATUS EmmcPeimCheckTrbEnv(IN UINTN Bar, IN EMMC_TRB *Trb) | {
EFI_STATUS Status;
EMMC_COMMAND_PACKET *Packet;
UINT32 PresentState;
Packet = Trb->Packet;
if ((Packet->EmmcCmdBlk->CommandType == EmmcCommandTypeAdtc) ||
(Packet->EmmcCmdBlk->ResponseType == EmmcResponceTypeR1b) ||
(Packet->EmmcCmdBlk->ResponseType == EmmcResponceTypeR5... | tianocore/edk2 | C++ | Other | 4,240 |
/* Disable the time tick or alarm interrupt of RTC. This function is to disable the time tick or alarm interrupt of RTC. */ | void xRTCIntDisable(unsigned long ulIntType) | /* Disable the time tick or alarm interrupt of RTC. This function is to disable the time tick or alarm interrupt of RTC. */
void xRTCIntDisable(unsigned long ulIntType) | {
xASSERT(( ulIntType == xRTC_INT_SECOND ) ||
( ulIntType == xRTC_INT_ALARM ) ||
( ulIntType == (xRTC_INT_SECOND | xRTC_INT_ALARM) ));
if(ulIntType & xRTC_INT_SECOND)
{
RTCIntCfg((INT_SEC_DIS | INT_MIN_DIS | INT_HOUR_DIS | INT_DOM_DIS |
INT_DOW_DIS | INT_... | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* /proc/net/ip_vs_conn entries Randomly drop connection entries before running out of memory */ | static int todrop_entry(struct ip_vs_conn *cp) | /* /proc/net/ip_vs_conn entries Randomly drop connection entries before running out of memory */
static int todrop_entry(struct ip_vs_conn *cp) | {
static const char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
static char todrop_counter[9] = {0};
int i;
if (time_before(cp->timeout + jiffies, cp->timer.expires + 60*HZ))
return 0;
i = atomic_read(&cp->in_pkts);
if (i > 8 || i < 0) return 0;
if (!todrop_rate[i]) return 0;
if (--todrop_counter[i] > 0) re... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Get The Timer counter interrupt Status. This function is to get timer interrupt status. */ | xtBoolean xTimerStatusGet(unsigned long ulBase, unsigned long ulChannel, unsigned long ulIntFlags) | /* Get The Timer counter interrupt Status. This function is to get timer interrupt status. */
xtBoolean xTimerStatusGet(unsigned long ulBase, unsigned long ulChannel, unsigned long ulIntFlags) | {
xASSERT((ulBase == TIMER0_BASE) || (ulBase == TIMER1_BASE) ||
(ulBase == TIMER2_BASE) || (ulBase == TIMER3_BASE) );
xASSERT((ulChannel == xTIMER_CHANNEL0) || (ulChannel == xTIMER_CHANNEL1));
(void) ulIntFlags;
if(ulChannel == xTIMER_CHANNEL0)
{
return TimerIntStatusCheck(ulBase... | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Before you start, select your target, on the right of the "Load" button */ | int main(void) | /* Before you start, select your target, on the right of the "Load" button */
int main(void) | {
if (TM_DELAY_Time() >= 500) {
TM_DELAY_SetTime(0);
TM_DISCO_LedToggle(LED_RED | LED_GREEN);
}
}
} | MaJerle/stm32f429 | C++ | null | 2,036 |
/* Developed at SunPro, a Sun Microsystems, Inc. business. Permission to use, copy, modify, and distribute this software is freely granted, provided that this notice */ | double sin(double x) | /* Developed at SunPro, a Sun Microsystems, Inc. business. Permission to use, copy, modify, and distribute this software is freely granted, provided that this notice */
double sin(double x) | {
double y[2],z=0.0;
int32_t n, ix;
GET_HIGH_WORD(ix,x);
ix &= 0x7fffffff;
if(ix <= 0x3fe921fb) return __kernel_sin(x,z,0);
else if (ix>=0x7ff00000) return x-x;
else {
n = __ieee754_rem_pio2(x,y);
switch(n&3) {
case 0: return __kernel_sin(y[0],y[1],1);
case 1: return __kernel_cos(y[0],y[1]);
ca... | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Obtains the base address of the flash memory available to the user program. This is basically the last address in the flashLayout table converted to the physical address on the last page (0x3f), because this is where the address will be in. */ | blt_addr FlashGetUserProgBaseAddress(void) | /* Obtains the base address of the flash memory available to the user program. This is basically the last address in the flashLayout table converted to the physical address on the last page (0x3f), because this is where the address will be in. */
blt_addr FlashGetUserProgBaseAddress(void) | {
blt_addr end_address_linear;
blt_addr end_address_physical_page_window;
blt_addr end_address_physical_page_3f;
end_address_linear = FLASH_END_ADDRESS + 1;
end_address_physical_page_window = FlashGetPhysAddr(end_address_linear);
end_address_physical_page_3f = end_address_physical_page_window + FLASH_PAGE_S... | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Main program entry point. This routine configures the hardware required by the application, then enters a loop to run the application tasks in sequence. */ | int main(void) | /* Main program entry point. This routine configures the hardware required by the application, then enters a loop to run the application tasks in sequence. */
int main(void) | {
SetupHardware();
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
GlobalInterruptEnable();
for (;;)
{
if (USB_CurrentMode == USB_MODE_Host)
USBHostMode_USBTask();
else
USBDeviceMode_USBTask();
USB_USBTask();
}
} | prusa3d/Prusa-Firmware-Buddy | C++ | Other | 1,019 |
/* Configures the specified ADC injected channel conversion value offset. */ | void ADC_ConfigInjectedOffset(ADC_T *adc, ADC_INJEC_CHANNEL_T channel, uint16_t offSet) | /* Configures the specified ADC injected channel conversion value offset. */
void ADC_ConfigInjectedOffset(ADC_T *adc, ADC_INJEC_CHANNEL_T channel, uint16_t offSet) | {
__IOM uint32_t tmp = 0;
tmp = (uint32_t)adc;
tmp += channel;
*(__IOM uint32_t *) tmp = (uint32_t)offSet;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Command response callback function for sd_ble_gatts_initial_user_handle_get BLE command.
Callback for decoding the output parameters and the command response return code. */ | static uint32_t gatts_initial_user_handle_get_rsp_dec(const uint8_t *p_buffer, uint16_t length) | /* Command response callback function for sd_ble_gatts_initial_user_handle_get BLE command.
Callback for decoding the output parameters and the command response return code. */
static uint32_t gatts_initial_user_handle_get_rsp_dec(const uint8_t *p_buffer, uint16_t length) | {
uint32_t result_code;
const uint32_t err_code = ble_gatts_initial_user_handle_get_rsp_dec(
p_buffer,
length,
(uint16_t **)&mp_out_params[0],
&result_code);
APP_ERROR_CHECK(err_code);
return result_code;
} | labapart/polymcu | C++ | null | 201 |
/* Call a function (C or Lua). The function to be called is at *func. The arguments are on the stack, right after the function. When returns, all the results are on the stack, starting at the original function position. */ | void luaD_call(lua_State *L, StkId func, int nResults) | /* Call a function (C or Lua). The function to be called is at *func. The arguments are on the stack, right after the function. When returns, all the results are on the stack, starting at the original function position. */
void luaD_call(lua_State *L, StkId func, int nResults) | {
if (L->nCcalls == LUAI_MAXCCALLS)
luaG_runerror(L, "C stack overflow");
else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))
luaD_throw(L, LUA_ERRERR);
}
if (luaD_precall(L, func, nResults) == PCRLUA)
luaV_execute(L, 1);
L->nCcalls--;
luaC_checkGC(L);
} | Nicholas3388/LuaNode | C++ | Other | 1,055 |
/* VCP_DataTx CDC received data to be send over USB IN endpoint are managed in this function. */ | uint16_t VCP_DataTx(uint8_t *Buf, uint32_t Len) | /* VCP_DataTx CDC received data to be send over USB IN endpoint are managed in this function. */
uint16_t VCP_DataTx(uint8_t *Buf, uint32_t Len) | {
APP_Rx_Buffer[APP_Rx_ptr_in] = *(Buf+tx_counter);
APP_Rx_ptr_in++;
if (APP_Rx_ptr_in >= APP_RX_DATA_SIZE) {
APP_Rx_ptr_in = 0;
}
tx_counter++;
}
return USBD_OK;
} | MaJerle/stm32f429 | C++ | null | 2,036 |
/* Returns 0 if access is permitted, an error code otherwise */ | static int smack_inode_getattr(struct vfsmount *mnt, struct dentry *dentry) | /* Returns 0 if access is permitted, an error code otherwise */
static int smack_inode_getattr(struct vfsmount *mnt, struct dentry *dentry) | {
struct smk_audit_info ad;
smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_FS);
smk_ad_setfield_u_fs_path_dentry(&ad, dentry);
smk_ad_setfield_u_fs_path_mnt(&ad, mnt);
return smk_curacc(smk_of_inode(dentry->d_inode), MAY_READ, &ad);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Get the peripheral clock speed for the I2C device at base specified. */ | uint32_t rcc_get_i2c_clk_freq(uint32_t i2c) | /* Get the peripheral clock speed for the I2C device at base specified. */
uint32_t rcc_get_i2c_clk_freq(uint32_t i2c) | {
if (i2c == I2C1_BASE) {
return rcc_uart_i2c_clksel_freq_hz(rcc_apb1_frequency, RCC_CCIPR_I2C1SEL_SHIFT, RCC_CCIPR);
} else if (i2c == I2C2_BASE) {
return rcc_uart_i2c_clksel_freq_hz(rcc_apb1_frequency, RCC_CCIPR_I2C2SEL_SHIFT, RCC_CCIPR);
} else if (i2c == I2C3_BASE) {
return rcc_uart_i2c_clksel_freq_hz(rcc_... | libopencm3/libopencm3 | C++ | GNU General Public License v3.0 | 2,931 |
/* UART MSP Initialization This function configures the hardware resources used in this example: */ | void HAL_UART_MspInit(UART_HandleTypeDef *huart) | /* UART MSP Initialization This function configures the hardware resources used in this example: */
void HAL_UART_MspInit(UART_HandleTypeDef *huart) | {
GPIO_InitTypeDef GPIO_InitStruct;
USARTx_TX_GPIO_CLK_ENABLE();
USARTx_RX_GPIO_CLK_ENABLE();
USARTx_CLK_ENABLE();
GPIO_InitStruct.Pin = USARTx_TX_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
GPIO_InitS... | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* UART MSP De-Initialization This function freeze the hardware resources used in this example. */ | void HAL_UART_MspDeInit(UART_HandleTypeDef *huart) | /* UART MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_UART_MspDeInit(UART_HandleTypeDef *huart) | {
if(huart->Instance==USART2)
{
__HAL_RCC_USART2_CLK_DISABLE();
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
HAL_DMA_DeInit(huart->hdmarx);
HAL_NVIC_DisableIRQ(USART2_IRQn);
}
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* The user Entry Point for module Partition. The user code starts with this function. */ | EFI_STATUS EFIAPI InitializePartition(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) | /* The user Entry Point for module Partition. The user code starts with this function. */
EFI_STATUS EFIAPI InitializePartition(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) | {
EFI_STATUS Status;
Status = EfiLibInstallDriverBindingComponentName2 (
ImageHandle,
SystemTable,
&gPartitionDriverBinding,
ImageHandle,
&gPartitionComponentName,
&gPartitionComponentName2
);
ASSERT_EFI_ERROR (Status);
... | tianocore/edk2 | C++ | Other | 4,240 |
/* returns reg contents (0..255) or < 0 for error */ | int ipath_tempsense_read(struct ipath_devdata *dd, u8 regnum) | /* returns reg contents (0..255) or < 0 for error */
int ipath_tempsense_read(struct ipath_devdata *dd, u8 regnum) | {
int ret;
if (regnum > 7)
return -EINVAL;
if (!((1 << regnum) & VALID_TS_RD_REG_MASK))
return 0;
ret = mutex_lock_interruptible(&dd->ipath_eep_lock);
if (!ret) {
ret = ipath_tempsense_internal_read(dd, regnum);
mutex_unlock(&dd->ipath_eep_lock);
}
return ret;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* If 16-bit I/O port operations are not supported, then ASSERT(). If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). */ | UINT16 EFIAPI S3IoBitFieldRead16(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit) | /* If 16-bit I/O port operations are not supported, then ASSERT(). If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). */
UINT16 EFIAPI S3IoBitFieldRead16(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit) | {
return InternalSaveIoWrite16ValueToBootScript (Port, IoBitFieldRead16 (Port, StartBit, EndBit));
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Event handler for the CCID_PC_to_RDR_IccPowerOn message. This message is sent to the device whenever an application at the host wants to send a power off signal to a slot. THe slot must reply back with a recognizable ATR (answer to reset) */ | uint8_t CALLBACK_CCID_IccPowerOn(USB_ClassInfo_CCID_Device_t *const CCIDInterfaceInfo, const uint8_t slot, uint8_t *const atr, uint8_t *const attrSize, uint8_t *const error) | /* Event handler for the CCID_PC_to_RDR_IccPowerOn message. This message is sent to the device whenever an application at the host wants to send a power off signal to a slot. THe slot must reply back with a recognizable ATR (answer to reset) */
uint8_t CALLBACK_CCID_IccPowerOn(USB_ClassInfo_CCID_Device_t *const CCIDIn... | {
if (slot < CCID_Interface.Config.TotalSlots)
{
Iso7816_CreateSimpleAtr(atr, attrSize);
*error = CCID_ERROR_NO_ERROR;
return CCID_COMMANDSTATUS_PROCESSEDWITHOUTERROR | CCID_ICCSTATUS_PRESENTANDACTIVE;
}
else
{
*error = CCID_ERROR_SLOT_NOT_FOUND;
return CCID_COMMANDSTATUS_FAILED | CCID_ICCSTATUS_NOICCPRE... | prusa3d/Prusa-Firmware-Buddy | C++ | Other | 1,019 |
/* Get free trigger duty interrupt flag of selected channel. */ | uint32_t EPWM_GetFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) | /* Get free trigger duty interrupt flag of selected channel. */
uint32_t EPWM_GetFTDutyIntFlag(EPWM_T *epwm, uint32_t u32ChannelNum) | {
return (((epwm)->FTCI & ((EPWM_FTCI_FTCMU0_Msk | EPWM_FTCI_FTCMD0_Msk) << (u32ChannelNum >> 1))) ? 1UL : 0UL);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Gets the RTC current Calendar Sub seconds value. */ | uint32_t RTC_GetSubSecond(void) | /* Gets the RTC current Calendar Sub seconds value. */
uint32_t RTC_GetSubSecond(void) | {
uint32_t tmpreg = 0;
tmpreg = (uint32_t)(RTC->SSR);
(void) (RTC->DR);
return (tmpreg);
} | MaJerle/stm32f429 | C++ | null | 2,036 |
/* Change Logs: Date Author Notes Bernard first version */ | int finsh_init(struct finsh_parser *parser) | /* Change Logs: Date Author Notes Bernard first version */
int finsh_init(struct finsh_parser *parser) | {
finsh_parser_init(parser);
finsh_node_init();
finsh_var_init();
finsh_error_init();
finsh_heap_init();
return 0;
} | armink/FreeModbus_Slave-Master-RTT-STM32 | C++ | Other | 1,477 |
/* Note: This function must only be called on a remote PHY that has not successfully been added using sas_rphy_add() (or has been sas_rphy_remove()'d) */ | void sas_rphy_free(struct sas_rphy *rphy) | /* Note: This function must only be called on a remote PHY that has not successfully been added using sas_rphy_add() (or has been sas_rphy_remove()'d) */
void sas_rphy_free(struct sas_rphy *rphy) | {
struct device *dev = &rphy->dev;
struct Scsi_Host *shost = dev_to_shost(rphy->dev.parent->parent);
struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
mutex_lock(&sas_host->lock);
list_del(&rphy->list);
mutex_unlock(&sas_host->lock);
sas_bsg_remove(shost, rphy);
transport_destroy_device(dev);
put_dev... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Write scratch pad, read back, then copy to eeprom */ | static int ds18b20_write_scratchpad(const struct device *dev, struct ds18b20_scratchpad scratchpad) | /* Write scratch pad, read back, then copy to eeprom */
static int ds18b20_write_scratchpad(const struct device *dev, struct ds18b20_scratchpad scratchpad) | {
struct ds18b20_data *data = dev->data;
const struct device *bus = ds18b20_bus(dev);
uint8_t sp_data[4] = {
DS18B20_CMD_WRITE_SCRATCHPAD,
scratchpad.alarm_temp_high,
scratchpad.alarm_temp_low,
scratchpad.config
};
return w1_write_read(bus, &data->config, sp_data, sizeof(sp_data), NULL, 0);
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* This API is used to read the temp from register 0x08. */ | BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_temp(s8 *temp_s8) | /* This API is used to read the temp from register 0x08. */
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_read_temp(s8 *temp_s8) | {
u8 data_u8 = BMA2x2_INIT_VALUE;
BMA2x2_RETURN_FUNCTION_TYPE com_rslt = ERROR;
if (p_bma2x2 == BMA2x2_NULL)
{
return E_BMA2x2_NULL_PTR;
}
else
{
com_rslt = p_bma2x2->BMA2x2_BUS_READ_FUNC(
p_bma2x2->dev_addr,
BMA2x2_TEMP_ADDR,
... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Calls the given function for each data element of the datalist. The function is called with each data element's #GQuark id and data, together with the given @user_data parameter. Note that this function is NOT thread-safe. So unless @datalist can be protected from any modifications during invocation of this function... | void g_datalist_foreach(GData **datalist, GDataForeachFunc func, gpointer user_data) | /* Calls the given function for each data element of the datalist. The function is called with each data element's #GQuark id and data, together with the given @user_data parameter. Note that this function is NOT thread-safe. So unless @datalist can be protected from any modifications during invocation of this function... | {
GData *d;
int i, j, len;
GQuark *keys;
g_return_if_fail (datalist != NULL);
g_return_if_fail (func != NULL);
d = G_DATALIST_GET_POINTER (datalist);
if (d == NULL)
return;
len = d->len;
keys = g_new (GQuark, len);
for (i = 0; i < len; i++)
keys[i] = d->data[i].key;
for (i = 0; i < len; i... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Releases ownership of an inbound mailbox resource. Returns 0 if the request has been satisfied. */ | int rio_release_inb_mbox(struct rio_mport *mport, int mbox) | /* Releases ownership of an inbound mailbox resource. Returns 0 if the request has been satisfied. */
int rio_release_inb_mbox(struct rio_mport *mport, int mbox) | {
rio_close_inb_mbox(mport, mbox);
return release_resource(mport->inb_msg[mbox].res);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Internal function to return the frequency of the local APIC timer. */ | UINT32 EFIAPI InternalX86GetTimerFrequency(VOID) | /* Internal function to return the frequency of the local APIC timer. */
UINT32 EFIAPI InternalX86GetTimerFrequency(VOID) | {
UINTN Divisor;
GetApicTimerState (&Divisor, NULL, NULL);
return PcdGet32 (PcdFSBClock) / (UINT32)Divisor;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This function get the variable statistics data from SMM variable driver. */ | EFI_STATUS EFIAPI GetVariableStatisticsData(IN OUT EFI_MM_COMMUNICATE_HEADER *SmmCommunicateHeader, IN OUT UINTN *SmmCommunicateSize) | /* This function get the variable statistics data from SMM variable driver. */
EFI_STATUS EFIAPI GetVariableStatisticsData(IN OUT EFI_MM_COMMUNICATE_HEADER *SmmCommunicateHeader, IN OUT UINTN *SmmCommunicateSize) | {
EFI_STATUS Status;
SMM_VARIABLE_COMMUNICATE_HEADER *SmmVariableFunctionHeader;
CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gEfiSmmVariableProtocolGuid);
SmmCommunicateHeader->MessageLength = *SmmCommunicateSize - OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data);
SmmVariableFunctionHeader... | tianocore/edk2 | C++ | Other | 4,240 |
/* When a PCI device does not exist during config cycles, the 80200 gets a bus error instead of returning 0xffffffff. This handler simply returns. */ | static int iop3xx_pci_abort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | /* When a PCI device does not exist during config cycles, the 80200 gets a bus error instead of returning 0xffffffff. This handler simply returns. */
static int iop3xx_pci_abort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | {
DBG("PCI abort: address = 0x%08lx fsr = 0x%03x PC = 0x%08lx LR = 0x%08lx\n",
addr, fsr, regs->ARM_pc, regs->ARM_lr);
if (fsr & (1 << 10))
regs->ARM_pc += 4;
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Close interface function to upper layer. Each one who wants to close an open SAP (for example NetBEUI) should call this function. Removes this sap from the list of saps in the station and then frees the memory for this sap. */ | void llc_sap_close(struct llc_sap *sap) | /* Close interface function to upper layer. Each one who wants to close an open SAP (for example NetBEUI) should call this function. Removes this sap from the list of saps in the station and then frees the memory for this sap. */
void llc_sap_close(struct llc_sap *sap) | {
WARN_ON(!hlist_empty(&sap->sk_list.list));
llc_del_sap(sap);
kfree(sap);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Creating hash Context.
Change Logs: Date Author Notes tyx the first version */ | struct rt_hwcrypto_ctx* rt_hwcrypto_hash_create(struct rt_hwcrypto_device *device, hwcrypto_type type) | /* Creating hash Context.
Change Logs: Date Author Notes tyx the first version */
struct rt_hwcrypto_ctx* rt_hwcrypto_hash_create(struct rt_hwcrypto_device *device, hwcrypto_type type) | {
struct rt_hwcrypto_ctx *ctx;
ctx = rt_hwcrypto_ctx_create(device, type, sizeof(struct hwcrypto_hash));
return ctx;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Sets the signal's frequency/pulse-width to the specified number of ticks. */ | int pwmSetFrequencyInTicks(uint16_t ticks) | /* Sets the signal's frequency/pulse-width to the specified number of ticks. */
int pwmSetFrequencyInTicks(uint16_t ticks) | {
if (ticks < 1)
{
return -1;
}
TMR_TMR16B1MR3 = (pwmPulseWidth = ticks - 1);
TMR_TMR16B1MR0 = (pwmPulseWidth * (100 - pwmDutyCycle)) / 100;
return 0;
} | microbuilder/LPC1343CodeBase | C++ | Other | 73 |
/* param base IEE peripheral address. param region Selection of the IEE region to be configured. param keyNum Selection of AES KEY1 or KEY2. param key AES key. param keySize Size of AES key. */ | status_t IEE_SetRegionKey(IEE_Type *base, iee_region_t region, iee_aes_key_num_t keyNum, const uint8_t *key, size_t keySize) | /* param base IEE peripheral address. param region Selection of the IEE region to be configured. param keyNum Selection of AES KEY1 or KEY2. param key AES key. param keySize Size of AES key. */
status_t IEE_SetRegionKey(IEE_Type *base, iee_region_t region, iee_aes_key_num_t keyNum, const uint8_t *key, size_t keySize) | {
register const uint32_t *from32 = (const uint32_t *)(uintptr_t)key;
register volatile uint32_t *to32 = NULL;
if (keyNum == kIEE_AesKey1)
{
to32 = &base->REGX[region].REGKEY1[0];
}
else if (keyNum == kIEE_AesKey2)
{
to32 = &base->REGX[region].REGKEY2[0];
}
else
... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on. */ | void GPIOPinTypeSSI(unsigned long ulPort, unsigned char ucPins) | /* The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on. */
void GPIOPinTypeSSI(unsigned long ulPort, unsigned char ucPins) | {
ASSERT(GPIOBaseValid(ulPort));
GPIODirModeSet(ulPort, ucPins, GPIO_DIR_MODE_HW);
GPIOPadConfigSet(ulPort, ucPins, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
} | watterott/WebRadio | C++ | null | 71 |
/* enable or disable I2C ARP protocol in SMBus switch */ | void i2c_smbus_arp_enable(uint32_t i2c_periph, uint32_t arpstate) | /* enable or disable I2C ARP protocol in SMBus switch */
void i2c_smbus_arp_enable(uint32_t i2c_periph, uint32_t arpstate) | {
uint32_t ctl = 0U;
ctl = I2C_CTL0(i2c_periph);
ctl &= ~(I2C_CTL0_ARPEN);
ctl |= arpstate;
I2C_CTL0(i2c_periph) = ctl;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Status command helper function. Display the output data rate of the ADC. */ | static int32_t cn0414_status_odr(struct cn0414_dev *dev) | /* Status command helper function. Display the output data rate of the ADC. */
static int32_t cn0414_status_odr(struct cn0414_dev *dev) | {
int32_t ret;
ad717x_st_reg *temp_ptr;
temp_ptr = AD717X_GetReg(dev->ad4111_device, AD717X_FILTCON0_REG);
ret = usr_uart_write_string(dev->uart_descriptor,
(uint8_t*)"ADC output data rate: ");
if(ret != CN0414_SUCCESS)
return ret;
ret = usr_uart_write_string(dev->uart_descriptor,
odr_options[te... | analogdevicesinc/EVAL-ADICUP3029 | C++ | Other | 36 |
/* TIM MSP Initialization This function configures the hardware resources used in this example: */ | void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim) | /* TIM MSP Initialization This function configures the hardware resources used in this example: */
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim) | {
TIMx_CLK_ENABLE();
HAL_NVIC_SetPriority(TIMx_IRQn, 3, 0);
HAL_NVIC_EnableIRQ(TIMx_IRQn);
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Returns if the channel number is in the valid range (0..15). */ | static int stm32_dma_ch_valid(int ch) | /* Returns if the channel number is in the valid range (0..15). */
static int stm32_dma_ch_valid(int ch) | {
return ch >= 0 && ch < STM32F2_DMA_CH_NUM;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* TIM MSP Initialization This function configures the hardware resources used in this example: */ | void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef *htim) | /* TIM MSP Initialization This function configures the hardware resources used in this example: */
void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef *htim) | {
GPIO_InitTypeDef GPIO_InitStruct;
__HAL_RCC_TIM1_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOE_CLK_ENABLE();
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
GPIO_InitStruct.Alternate = ... | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Return the next parameter's end from a command line string. */ | CONST CHAR16* FindEndOfParameter(IN CONST CHAR16 *String) | /* Return the next parameter's end from a command line string. */
CONST CHAR16* FindEndOfParameter(IN CONST CHAR16 *String) | {
CONST CHAR16 *First;
CONST CHAR16 *CloseQuote;
First = FindFirstCharacter (String, L" \"", L'^');
if (*First == CHAR_NULL) {
return (First);
}
if (*First == L' ') {
return (First);
}
CloseQuote = FindFirstCharacter (First+1, L"\"", L'^');
if (*CloseQuote == CHAR_NULL) {
return (NULL);
... | tianocore/edk2 | C++ | Other | 4,240 |
/* Attribute write call back for the Value V2 attribute. */ | static ssize_t write_value_v2_1(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags) | /* Attribute write call back for the Value V2 attribute. */
static ssize_t write_value_v2_1(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags) | {
char *value = attr->user_data;
if (offset >= sizeof(value_v2_1_value))
return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET);
if (offset + len > sizeof(value_v2_1_value))
return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN);
memcpy(value + offset, buf, len);
return len;
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* retval kStatus_Success Enable Core High Voltage Detect successfully. */ | status_t SPC_EnableActiveModeCoreHighVoltageDetect(SPC_Type *base, bool enable) | /* retval kStatus_Success Enable Core High Voltage Detect successfully. */
status_t SPC_EnableActiveModeCoreHighVoltageDetect(SPC_Type *base, bool enable) | {
status_t status = kStatus_Success;
if (enable)
{
base->ACTIVE_CFG |= SPC_ACTIVE_CFG_CORE_HVDE_MASK;
}
else
{
base->ACTIVE_CFG &= ~SPC_ACTIVE_CFG_CORE_HVDE_MASK;
}
return status;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Store the command-name in cmdname, and return a pointer to the remaining of the command string. */ | static const char* get_command_name(const char *cmdline, char *cmdname, size_t nlen) | /* Store the command-name in cmdname, and return a pointer to the remaining of the command string. */
static const char* get_command_name(const char *cmdline, char *cmdname, size_t nlen) | {
size_t len;
const char *p, *pstart;
p = cmdline;
while (qemu_isspace(*p))
p++;
if (*p == '\0')
return NULL;
pstart = p;
while (*p != '\0' && *p != '/' && !qemu_isspace(*p))
p++;
len = p - pstart;
if (len > nlen - 1)
len = nlen - 1;
memcpy(cmdname... | ve3wwg/teensy3_qemu | C | Other | 15 |
/* I don't know what the parameters are: the first one seems to be a timeval pointer, and I suspect the second one is the time remaining.. Ho humm.. No documentation. */ | SYSCALL_DEFINE2(osf_usleep_thread, struct timeval32 __user *, sleep, struct timeval32 __user *, remain) | /* I don't know what the parameters are: the first one seems to be a timeval pointer, and I suspect the second one is the time remaining.. Ho humm.. No documentation. */
SYSCALL_DEFINE2(osf_usleep_thread, struct timeval32 __user *, sleep, struct timeval32 __user *, remain) | {
struct timeval tmp;
unsigned long ticks;
if (get_tv32(&tmp, sleep))
goto fault;
ticks = timeval_to_jiffies(&tmp);
ticks = schedule_timeout_interruptible(ticks);
if (remain) {
jiffies_to_timeval(ticks, &tmp);
if (put_tv32(remain, &tmp))
goto fault;
}
return 0;
fault:
return -EFAULT;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Locking: mpath->state_lock must be held when calling this function */ | void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta) | /* Locking: mpath->state_lock must be held when calling this function */
void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta) | {
struct sk_buff *skb;
struct ieee80211_hdr *hdr;
struct sk_buff_head tmpq;
unsigned long flags;
rcu_assign_pointer(mpath->next_hop, sta);
__skb_queue_head_init(&tmpq);
spin_lock_irqsave(&mpath->frame_queue.lock, flags);
while ((skb = __skb_dequeue(&mpath->frame_queue)) != NULL) {
hdr = (struct ieee80211_hdr ... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Return TRUE if we have one or more tap listeners that require dissection, FALSE otherwise. */ | gboolean tap_listeners_require_dissection(void) | /* Return TRUE if we have one or more tap listeners that require dissection, FALSE otherwise. */
gboolean tap_listeners_require_dissection(void) | {
volatile tap_listener_t *tap_queue = tap_listener_queue;
while(tap_queue) {
if(!(tap_queue->flags & TL_IS_DISSECTOR_HELPER))
return TRUE;
tap_queue = tap_queue->next;
}
return FALSE;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Otherwise unprivileged userspace fs would be able to block unrelated: */ | static int fuse_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | /* Otherwise unprivileged userspace fs would be able to block unrelated: */
static int fuse_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | {
struct page *page = vmf->page;
struct inode *inode = vma->vm_file->f_mapping->host;
fuse_wait_on_page_writeback(inode, page->index);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This is the declaration of an EFI image entry point. */ | EFI_STATUS EFIAPI RestJsonStructureEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) | /* This is the declaration of an EFI image entry point. */
EFI_STATUS EFIAPI RestJsonStructureEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) | {
EFI_STATUS Status;
InitializeListHead (&mRestJsonStructureList);
mProtocolHandle = NULL;
Status = gBS->InstallProtocolInterface (
&mProtocolHandle,
&gEfiRestJsonStructureProtocolGuid,
EFI_NATIVE_INTERFACE,
... | tianocore/edk2 | C++ | Other | 4,240 |
/* Find an ICPLB entry to be evicted and return its index. */ | static int evict_one_icplb(int cpu) | /* Find an ICPLB entry to be evicted and return its index. */
static int evict_one_icplb(int cpu) | {
int i = first_switched_icplb + icplb_rr_index[cpu];
if (i >= MAX_CPLBS) {
i -= MAX_CPLBS - first_switched_icplb;
icplb_rr_index[cpu] -= MAX_CPLBS - first_switched_icplb;
}
icplb_rr_index[cpu]++;
return i;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Use address to match apertures of memory type and then get the corresponding translation. */ | EFI_STATUS RootBridgeIoGetMemTranslationByAddress(IN PCI_ROOT_BRIDGE_INSTANCE *RootBridge, IN UINT64 Address, IN OUT UINT64 *Translation) | /* Use address to match apertures of memory type and then get the corresponding translation. */
EFI_STATUS RootBridgeIoGetMemTranslationByAddress(IN PCI_ROOT_BRIDGE_INSTANCE *RootBridge, IN UINT64 Address, IN OUT UINT64 *Translation) | {
if ((Address >= RootBridge->Mem.Base) && (Address <= RootBridge->Mem.Limit)) {
*Translation = RootBridge->Mem.Translation;
} else if ((Address >= RootBridge->PMem.Base) && (Address <= RootBridge->PMem.Limit)) {
*Translation = RootBridge->PMem.Translation;
} else if ((Address >= RootBridge->MemAbove4G.Ba... | tianocore/edk2 | C++ | Other | 4,240 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.