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 |
|---|---|---|---|---|---|---|---|
/* Set DMA destination address used by a HDMA channel. */ | void DMA_SetDestinationAddr(unsigned char channel, unsigned int address) | /* Set DMA destination address used by a HDMA channel. */
void DMA_SetDestinationAddr(unsigned char channel, unsigned int address) | {
ASSERT(channel < DMA_CHANNEL_NUM, "this channel does not exist");
AT91C_BASE_HDMA->HDMA_CH[channel].HDMA_DADDR = address;
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Verify if the requested policy is within the limits. */ | static int iec_verify_policy(struct cpufreq_policy *policy) | /* Verify if the requested policy is within the limits. */
static int iec_verify_policy(struct cpufreq_policy *policy) | {
if (policy->cpu != 0)
return -EINVAL;
cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
policy->cpuinfo.max_freq);
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* If FileHandle is NULL, then ASSERT(). If ReadSize is NULL, then ASSERT(). If Buffer is NULL, then ASSERT(). */ | RETURN_STATUS EFIAPI PeCoffLoaderImageReadFromMemory(IN VOID *FileHandle, IN UINTN FileOffset, IN OUT UINTN *ReadSize, OUT VOID *Buffer) | /* If FileHandle is NULL, then ASSERT(). If ReadSize is NULL, then ASSERT(). If Buffer is NULL, then ASSERT(). */
RETURN_STATUS EFIAPI PeCoffLoaderImageReadFromMemory(IN VOID *FileHandle, IN UINTN FileOffset, IN OUT UINTN *ReadSize, OUT VOID *Buffer) | {
ASSERT (ReadSize != NULL);
ASSERT (FileHandle != NULL);
ASSERT (Buffer != NULL);
CopyMem (Buffer, ((UINT8 *)FileHandle) + FileOffset, *ReadSize);
return RETURN_SUCCESS;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Returns: the signed 32-bit integer from the attribute, or 0. */ | gint32 _g_file_attribute_value_get_int32(const GFileAttributeValue *attr) | /* Returns: the signed 32-bit integer from the attribute, or 0. */
gint32 _g_file_attribute_value_get_int32(const GFileAttributeValue *attr) | {
if (attr == NULL)
return 0;
g_return_val_if_fail (attr->type == G_FILE_ATTRIBUTE_TYPE_INT32, 0);
return attr->u.int32;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Configure Pulse divider for IrDA function on UART peripheral. */ | void UART_IrDAPulseDivConfig(LPC_UART_TypeDef *UARTx, UART_IrDA_PULSE_Type PulseDiv) | /* Configure Pulse divider for IrDA function on UART peripheral. */
void UART_IrDAPulseDivConfig(LPC_UART_TypeDef *UARTx, UART_IrDA_PULSE_Type PulseDiv) | {
uint32_t tmp, tmp1;
tmp1 = UART_ICR_PULSEDIV(PulseDiv);
tmp = UARTx->ICR & (~ UART_ICR_PULSEDIV(7));
tmp |= tmp1 | UART_ICR_FIXPULSE_EN;
UARTx->ICR = tmp & UART_ICR_BITMASK;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* PCD MSP De-Initialization This function freeze the hardware resources used in this example. */ | void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd) | /* PCD MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd) | {
if(hpcd->Instance==USB_OTG_FS)
{
__HAL_RCC_USB_OTG_FS_CLK_DISABLE();
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_12|GPIO_PIN_11);
HAL_NVIC_DisableIRQ(OTG_FS_EP1_OUT_IRQn);
HAL_NVIC_DisableIRQ(OTG_FS_EP1_IN_IRQn);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* See what I mean about userspace being boring? */ | static struct device* new_device(const char *name, u16 type) | /* See what I mean about userspace being boring? */
static struct device* new_device(const char *name, u16 type) | {
struct device *dev = malloc(sizeof(*dev));
dev->desc = new_dev_desc(type);
dev->name = name;
dev->vq = NULL;
dev->feature_len = 0;
dev->num_vq = 0;
dev->running = false;
if (devices.lastdev)
devices.lastdev->next = dev;
else
devices.dev = dev;
devices.lastdev = dev;
return dev;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Generates a Software interrupt on selected EXTI line. */ | void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line) | /* Generates a Software interrupt on selected EXTI line. */
void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line) | {
assert_param(IS_EXTI_LINE_EXT(EXTI_Line));
*(__IO uint32_t *) (((uint32_t) &(EXTI->SWIER)) + ((EXTI_Line) >> 5 ) * 0x20) |= (uint32_t)(1 << (EXTI_Line & 0x1F));
} | ajhc/demo-cortex-m3 | C++ | null | 38 |
/* Sets the Number of consecutive SDRAM Memory auto Refresh commands. */ | void FMC_SetAutoRefresh_Number(uint32_t FMC_Number) | /* Sets the Number of consecutive SDRAM Memory auto Refresh commands. */
void FMC_SetAutoRefresh_Number(uint32_t FMC_Number) | {
assert_param(IS_FMC_AUTOREFRESH_NUMBER(FMC_Number));
FMC_Bank5_6->SDCMR |= (FMC_Number << 5);
} | MaJerle/stm32f429 | C++ | null | 2,036 |
/* This API reads the sensor status from the sensor. */ | uint16_t bma4_get_status(uint8_t *status, struct bma4_dev *dev) | /* This API reads the sensor status from the sensor. */
uint16_t bma4_get_status(uint8_t *status, struct bma4_dev *dev) | {
uint16_t rslt = 0;
uint8_t data = 0;
if (dev == NULL) {
rslt |= BMA4_E_NULL_PTR;
} else {
rslt |= bma4_read_regs(BMA4_STATUS_ADDR, &data, 1, dev);
if (rslt == BMA4_OK)
*status = data;
}
return rslt;
} | arendst/Tasmota | C++ | GNU General Public License v3.0 | 21,318 |
/* Enables or disables the DMA Tx Desc end of ring. */ | void ETH_EnableDmaTxDescEndOfRing(ETH_DMADescType *DMATxDesc, FunctionalState Cmd) | /* Enables or disables the DMA Tx Desc end of ring. */
void ETH_EnableDmaTxDescEndOfRing(ETH_DMADescType *DMATxDesc, FunctionalState Cmd) | {
assert_param(IS_FUNCTIONAL_STATE(Cmd));
if (Cmd != DISABLE)
{
DMATxDesc->CtrlOrBufSize |= ETH_DMA_TX_DESC_TER;
}
else
{
DMATxDesc->CtrlOrBufSize &= (~(uint32_t)ETH_DMA_TX_DESC_TER);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Blank the screen if blank_mode != 0, else unblank. Implements VESA suspend and powerdown modes on hardware that supports disabling hsync/vsync: @blank_mode == 2 means suspend vsync, @blank_mode == 3 means suspend hsync, @blank_mode == 4 means powerdown. */ | static int hgafb_blank(int blank_mode, struct fb_info *info) | /* Blank the screen if blank_mode != 0, else unblank. Implements VESA suspend and powerdown modes on hardware that supports disabling hsync/vsync: @blank_mode == 2 means suspend vsync, @blank_mode == 3 means suspend hsync, @blank_mode == 4 means powerdown. */
static int hgafb_blank(int blank_mode, struct fb_info *info) | {
hga_blank(blank_mode);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Get Remote Device Address.
This API is used to get the address of the remote device currently connected with the handle specified in nConnHandle. */ | ADI_BLER_RESULT adi_radio_GetConnectionAddr(const uint16_t nConnHandle, uint8_t *const pBleAddr) | /* Get Remote Device Address.
This API is used to get the address of the remote device currently connected with the handle specified in nConnHandle. */
ADI_BLER_RESULT adi_radio_GetConnectionAddr(const uint16_t nConnHandle, uint8_t *const pBleAddr) | {
ADI_BLER_RESULT bleResult;
ASSERT(pBleAddr != NULL);
ADI_BLE_LOGEVENT(LOGID_CMD_BLEGAP_GET_BD_ADDR);
ADI_BLE_RADIO_CMD_START(CMD_BLEGAP_GET_BD_ADDR);
memcpy(&pBLERadio->cmdPkt[ADI_RADIO_CMD_HEADER_LEN], &nConnHandle, 2u);
bleResult = bler_process_cmd(CMD_BLEGAP_GET_BD_ADDR, 2u, pBleAddr, 6u);
if(bleResult == ADI_BLER_SUCCESS){
bleResult = ADI_BLE_WAIT_FOR_COMPLETION(ADI_EVENT_FLAG_RESP_SUCCESS,ADI_BLER_CMD_TIMEOUT);
}
ADI_BLE_RADIO_CMD_END();
return (bleResult);
} | analogdevicesinc/EVAL-ADICUP3029 | C++ | Other | 36 |
/* Description: This should be set to the lowest possible sector size that the hardware can operate on without reverting to read-modify-write operations. */ | void blk_queue_physical_block_size(struct request_queue *q, unsigned short size) | /* Description: This should be set to the lowest possible sector size that the hardware can operate on without reverting to read-modify-write operations. */
void blk_queue_physical_block_size(struct request_queue *q, unsigned short size) | {
q->limits.physical_block_size = size;
if (q->limits.physical_block_size < q->limits.logical_block_size)
q->limits.physical_block_size = q->limits.logical_block_size;
if (q->limits.io_min < q->limits.physical_block_size)
q->limits.io_min = q->limits.physical_block_size;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Write a general register set. As for PTRACE_GETREGS, we always use the 64-bit format. On a 32-bit kernel only the lower order half (according to endianness) will be used. */ | int ptrace_setregs(struct task_struct *child, __s64 __user *data) | /* Write a general register set. As for PTRACE_GETREGS, we always use the 64-bit format. On a 32-bit kernel only the lower order half (according to endianness) will be used. */
int ptrace_setregs(struct task_struct *child, __s64 __user *data) | {
struct pt_regs *regs;
int i;
if (!access_ok(VERIFY_READ, data, 38 * 8))
return -EIO;
regs = task_pt_regs(child);
for (i = 0; i < 32; i++)
__get_user(regs->regs[i], data + i);
__get_user(regs->lo, data + EF_LO - EF_R0);
__get_user(regs->hi, data + EF_HI - EF_R0);
__get_user(regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Message: UnSubscribeDtmfPayloadErrMessage Opcode: 0x012e Type: CallControl Direction: pbx2dev VarLength: no */ | static void handle_UnSubscribeDtmfPayloadErrMessage(ptvcursor_t *cursor, packet_info *pinfo _U_) | /* Message: UnSubscribeDtmfPayloadErrMessage Opcode: 0x012e Type: CallControl Direction: pbx2dev VarLength: no */
static void handle_UnSubscribeDtmfPayloadErrMessage(ptvcursor_t *cursor, packet_info *pinfo _U_) | {
ptvcursor_add(cursor, hf_skinny_payloadDtmf, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(cursor, hf_skinny_passthruPartyID, 4, ENC_LITTLE_ENDIAN);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Receives a byte that has been sent to the I2C Master(Blocking). */ | unsigned long I2CDataGetBlocking(unsigned long ulBase) | /* Receives a byte that has been sent to the I2C Master(Blocking). */
unsigned long I2CDataGetBlocking(unsigned long ulBase) | {
xASSERT((ulBase == I2C1_BASE) || (ulBase == I2C2_BASE));
while((xHWREG(ulBase + I2C_SR1) & I2C_SR1_RXNE) == 0);
return(xHWREG(ulBase + I2C_DR));
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Starts intermediate checksum computation.
Configures the CRC module for the specified CRC protocol. */ | static void crc_SetRawProtocolConfig(CRC_Type *base, const crc_config_t *protocolConfig) | /* Starts intermediate checksum computation.
Configures the CRC module for the specified CRC protocol. */
static void crc_SetRawProtocolConfig(CRC_Type *base, const crc_config_t *protocolConfig) | {
crc_module_config_t moduleConfig;
moduleConfig.polynomial = protocolConfig->polynomial;
moduleConfig.seed = protocolConfig->seed;
moduleConfig.readTranspose =
kCrcTransposeNone;
moduleConfig.writeTranspose = crc_GetTransposeTypeFromReflectIn(protocolConfig->reflectIn);
moduleConfig.complementChecksum = false;
moduleConfig.crcBits = protocolConfig->crcBits;
crc_ConfigureAndStart(base, &moduleConfig);
} | labapart/polymcu | C++ | null | 201 |
/* Find out how much time remains before a timer must be run. */ | static uint32_t lv_timer_time_remaining(lv_timer_t *timer) | /* Find out how much time remains before a timer must be run. */
static uint32_t lv_timer_time_remaining(lv_timer_t *timer) | {
uint32_t elp = lv_tick_elaps(timer->last_run);
if(elp >= timer->period)
return 0;
return timer->period - elp;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* This function is called when user space has no more references on the base object. It releases the base-object's reference on the resource object. */ | static void vmw_user_stream_base_release(struct ttm_base_object **p_base) | /* This function is called when user space has no more references on the base object. It releases the base-object's reference on the resource object. */
static void vmw_user_stream_base_release(struct ttm_base_object **p_base) | {
struct ttm_base_object *base = *p_base;
struct vmw_user_stream *stream =
container_of(base, struct vmw_user_stream, base);
struct vmw_resource *res = &stream->stream.res;
*p_base = NULL;
vmw_resource_unreference(&res);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Add window as first child in parent's linked list.
This function adds a child window as the top window of a parent. */ | static void win_add_top_child(struct win_window *parent, struct win_window *child) | /* Add window as first child in parent's linked list.
This function adds a child window as the top window of a parent. */
static void win_add_top_child(struct win_window *parent, struct win_window *child) | {
if (parent->top_child == NULL) {
child->next_sibling = child;
child->prev_sibling = child;
} else {
child->next_sibling = parent->top_child;
child->prev_sibling = parent->top_child->prev_sibling;
child->next_sibling->prev_sibling = child;
child->prev_sibling->next_sibling = child;
}
parent->top_child = child;
child->parent = parent;
} | memfault/zero-to-main | C++ | null | 200 |
/* Functions related to generic timeout handling of requests. blk_delete_timer - Delete/cancel timer for a given function. @req: request that we are canceling timer for */ | void blk_delete_timer(struct request *req) | /* Functions related to generic timeout handling of requests. blk_delete_timer - Delete/cancel timer for a given function. @req: request that we are canceling timer for */
void blk_delete_timer(struct request *req) | {
list_del_init(&req->timeout_list);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* 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 = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
if(huart->Instance==USART1)
{
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USART1;
PeriphClkInitStruct.Usart16ClockSelection = RCC_USART16CLKSOURCE_D2PCLK2;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
Error_Handler();
}
__HAL_RCC_USART1_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* According to the Device Tree specification, s2.3.5 "#address-cells and
#size-cells": "If missing, a client program should assume a default value of 2 for
#address-cells, and a value of 1 for #size-cells." */ | EFI_STATUS EFIAPI FdtGetParentAddressInfo(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *AddressCells, OPTIONAL OUT INT32 *SizeCells OPTIONAL) | /* According to the Device Tree specification, s2.3.5 "#address-cells and
#size-cells": "If missing, a client program should assume a default value of 2 for
#address-cells, and a value of 1 for #size-cells." */
EFI_STATUS EFIAPI FdtGetParentAddressInfo(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *AddressCells, OPTIONAL OUT INT32 *SizeCells OPTIONAL) | {
if (Fdt == NULL) {
ASSERT (0);
return EFI_INVALID_PARAMETER;
}
Node = fdt_parent_offset (Fdt, Node);
if (Node < 0) {
ASSERT (0);
return EFI_ABORTED;
}
return FdtGetAddressInfo (Fdt, Node, AddressCells, SizeCells);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* In case the rate change propagation to parent clocks is undesirable, this function is recursively called to find the parent to calculate the accurate frequency. */ | static int mtk_clk_find_parent_rate(struct clk *clk, int id, const struct driver *drv) | /* In case the rate change propagation to parent clocks is undesirable, this function is recursively called to find the parent to calculate the accurate frequency. */
static int mtk_clk_find_parent_rate(struct clk *clk, int id, const struct driver *drv) | {
struct clk parent = { .id = id, };
if (drv) {
struct udevice *dev;
if (uclass_get_device_by_driver(UCLASS_CLK, drv, &dev))
return -ENODEV;
parent.dev = dev;
} else {
parent.dev = clk->dev;
}
return clk_get_rate(&parent);
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Helper routine, converts 'pmctwi_cmd' struct to register format */ | static u32 pmcmsptwi_cmd_to_reg(const struct pmcmsptwi_cmd *cmd) | /* Helper routine, converts 'pmctwi_cmd' struct to register format */
static u32 pmcmsptwi_cmd_to_reg(const struct pmcmsptwi_cmd *cmd) | {
return ((cmd->type & 0x3) << 8) |
(((cmd->write_len - 1) & 0x7) << 4) |
((cmd->read_len - 1) & 0x7);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Attribute read call back for the Value V11 (128-bit UUID) attribute. */ | static ssize_t read_value_v11__128_bit_uuid(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, uint16_t len, uint16_t offset) | /* Attribute read call back for the Value V11 (128-bit UUID) attribute. */
static ssize_t read_value_v11__128_bit_uuid(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, uint16_t len, uint16_t offset) | {
const uint8_t *value = attr->user_data;
if (!bAuthorized)
return BT_GATT_ERR(BT_ATT_ERR_AUTHORIZATION);
return bt_gatt_attr_read(conn, attr, buf, len, offset, value,
sizeof(value_v11__128_bit_uuid_value));
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Open SIR (IrDA) mode on the specified UART.
The */ | void UARTIrDAConfig(unsigned long ulBase, unsigned long ulConfig) | /* Open SIR (IrDA) mode on the specified UART.
The */
void UARTIrDAConfig(unsigned long ulBase, unsigned long ulConfig) | {
xASSERT(UARTBaseValid(ulBase));
UARTEnableIrDA(ulBase);
xHWREG(ulBase + UART_IRCR) = (ulConfig);
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Searches a string for the first occurrence of a character contained in a specified buffer. */ | CHAR16* EFIAPI StrBrk(IN CHAR16 *String, IN CHAR16 *CharSet) | /* Searches a string for the first occurrence of a character contained in a specified buffer. */
CHAR16* EFIAPI StrBrk(IN CHAR16 *String, IN CHAR16 *CharSet) | {
CHAR16 *Str1;
CHAR16 *Str2;
for (Str1 = String; *Str1 != L'\0'; Str1++) {
for (Str2 = CharSet; *Str2 != L'\0'; Str2++) {
if (*Str1 == *Str2) {
return (CHAR16 *)Str1;
}
}
}
return NULL;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Clears the selected timer interrupt.
ui32Interrupt should be the logical OR of one or more of the following values: */ | void am_hal_ctimer_int_clear(uint32_t ui32Interrupt) | /* Clears the selected timer interrupt.
ui32Interrupt should be the logical OR of one or more of the following values: */
void am_hal_ctimer_int_clear(uint32_t ui32Interrupt) | {
AM_REGn(CTIMER, 0, INTCLR) = ui32Interrupt;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Returns 0 on success, a negative error code otherwise. */ | int nand_reset_op(struct nand_chip *chip) | /* Returns 0 on success, a negative error code otherwise. */
int nand_reset_op(struct nand_chip *chip) | {
struct mtd_info *mtd = nand_to_mtd(chip);
chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
return 0;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Enable the irq on the current core for chips that have the EN*_W1{S,C} registers. */ | static void octeon_irq_ciu1_enable_v2(unsigned int irq) | /* Enable the irq on the current core for chips that have the EN*_W1{S,C} registers. */
static void octeon_irq_ciu1_enable_v2(unsigned int irq) | {
int index = cvmx_get_core_num() * 2 + 1;
u64 mask = 1ull << (irq - OCTEON_IRQ_WDOG0);
cvmx_write_csr(CVMX_CIU_INTX_EN1_W1S(index), mask);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This function is called when memory window unbind which we are waiting for completes. Just use rr_func (zeroed by upcall) to signal completion. */ | static void rpcrdma_unbind_func(struct rpcrdma_rep *rep) | /* This function is called when memory window unbind which we are waiting for completes. Just use rr_func (zeroed by upcall) to signal completion. */
static void rpcrdma_unbind_func(struct rpcrdma_rep *rep) | {
wake_up(&rep->rr_unbind);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This function handles RTC Auto wake-up interrupt request. */ | void RTC_WKUP_IRQHandler(void) | /* This function handles RTC Auto wake-up interrupt request. */
void RTC_WKUP_IRQHandler(void) | {
HAL_RTCEx_WakeUpTimerIRQHandler(&RTCHandle);
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Build cpu to node mapping and initialize the per node cpu masks using info from the node_cpuid array handed to us by ACPI. */ | void __init build_cpu_to_node_map(void) | /* Build cpu to node mapping and initialize the per node cpu masks using info from the node_cpuid array handed to us by ACPI. */
void __init build_cpu_to_node_map(void) | {
int cpu, i, node;
for(node=0; node < MAX_NUMNODES; node++)
cpus_clear(node_to_cpu_mask[node]);
for_each_possible_early_cpu(cpu) {
node = -1;
for (i = 0; i < NR_CPUS; ++i)
if (cpu_physical_id(cpu) == node_cpuid[i].phys_id) {
node = node_cpuid[i].nid;
break;
}
map_cpu_to_node(cpu, node);
}
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* If the input is NULL, base on the record highlight info in gHighligthMenuInfo to find the last highlight menu. */ | LIST_ENTRY* FindHighLightMenuOption(IN FORM_DISPLAY_ENGINE_STATEMENT *HighLightedStatement) | /* If the input is NULL, base on the record highlight info in gHighligthMenuInfo to find the last highlight menu. */
LIST_ENTRY* FindHighLightMenuOption(IN FORM_DISPLAY_ENGINE_STATEMENT *HighLightedStatement) | {
LIST_ENTRY *NewPos;
UI_MENU_OPTION *MenuOption;
NewPos = gMenuOption.ForwardLink;
MenuOption = MENU_OPTION_FROM_LINK (NewPos);
if (HighLightedStatement != NULL) {
while (MenuOption->ThisTag != HighLightedStatement) {
NewPos = NewPos->ForwardLink;
if (NewPos == &gMenuOption) {
break;
}
MenuOption = MENU_OPTION_FROM_LINK (NewPos);
}
ASSERT (NewPos != &gMenuOption);
} else {
while (!IsHighLightMenuOption (MenuOption)) {
NewPos = NewPos->ForwardLink;
if (NewPos == &gMenuOption) {
break;
}
MenuOption = MENU_OPTION_FROM_LINK (NewPos);
}
if (NewPos == &gMenuOption) {
NewPos = NULL;
}
}
return NewPos;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Opens the connection with the serial port configured as 8,N,1 and no flow control. */ | static uint32_t SerialConvertBaudrate(tSerialPortBaudrate baudrate) | /* Opens the connection with the serial port configured as 8,N,1 and no flow control. */
static uint32_t SerialConvertBaudrate(tSerialPortBaudrate baudrate) | {
uint32_t result;
switch (baudrate)
{
case SERIALPORT_BR9600:
result = CBR_9600;
break;
case SERIALPORT_BR19200:
result = CBR_19200;
break;
case SERIALPORT_BR38400:
result = CBR_38400;
break;
case SERIALPORT_BR57600:
result = CBR_57600;
break;
case SERIALPORT_BR115200:
result = CBR_115200;
break;
default:
result = CBR_9600;
break;
}
return result;
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* this function is a POSIX compliant version, which shall request that all data for the open file descriptor named by fildes is to be transferred to the storage device associated with the file described by fildes. */ | int fsync(int fildes) | /* this function is a POSIX compliant version, which shall request that all data for the open file descriptor named by fildes is to be transferred to the storage device associated with the file described by fildes. */
int fsync(int fildes) | {
int ret;
struct dfs_fd *d;
d = fd_get(fildes);
if (d == NULL)
{
rt_set_errno(-EBADF);
return -1;
}
ret = dfs_file_flush(d);
fd_put(d);
return ret;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* XXX - should this get an "is_close" argument, and match even closed policy handles if the call is a close, so we can handle retransmitted close operations? */ | gboolean dcerpc_fetch_polhnd_data(e_ctx_hnd *policy_hnd, char **name, guint32 *type, guint32 *open_frame, guint32 *close_frame, guint32 cur_frame) | /* XXX - should this get an "is_close" argument, and match even closed policy handles if the call is a close, so we can handle retransmitted close operations? */
gboolean dcerpc_fetch_polhnd_data(e_ctx_hnd *policy_hnd, char **name, guint32 *type, guint32 *open_frame, guint32 *close_frame, guint32 cur_frame) | {
pol_hash_value *value;
pol_value *pol;
if (name)
*name = NULL;
if (type)
*type = 0;
if (open_frame)
*open_frame = 0;
if (close_frame)
*close_frame = 0;
pol = find_pol_handle(policy_hnd, cur_frame, &value);
if (pol) {
if (name)
*name = pol->name;
if (type)
*type = pol->type;
if (open_frame)
*open_frame = pol->open_frame;
if (close_frame)
*close_frame = pol->close_frame;
}
return pol != NULL;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* SYSCTRL CMP Bus Clock Disable and Reset Assert. */ | void LL_SYSCTRL_CMP_ClkDisRstAssert(void) | /* SYSCTRL CMP Bus Clock Disable and Reset Assert. */
void LL_SYSCTRL_CMP_ClkDisRstAssert(void) | {
__LL_SYSCTRL_CTRLReg_Unlock(SYSCTRL);
__LL_SYSCTRL_CMPBusClk_Dis(SYSCTRL);
__LL_SYSCTRL_CMPSoftRst_Assert(SYSCTRL);
__LL_SYSCTRL_Reg_Lock(SYSCTRL);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* edma_clear_event - clear an outstanding event on the DMA channel Arguments: channel - channel number */ | void edma_clear_event(unsigned channel) | /* edma_clear_event - clear an outstanding event on the DMA channel Arguments: channel - channel number */
void edma_clear_event(unsigned channel) | {
unsigned ctlr;
ctlr = EDMA_CTLR(channel);
channel = EDMA_CHAN_SLOT(channel);
if (channel >= edma_info[ctlr]->num_channels)
return;
if (channel < 32)
edma_write(ctlr, EDMA_ECR, 1 << channel);
else
edma_write(ctlr, EDMA_ECRH, 1 << (channel - 32));
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Returns: TRUE if the @enumerator has pending operations. */ | gboolean g_file_enumerator_has_pending(GFileEnumerator *enumerator) | /* Returns: TRUE if the @enumerator has pending operations. */
gboolean g_file_enumerator_has_pending(GFileEnumerator *enumerator) | {
g_return_val_if_fail (G_IS_FILE_ENUMERATOR (enumerator), TRUE);
return enumerator->priv->pending;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Returns the LSB of the 9-bit CANx Transmit Error Counter(TEC). */ | uint8_t CAN_Peli_GetLSBTransmitErrorCounter(CAN_TypeDef *CANx) | /* Returns the LSB of the 9-bit CANx Transmit Error Counter(TEC). */
uint8_t CAN_Peli_GetLSBTransmitErrorCounter(CAN_TypeDef *CANx) | {
uint8_t counter = 0;
assert_param(IS_CAN_ALL_PERIPH(CANx));
switch (*(uint32_t*)&CANx)
{
case CAN1_BASE:
counter = (uint8_t)(CAN1_PELI->TXERR);
break;
case CAN2_BASE:
counter = (uint8_t)(CAN2_PELI->TXERR);
break;
default:
break;
}
return counter;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This function find LockBox by GUID from SMRAM. */ | SMM_LOCK_BOX_DATA* InternalFindLockBoxByGuidFromSmram(IN LIST_ENTRY *LockBoxQueue, IN EFI_GUID *Guid) | /* This function find LockBox by GUID from SMRAM. */
SMM_LOCK_BOX_DATA* InternalFindLockBoxByGuidFromSmram(IN LIST_ENTRY *LockBoxQueue, IN EFI_GUID *Guid) | {
LIST_ENTRY *Link;
SMM_LOCK_BOX_DATA *LockBox;
for (Link = InternalInitLinkDxe (LockBoxQueue);
Link != LockBoxQueue;
Link = InternalNextLinkDxe (Link))
{
LockBox = BASE_CR (
Link,
SMM_LOCK_BOX_DATA,
Link
);
if (CompareGuid (&LockBox->Guid, Guid)) {
return LockBox;
}
}
return NULL;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is returned. If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned. If Alignment is not a power of two and Alignment is not zero, then ASSERT(). */ | VOID* EFIAPI AllocateAlignedPages(IN UINTN Pages, IN UINTN Alignment) | /* Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is returned. If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned. If Alignment is not a power of two and Alignment is not zero, then ASSERT(). */
VOID* EFIAPI AllocateAlignedPages(IN UINTN Pages, IN UINTN Alignment) | {
VOID *Memory;
UINTN AlignmentMask;
ASSERT ((Alignment & (Alignment - 1)) == 0);
if (Pages == 0) {
return NULL;
}
ASSERT (Pages <= (MAX_ADDRESS - EFI_SIZE_TO_PAGES (Alignment)));
Memory = (VOID *)(UINTN)AllocatePages (Pages + EFI_SIZE_TO_PAGES (Alignment));
if (Alignment == 0) {
AlignmentMask = Alignment;
} else {
AlignmentMask = Alignment - 1;
}
return (VOID *)(UINTN)(((UINTN)Memory + AlignmentMask) & ~AlignmentMask);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Gets the captured data for a sample sequence using software oversampling. */ | void ADCSoftwareOversampleDataGet(uint32_t ui32Base, uint32_t ui32SequenceNum, uint32_t *pui32Buffer, uint32_t ui32Count) | /* Gets the captured data for a sample sequence using software oversampling. */
void ADCSoftwareOversampleDataGet(uint32_t ui32Base, uint32_t ui32SequenceNum, uint32_t *pui32Buffer, uint32_t ui32Count) | {
uint32_t ui32Idx, ui32Accum;
ASSERT((ui32Base == ADC0_BASE) || (ui32Base == ADC1_BASE));
ASSERT(ui32SequenceNum < 3);
ASSERT(((ui32SequenceNum == 0) &&
(ui32Count < (8 >> g_pui8OversampleFactor[ui32SequenceNum]))) ||
(ui32Count < (4 >> g_pui8OversampleFactor[ui32SequenceNum])));
ui32Base += ADC_SEQ + (ADC_SEQ_STEP * ui32SequenceNum);
while(ui32Count--)
{
ui32Accum = 0;
for(ui32Idx = 1 << g_pui8OversampleFactor[ui32SequenceNum]; ui32Idx;
ui32Idx--)
{
ui32Accum += HWREG(ui32Base + ADC_SSFIFO);
}
*pui32Buffer++ = ui32Accum >> g_pui8OversampleFactor[ui32SequenceNum];
}
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Initializes the USB controller registers and prepares the core device mode or host mode operation. */ | void usb_initusbcore(LL_USB_TypeDef *USBx, USB_CORE_BASIC_CFGS *basic_cfgs) | /* Initializes the USB controller registers and prepares the core device mode or host mode operation. */
void usb_initusbcore(LL_USB_TypeDef *USBx, USB_CORE_BASIC_CFGS *basic_cfgs) | {
usb_coresoftrst(USBx);
usb_PhySelect(USBx, basic_cfgs->phy_type);
usb_coresoftrst(USBx);
usb_mdelay(20UL);
if (basic_cfgs->dmaen == 1U) {
usb_BurstLenConfig(USBx, 5U);
usb_DmaCmd(USBx, 1U);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Registers an interrupt handler for the comparator interrupt. */ | void ComparatorIntRegister(uint32_t ui32Base, uint32_t ui32Comp, void(*pfnHandler)(void)) | /* Registers an interrupt handler for the comparator interrupt. */
void ComparatorIntRegister(uint32_t ui32Base, uint32_t ui32Comp, void(*pfnHandler)(void)) | {
ASSERT(ui32Base == COMP_BASE);
ASSERT(ui32Comp < 3);
IntRegister(INT_COMP0 + ui32Comp, pfnHandler);
IntEnable(INT_COMP0 + ui32Comp);
HWREG(ui32Base + COMP_O_ACINTEN) |= 1 << ui32Comp;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Serializes a puback packet into the supplied buffer. */ | int MQTTSerialize_puback(unsigned char *buf, int buflen, unsigned short packetid) | /* Serializes a puback packet into the supplied buffer. */
int MQTTSerialize_puback(unsigned char *buf, int buflen, unsigned short packetid) | {
return MQTTSerialize_ack(buf, buflen, PUBACK, 0, packetid);
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* @event: the event for which this notification function is registered @context: event context - not used in this function */ | static void EFIAPI efi_network_timer_notify(struct efi_event *event, void *context) | /* @event: the event for which this notification function is registered @context: event context - not used in this function */
static void EFIAPI efi_network_timer_notify(struct efi_event *event, void *context) | {
struct efi_simple_network *this = (struct efi_simple_network *)context;
EFI_ENTRY("%p, %p", event, context);
if (!this || this->mode->state != EFI_NETWORK_INITIALIZED)
goto out;
if (!new_rx_packet) {
push_packet = efi_net_push;
eth_rx();
push_packet = NULL;
if (new_rx_packet) {
if (net_rx_packet_len >=
sizeof(struct ethernet_hdr)) {
this->int_status |=
EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT;
wait_for_packet->is_signaled = true;
} else {
new_rx_packet = 0;
}
}
}
out:
EFI_EXIT(EFI_SUCCESS);
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Get the I2C time out flag of the specified I2C port.
The */ | xtBoolean I2CTimeoutFlagGet(unsigned long ulBase, unsigned long ulTimeout) | /* Get the I2C time out flag of the specified I2C port.
The */
xtBoolean I2CTimeoutFlagGet(unsigned long ulBase, unsigned long ulTimeout) | {
xASSERT((ulBase == I2C0_BASE) || ((ulBase == I2C1_BASE)));
xASSERT((ulBase == I2C_TIMEOUT_SCL_LOW) ||
(ulBase == I2C_TIMEOUT_SCL_HIGH2) ||
(ulBase == I2C_TIMEOUT_SCL_HIGH1));
return ((xHWREGB(ulBase + I2C_SMB) & ulTimeout) ? xtrue : xfalse);
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* param handle codec handle. return kStatus_Success is success, else de-initial failed. */ | status_t HAL_CODEC_Deinit(void *handle) | /* param handle codec handle. return kStatus_Success is success, else de-initial failed. */
status_t HAL_CODEC_Deinit(void *handle) | {
assert(handle != NULL);
return DA7212_Deinit((da7212_handle_t *)((uint32_t)(((codec_handle_t *)handle)->codecDevHandle)));
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Parallel hash function ParallelHash256, as defined in NIST's Special Publication 800-185, published December 2016. */ | BOOLEAN EFIAPI ParallelHash256HashAll(IN CONST VOID *Input, IN UINTN InputByteLen, IN UINTN BlockSize, OUT VOID *Output, IN UINTN OutputByteLen, IN CONST VOID *Customization, IN UINTN CustomByteLen) | /* Parallel hash function ParallelHash256, as defined in NIST's Special Publication 800-185, published December 2016. */
BOOLEAN EFIAPI ParallelHash256HashAll(IN CONST VOID *Input, IN UINTN InputByteLen, IN UINTN BlockSize, OUT VOID *Output, IN UINTN OutputByteLen, IN CONST VOID *Customization, IN UINTN CustomByteLen) | {
CALL_CRYPTO_SERVICE (ParallelHash256HashAll, (Input, InputByteLen, BlockSize, Output, OutputByteLen, Customization, CustomByteLen), FALSE);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Callback when we get an message from the MQTT broker. */ | static size_t on_publish(struct mqtt_client_t *client_p, const char *topic_p, void *chin_p, size_t size) | /* Callback when we get an message from the MQTT broker. */
static size_t on_publish(struct mqtt_client_t *client_p, const char *topic_p, void *chin_p, size_t size) | {
uint8_t buf[16];
int unread, toread;
std_printf(OSTR("on_publish: %s = "), topic_p);
for (unread = size; unread > 0; unread -= toread) {
toread = MIN(unread, sizeof(buf) - 1);
chan_read(chin_p, buf, toread);
buf[toread] = '\0';
std_printf(OSTR("%s"), &buf[0]);
}
std_printf(OSTR("\r\n"));
message_count++;
return (0);
} | eerimoq/simba | C++ | Other | 337 |
/* Loads an icon asynchronously. To finish this function, see g_loadable_icon_load_finish(). For the synchronous, blocking version of this function, see g_loadable_icon_load(). */ | void g_loadable_icon_load_async(GLoadableIcon *icon, int size, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) | /* Loads an icon asynchronously. To finish this function, see g_loadable_icon_load_finish(). For the synchronous, blocking version of this function, see g_loadable_icon_load(). */
void g_loadable_icon_load_async(GLoadableIcon *icon, int size, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) | {
GLoadableIconIface *iface;
g_return_if_fail (G_IS_LOADABLE_ICON (icon));
iface = G_LOADABLE_ICON_GET_IFACE (icon);
(* iface->load_async) (icon, size, cancellable, callback, user_data);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Disable the Capture input of the PWM module.
The */ | void PWMCAPInputDisable(unsigned long ulBase, unsigned long ulChannel) | /* Disable the Capture input of the PWM module.
The */
void PWMCAPInputDisable(unsigned long ulBase, unsigned long ulChannel) | {
unsigned long ulChannelTemp;
ulChannelTemp = (ulBase == PWMA_BASE) ? ulChannel : (ulChannel - 4);
xASSERT(ulBase == PWMA_BASE);
xASSERT(((ulChannelTemp >= 0) || (ulChannelTemp <= 3)));
xHWREG(ulBase + PWM_CAPENR) &= ~(PWM_CAPENR_CAPIE_0 << (ulChannelTemp));
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Q7 neural network activation function using direct table look-up.
Assume here the integer part of the fixed-point is <= 3. More than 3 just not making much sense, makes no difference with saturation followed by any of these activation functions. */ | void arm_nn_activations_direct_q7(q7_t *data, uint16_t size, uint16_t int_width, arm_nn_activation_type type) | /* Q7 neural network activation function using direct table look-up.
Assume here the integer part of the fixed-point is <= 3. More than 3 just not making much sense, makes no difference with saturation followed by any of these activation functions. */
void arm_nn_activations_direct_q7(q7_t *data, uint16_t size, uint16_t int_width, arm_nn_activation_type type) | {
uint16_t i = size;
q7_t *pIn = data;
q7_t *pOut = data;
q7_t in;
q7_t out;
uint16_t shift_size = 3 - int_width;
const q7_t *lookup_table;
switch (type)
{
case ARM_SIGMOID:
lookup_table = sigmoidTable_q7;
break;
case ARM_TANH:
default:
lookup_table = tanhTable_q7;
break;
}
while (i)
{
in = *pIn++;
out = lookup_table[(uint8_t)(in >> shift_size)];
*pOut++ = out;
i--;
}
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Queue a data sent to a callback. If the connector workqueue is already created, we queue the job on it. Otherwise, we queue the job to kevent and queue the connector workqueue creation too. */ | int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work) | /* Queue a data sent to a callback. If the connector workqueue is already created, we queue the job on it. Otherwise, we queue the job to kevent and queue the connector workqueue creation too. */
int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work) | {
struct cn_queue_dev *pdev = cbq->pdev;
if (likely(pdev->cn_queue))
return queue_work(pdev->cn_queue, work);
if (atomic_inc_return(&pdev->wq_requested) == 1)
schedule_work(&pdev->wq_creation);
else
atomic_dec(&pdev->wq_requested);
return schedule_work(work);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Implementation of handler named in startup code.
Passes 0 to generic PWM IRQ handler. */ | void PWMA_CMP1_IRQHandler(void) | /* Implementation of handler named in startup code.
Passes 0 to generic PWM IRQ handler. */
void PWMA_CMP1_IRQHandler(void) | {
PWM_HAL_ClearCmpFlags(g_pwmBase[0], 1U, 0x3fU);
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Find an MSN entry in the list. If ia5 != 0, return IA5-encoded EAZ, else return a bitmask with corresponding bit set. */ | static __u16 act2000_find_msn(act2000_card *card, char *msn, int ia5) | /* Find an MSN entry in the list. If ia5 != 0, return IA5-encoded EAZ, else return a bitmask with corresponding bit set. */
static __u16 act2000_find_msn(act2000_card *card, char *msn, int ia5) | {
struct msn_entry *p = card->msn_list;
__u8 eaz = '0';
while (p) {
if (!strcmp(p->msn, msn)) {
eaz = p->eaz;
break;
}
p = p->next;
}
if (!ia5)
return (1 << (eaz - '0'));
else
return eaz;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The Timer 0 default IRQ, declared in start up code. */ | void TIMER0IntHandler(void) | /* The Timer 0 default IRQ, declared in start up code. */
void TIMER0IntHandler(void) | {
unsigned long ulBase = TIMER0_BASE;
unsigned long ulTemp0;
ulTemp0 = xHWREG(ulBase + TIMER_ICTR) ;
xHWREG(ulBase + TIMER_ICTR) = ulTemp0;
if (g_pfnTimerHandlerCallbacks[0] != 0)
{
g_pfnTimerHandlerCallbacks[0](0, 0, ulTemp0, 0);
}
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Return the thread ID of the current running thread. */ | osThreadId osThreadGetId(void) | /* Return the thread ID of the current running thread. */
osThreadId osThreadGetId(void) | {
if (g_threads[index].handle == handle) {
return (osThreadId)&g_threads[index];
}
}
return NULL;
} | labapart/polymcu | C++ | null | 201 |
/* Unregisters a USB host callback.
Unregisters an asynchronous callback implemented by the user. Removing it from the internal callback registration table. */ | enum status_code usb_host_unregister_callback(struct usb_module *module_inst, enum usb_host_callback callback_type) | /* Unregisters a USB host callback.
Unregisters an asynchronous callback implemented by the user. Removing it from the internal callback registration table. */
enum status_code usb_host_unregister_callback(struct usb_module *module_inst, enum usb_host_callback callback_type) | {
Assert(module_inst);
module_inst->host_callback[callback_type] = NULL;
module_inst->host_registered_callback_mask &= ~(1 << callback_type);
return STATUS_OK;
} | memfault/zero-to-main | C++ | null | 200 |
/* Get the current system clock frequency.
This function can be used to determine the frequency of the main system clock. The return value is the system clock frequency measured in hertz. */ | uint32_t am_hal_clkgen_sysclk_get(void) | /* Get the current system clock frequency.
This function can be used to determine the frequency of the main system clock. The return value is the system clock frequency measured in hertz. */
uint32_t am_hal_clkgen_sysclk_get(void) | {
uint32_t ui32ClockSetting;
ui32ClockSetting = AM_REG(CLKGEN, CCTRL) & AM_REG_CLKGEN_CCTRL_CORESEL_M;
switch ( ui32ClockSetting )
{
case AM_REG_CLKGEN_CCTRL_CORESEL_HFRC:
return 48000000;
case AM_REG_CLKGEN_CCTRL_CORESEL_HFRC_DIV2:
return 24000000;
default:
return 0xFFFFFFFF;
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* We have our own local lfind() equivalent to avoid subtle differences in types passed to lfind() on different systems. */ | static void* td_lfind(const void *key, const void *base, size_t *nmemb, size_t size, int(*compar)(const void *, const void *)) | /* We have our own local lfind() equivalent to avoid subtle differences in types passed to lfind() on different systems. */
static void* td_lfind(const void *key, const void *base, size_t *nmemb, size_t size, int(*compar)(const void *, const void *)) | {
char *element, *end;
end = (char *)base + *nmemb * size;
for (element = (char *)base; element < end; element += size)
if (!compar(key, element))
return element;
return NULL;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Clear the 3-wire SPI start interrupt flag of the specified SPI port. */ | void SPI3WireStartIntFlagClear(unsigned long ulBase) | /* Clear the 3-wire SPI start interrupt flag of the specified SPI port. */
void SPI3WireStartIntFlagClear(unsigned long ulBase) | {
xASSERT((ulBase == SPI0_BASE) || (ulBase == SPI1_BASE)||
(ulBase == SPI2_BASE) || (ulBase == SPI3_BASE));
xHWREG(ulBase + SPI_CNTRL2) |= SPI_CNTRL2_SLV_START_INTSTS;
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Writes a data byte to the I2C transmit FIFO. */ | void I2CFIFODataPut(uint32_t ui32Base, uint8_t ui8Data) | /* Writes a data byte to the I2C transmit FIFO. */
void I2CFIFODataPut(uint32_t ui32Base, uint8_t ui8Data) | {
ASSERT(_I2CBaseValid(ui32Base));
while (HWREG(ui32Base + I2C_O_FIFOSTATUS) & I2C_FIFOSTATUS_TXFF)
{
}
HWREG(ui32Base + I2C_O_FIFODATA) = ui8Data;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Clears or safeguards the OCREF1 signal on an external event. */ | void TIM_ClearOC1Ref(TIM_TypeDef *tim, TIMOCCE_Typedef clear) | /* Clears or safeguards the OCREF1 signal on an external event. */
void TIM_ClearOC1Ref(TIM_TypeDef *tim, TIMOCCE_Typedef clear) | {
MODIFY_REG(tim->CCMR1, TIM_CCMR1_OC1CEN, clear);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Read TC Register B (RB) on the specified channel. */ | uint32_t tc_read_rb(Tc *p_tc, uint32_t ul_channel) | /* Read TC Register B (RB) on the specified channel. */
uint32_t tc_read_rb(Tc *p_tc, uint32_t ul_channel) | {
Assert(p_tc);
Assert(ul_channel <
(sizeof(p_tc->TC_CHANNEL) / sizeof(p_tc->TC_CHANNEL[0])));
return p_tc->TC_CHANNEL[ul_channel].TC_RB;
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Initializes peripherals used by the I2C EEPROM driver. */ | void sEE_Init(void) | /* Initializes peripherals used by the I2C EEPROM driver. */
void sEE_Init(void) | {
I2C_InitTypeDef I2C_InitStructure;
sEE_I2C_LowLevel_Init();
I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;
I2C_InitStructure.I2C_AnalogFilter = I2C_AnalogFilter_Enable;
I2C_InitStructure.I2C_DigitalFilter = 0x00;
I2C_InitStructure.I2C_OwnAddress1 = 0x00;
I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;
I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
I2C_InitStructure.I2C_Timing = sEE_I2C_TIMING;
I2C_Init(sEE_I2C, &I2C_InitStructure);
I2C_Cmd(sEE_I2C, ENABLE);
sEEAddress = sEE_HW_ADDRESS;
} | avem-labs/Avem | C++ | MIT License | 1,752 |
/* Interrupt routine that simply wakes vButtonHandlerTask on each interrupt generated by a push of the built in button. The wrapper takes care of the ISR entry. This then calls the actual handler function to perform the work. This work should not be done in the wrapper itself unless you are absolutely sure that no stack space is used. */ | void vButtonISRWrapper(void) | /* Interrupt routine that simply wakes vButtonHandlerTask on each interrupt generated by a push of the built in button. The wrapper takes care of the ISR entry. This then calls the actual handler function to perform the work. This work should not be done in the wrapper itself unless you are absolutely sure that no stack space is used. */
void vButtonISRWrapper(void) | {
extern xSemaphoreHandle xButtonSemaphore;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
xSemaphoreGiveFromISR( xButtonSemaphore, &xHigherPriorityTaskWoken );
if( xHigherPriorityTaskWoken )
{
portYIELD_FROM_ISR();
}
EXTINT = isrCLEAR_EINT_1;
VICVectAddr = 0;
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Get Timer6 period number when valid period function enable. */ | uint32_t TMR6_GetPeriodNum(const CM_TMR6_TypeDef *TMR6x) | /* Get Timer6 period number when valid period function enable. */
uint32_t TMR6_GetPeriodNum(const CM_TMR6_TypeDef *TMR6x) | {
DDL_ASSERT(IS_VALID_TMR6_UNIT(TMR6x));
return (READ_REG32_BIT(TMR6x->STFLR, TMR6_STFLR_VPERNUM) >> TMR6_STFLR_VPERNUM_POS);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This function parses the PCC Subspace type 1. */ | STATIC VOID DumpPccSubspaceType1(IN UINT8 *Ptr, IN UINT8 Length) | /* This function parses the PCC Subspace type 1. */
STATIC VOID DumpPccSubspaceType1(IN UINT8 *Ptr, IN UINT8 Length) | {
ParseAcpi (
TRUE,
2,
"Subspace Type 1",
Ptr,
Length,
PARSER_PARAMS (PccSubspaceType1Parser)
);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Handle an interrupt from the Ethernet MAC when configured with scatter-gather DMA. The only interrupts handled in this case are errors. */ | static void HandleEmacDmaIntr(XEmac *InstancePtr) | /* Handle an interrupt from the Ethernet MAC when configured with scatter-gather DMA. The only interrupts handled in this case are errors. */
static void HandleEmacDmaIntr(XEmac *InstancePtr) | {
u32 IntrStatus;
IntrStatus = XIIF_V123B_READ_IISR(InstancePtr->BaseAddress);
XIIF_V123B_WRITE_IISR(InstancePtr->BaseAddress, IntrStatus);
XEmac_CheckEmacError(InstancePtr, IntrStatus);
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* the lock will time out in 5 minutes unless we extend it, so schedule extension in a bit less than that time */ | static void afs_schedule_lock_extension(struct afs_vnode *vnode) | /* the lock will time out in 5 minutes unless we extend it, so schedule extension in a bit less than that time */
static void afs_schedule_lock_extension(struct afs_vnode *vnode) | {
queue_delayed_work(afs_lock_manager, &vnode->lock_work,
AFS_LOCKWAIT * HZ / 2);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* some regions of the IO address space do not get translated, so we must not give devices IO addresses in those regions. The regions are the 640KB-1MB region and the two PCI peripheral memory holes. Reserve all of them in the IOMMU bitmap to avoid giving them out later. */ | static void __init calgary_reserve_regions(struct pci_dev *dev) | /* some regions of the IO address space do not get translated, so we must not give devices IO addresses in those regions. The regions are the 640KB-1MB region and the two PCI peripheral memory holes. Reserve all of them in the IOMMU bitmap to avoid giving them out later. */
static void __init calgary_reserve_regions(struct pci_dev *dev) | {
unsigned int npages;
u64 start;
struct iommu_table *tbl = pci_iommu(dev->bus);
iommu_range_reserve(tbl, DMA_ERROR_CODE, EMERGENCY_PAGES);
if (is_calgary(dev->device)) {
start = (640 * 1024);
npages = ((1024 - 640) * 1024) >> PAGE_SHIFT;
} else {
start = 0;
npages = (1 * 1024 * 1024) >> PAGE_SHIFT;
}
iommu_range_reserve(tbl, start, npages);
calgary_reserve_peripheral_mem_1(dev);
calgary_reserve_peripheral_mem_2(dev);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This function retrieves the capabilities of the nominated task and returns them to the caller. */ | int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted) | /* This function retrieves the capabilities of the nominated task and returns them to the caller. */
int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted) | {
const struct cred *cred;
rcu_read_lock();
cred = __task_cred(target);
*effective = cred->cap_effective;
*inheritable = cred->cap_inheritable;
*permitted = cred->cap_permitted;
rcu_read_unlock();
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* param base LPUART peripheral base address. param lpuartEdmaHandle LPUART handle pointer. */ | void LPUART_TransferEdmaHandleIRQ(LPUART_Type *base, void *lpuartEdmaHandle) | /* param base LPUART peripheral base address. param lpuartEdmaHandle LPUART handle pointer. */
void LPUART_TransferEdmaHandleIRQ(LPUART_Type *base, void *lpuartEdmaHandle) | {
assert(lpuartEdmaHandle != NULL);
if (((uint32_t)kLPUART_TransmissionCompleteFlag & LPUART_GetStatusFlags(base)) != 0U)
{
lpuart_edma_handle_t *handle = (lpuart_edma_handle_t *)lpuartEdmaHandle;
LPUART_DisableInterrupts(base, (uint32_t)kLPUART_TransmissionCompleteInterruptEnable);
handle->txState = (uint8_t)kLPUART_TxIdle;
if (handle->callback != NULL)
{
handle->callback(base, handle, kStatus_LPUART_TxIdle, handle->userData);
}
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* ... and that one is done if evict_chunk() decides to delay until the end of syscall. Runs synchronously. */ | void audit_kill_trees(struct list_head *list) | /* ... and that one is done if evict_chunk() decides to delay until the end of syscall. Runs synchronously. */
void audit_kill_trees(struct list_head *list) | {
mutex_lock(&audit_cmd_mutex);
mutex_lock(&audit_filter_mutex);
while (!list_empty(list)) {
struct audit_tree *victim;
victim = list_entry(list->next, struct audit_tree, list);
kill_rules(victim);
list_del_init(&victim->list);
mutex_unlock(&audit_filter_mutex);
prune_one(victim);
mutex_lock(&audit_filter_mutex);
}
mutex_unlock(&audit_filter_mutex);
mutex_unlock(&audit_cmd_mutex);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Time Stamp Update Coarse When reset the timestamp update is done using coarse method. */ | void synopGMAC_TS_coarse_update(synopGMACdevice *gmacdev) | /* Time Stamp Update Coarse When reset the timestamp update is done using coarse method. */
void synopGMAC_TS_coarse_update(synopGMACdevice *gmacdev) | {
synopGMACClearBits(gmacdev->MacBase,GmacTSControl,GmacTSCFUPDT);
return;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* ADC MSP De-Initialization This function frees the hardware resources used in this application: */ | void HAL_ADC_MspDeInit(ADC_HandleTypeDef *hadc) | /* ADC MSP De-Initialization This function frees the hardware resources used in this application: */
void HAL_ADC_MspDeInit(ADC_HandleTypeDef *hadc) | {
static DMA_HandleTypeDef hdma_adc;
ADCx_FORCE_RESET();
ADCx_RELEASE_RESET();
HAL_GPIO_DeInit(ADCx_CHANNEL_GPIO_PORT, ADCx_CHANNEL_PIN);
HAL_DMA_DeInit(&hdma_adc);
HAL_NVIC_DisableIRQ(ADCx_DMA_IRQn);
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* ixgbe_clear_vmdq_82598 - Disassociate a VMDq set index from an rx address @hw: pointer to hardware struct @rar: receive address register index to associate with a VMDq index @vmdq: VMDq clear index (not used in 82598, but elsewhere) */ | static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) | /* ixgbe_clear_vmdq_82598 - Disassociate a VMDq set index from an rx address @hw: pointer to hardware struct @rar: receive address register index to associate with a VMDq index @vmdq: VMDq clear index (not used in 82598, but elsewhere) */
static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) | {
u32 rar_high;
u32 rar_entries = hw->mac.num_rar_entries;
if (rar < rar_entries) {
rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(rar));
if (rar_high & IXGBE_RAH_VIND_MASK) {
rar_high &= ~IXGBE_RAH_VIND_MASK;
IXGBE_WRITE_REG(hw, IXGBE_RAH(rar), rar_high);
}
} else {
hw_dbg(hw, "RAR index %d is out of range.\n", rar);
}
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Disables the processor clock, making the device enter Idle mode. */ | void PMC_DisableProcessorClock(void) | /* Disables the processor clock, making the device enter Idle mode. */
void PMC_DisableProcessorClock(void) | {
AT91C_BASE_PMC->PMC_SCDR = AT91C_PMC_PCK;
while ((AT91C_BASE_PMC->PMC_SCSR & AT91C_PMC_PCK) != AT91C_PMC_PCK);
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Backing store (temporary file) management. Backing store objects are only used when the value returned by jpeg_mem_available is less than the total space needed. You can dispense with these routines if you have plenty of virtual memory; see jmemnobs.c. */ | read_backing_store(j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count) | /* Backing store (temporary file) management. Backing store objects are only used when the value returned by jpeg_mem_available is less than the total space needed. You can dispense with these routines if you have plenty of virtual memory; see jmemnobs.c. */
read_backing_store(j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count) | {
long bytes = byte_count;
long retVal;
if ( SetFPos ( info->temp_file, fsFromStart, file_offset ) != noErr )
ERREXIT(cinfo, JERR_TFILE_SEEK);
retVal = FSRead ( info->temp_file, &bytes,
(unsigned char *) buffer_address );
if ( retVal != noErr || bytes != byte_count )
ERREXIT(cinfo, JERR_TFILE_READ);
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Send initialization arrays to start up, this just follows the initialisation sequence in the adip. */ | static void __devinit init_arrays(struct snd_emu8000 *emu) | /* Send initialization arrays to start up, this just follows the initialisation sequence in the adip. */
static void __devinit init_arrays(struct snd_emu8000 *emu) | {
send_array(emu, init1, ARRAY_SIZE(init1)/4);
msleep((1024 * 1000) / 44100);
send_array(emu, init2, ARRAY_SIZE(init2)/4);
send_array(emu, init3, ARRAY_SIZE(init3)/4);
EMU8000_HWCF4_WRITE(emu, 0);
EMU8000_HWCF5_WRITE(emu, 0x83);
EMU8000_HWCF6_WRITE(emu, 0x8000);
send_array(emu, init4, ARRAY_SIZE(init4)/4);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* HPF or SLOPE filter selection on wake-up and Activity/Inactivity functions.. */ | int32_t lsm6dsl_xl_hp_path_internal_set(stmdev_ctx_t *ctx, lsm6dsl_slope_fds_t val) | /* HPF or SLOPE filter selection on wake-up and Activity/Inactivity functions.. */
int32_t lsm6dsl_xl_hp_path_internal_set(stmdev_ctx_t *ctx, lsm6dsl_slope_fds_t val) | {
lsm6dsl_tap_cfg_t tap_cfg;
int32_t ret;
ret = lsm6dsl_read_reg(ctx, LSM6DSL_TAP_CFG, (uint8_t*)&tap_cfg, 1);
if(ret == 0){
tap_cfg.slope_fds = (uint8_t) val;
ret = lsm6dsl_write_reg(ctx, LSM6DSL_TAP_CFG, (uint8_t*)&tap_cfg, 1);
}
return ret;
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Get the length of received data in RX ring buffer.
@userData handle LPUART handle pointer. */ | static size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle) | /* Get the length of received data in RX ring buffer.
@userData handle LPUART handle pointer. */
static size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle) | {
size_t size;
if (handle->rxRingBufferTail > handle->rxRingBufferHead)
{
size = (size_t)(handle->rxRingBufferHead + handle->rxRingBufferSize - handle->rxRingBufferTail);
}
else
{
size = (size_t)(handle->rxRingBufferHead - handle->rxRingBufferTail);
}
return size;
} | labapart/polymcu | C++ | null | 201 |
/* If the directory updating is defered then yaffs_update_dirty_dirs must be called periodically. */ | static void yaffs_update_parent(struct yaffs_obj *obj) | /* If the directory updating is defered then yaffs_update_dirty_dirs must be called periodically. */
static void yaffs_update_parent(struct yaffs_obj *obj) | {
struct yaffs_dev *dev;
if (!obj)
return;
dev = obj->my_dev;
obj->dirty = 1;
yaffs_load_current_time(obj, 0, 1);
if (dev->param.defered_dir_update) {
struct list_head *link = &obj->variant.dir_variant.dirty;
if (list_empty(link)) {
list_add(link, &dev->dirty_dirs);
yaffs_trace(YAFFS_TRACE_BACKGROUND,
"Added object %d to dirty directories",
obj->obj_id);
}
} else {
yaffs_update_oh(obj, NULL, 0, 0, 0, NULL);
}
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* TIM_Base MSP De-Initialization This function freeze the hardware resources used in this example. */ | void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim_base) | /* TIM_Base MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim_base) | {
if(htim_base->Instance==TIM5)
{
__HAL_RCC_TIM5_CLK_DISABLE();
}
else if(htim_base->Instance==TIM11)
{
__HAL_RCC_TIM11_CLK_DISABLE();
}
else if(htim_base->Instance==TIM13)
{
__HAL_RCC_TIM13_CLK_DISABLE();
}
else if(htim_base->Instance==TIM14)
{
__HAL_RCC_TIM14_CLK_DISABLE();
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Returns: count of non-reversible conversions, or -1 on error */ | gsize g_iconv(GIConv converter, gchar **inbuf, gsize *inbytes_left, gchar **outbuf, gsize *outbytes_left) | /* Returns: count of non-reversible conversions, or -1 on error */
gsize g_iconv(GIConv converter, gchar **inbuf, gsize *inbytes_left, gchar **outbuf, gsize *outbytes_left) | {
iconv_t cd = (iconv_t)converter;
return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Allocate a bestcomm task structure for transmitting data to a PSC. */ | struct bcom_task* bcom_psc_gen_bd_tx_init(unsigned psc_num, int queue_len, phys_addr_t fifo) | /* Allocate a bestcomm task structure for transmitting data to a PSC. */
struct bcom_task* bcom_psc_gen_bd_tx_init(unsigned psc_num, int queue_len, phys_addr_t fifo) | {
struct psc;
return bcom_gen_bd_tx_init(queue_len, fifo,
bcom_psc_params[psc_num].tx_initiator,
bcom_psc_params[psc_num].tx_ipr);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Search & probe for supported 32-bit (pmode) pcap devices Libpcap version string. */ | const char* pcap_lib_version(void) | /* Search & probe for supported 32-bit (pmode) pcap devices Libpcap version string. */
const char* pcap_lib_version(void) | {
return ("DOS-" PCAP_VERSION_STRING);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* ADC Disable The Temperature Sensor.
Disabling this will reduce power consumption from the sensor and the reference voltage measurements. */ | void adc_disable_temperature_sensor() | /* ADC Disable The Temperature Sensor.
Disabling this will reduce power consumption from the sensor and the reference voltage measurements. */
void adc_disable_temperature_sensor() | {
ADC_CCR &= ~ADC_CCR_TSVREFE;
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* Disable RTC Timer wake-up function that chip can be waken up from power down mode by Time Tick or Alarm Match. */ | void RTCWakeupDisable(void) | /* Disable RTC Timer wake-up function that chip can be waken up from power down mode by Time Tick or Alarm Match. */
void RTCWakeupDisable(void) | {
xHWREG(RTC_IER) &= ~RTC_IER_WPON;
xHWREG(RTC_CR) &= ~RTC_CR_WPE;
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Clears all bits in the bitmap and writes the whole bitmap to stable storage. */ | int drbd_bmio_clear_n_write(struct drbd_conf *mdev) | /* Clears all bits in the bitmap and writes the whole bitmap to stable storage. */
int drbd_bmio_clear_n_write(struct drbd_conf *mdev) | {
int rv = -EIO;
if (get_ldev_if_state(mdev, D_ATTACHING)) {
drbd_bm_clear_all(mdev);
rv = drbd_bm_write(mdev);
put_ldev(mdev);
}
return rv;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Returns: (transfer full) (element-type utf8): a list of the keys on @settings */ | gchar** g_settings_list_keys(GSettings *settings) | /* Returns: (transfer full) (element-type utf8): a list of the keys on @settings */
gchar** g_settings_list_keys(GSettings *settings) | {
return g_settings_schema_list_keys (settings->priv->schema);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Return: 0 if all went fine and the device ID is valid, else return appropriate error. */ | static int ti_sci_cmd_dev_is_valid(const struct ti_sci_handle *handle, u32 id) | /* Return: 0 if all went fine and the device ID is valid, else return appropriate error. */
static int ti_sci_cmd_dev_is_valid(const struct ti_sci_handle *handle, u32 id) | {
u8 unused;
return ti_sci_get_device_state(handle, id, NULL, NULL, NULL, &unused);
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* gc_n64_read_packet() reads an N64 packet. Each pad uses one bit per byte. So all pads connected to this port are read in parallel. */ | static void gc_n64_read_packet(struct gc *gc, unsigned char *data) | /* gc_n64_read_packet() reads an N64 packet. Each pad uses one bit per byte. So all pads connected to this port are read in parallel. */
static void gc_n64_read_packet(struct gc *gc, unsigned char *data) | {
int i;
unsigned long flags;
local_irq_save(flags);
for (i = 0; i < GC_N64_REQUEST_LENGTH; i++) {
parport_write_data(gc->pd->port, GC_N64_POWER_W | ((GC_N64_REQUEST >> i) & 1 ? GC_N64_OUT : 0));
udelay(GC_N64_DWS);
}
local_irq_restore(flags);
udelay(GC_N64_DELAY);
for (i = 0; i < GC_N64_LENGTH; i++) {
parport_write_data(gc->pd->port, GC_N64_POWER_R);
data[i] = parport_read_status(gc->pd->port);
parport_write_data(gc->pd->port, GC_N64_POWER_R | GC_N64_CLOCK);
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This is the same as round_jiffies_relative() except that it will never round down. This is useful for timeouts for which the exact time of firing does not matter too much, as long as they don't fire too early. */ | unsigned long round_jiffies_up_relative(unsigned long j) | /* This is the same as round_jiffies_relative() except that it will never round down. This is useful for timeouts for which the exact time of firing does not matter too much, as long as they don't fire too early. */
unsigned long round_jiffies_up_relative(unsigned long j) | {
return __round_jiffies_up_relative(j, raw_smp_processor_id());
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* ixgbe_raise_eeprom_clk - Raises the EEPROM's clock input. @hw: pointer to hardware structure @eec: EEC register's current value */ | static void ixgbe_raise_eeprom_clk(struct ixgbe_hw *hw, u32 *eec) | /* ixgbe_raise_eeprom_clk - Raises the EEPROM's clock input. @hw: pointer to hardware structure @eec: EEC register's current value */
static void ixgbe_raise_eeprom_clk(struct ixgbe_hw *hw, u32 *eec) | {
*eec = *eec | IXGBE_EEC_SK;
IXGBE_WRITE_REG(hw, IXGBE_EEC, *eec);
IXGBE_WRITE_FLUSH(hw);
udelay(1);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.