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 |
|---|---|---|---|---|---|---|---|
/* list_splice_tail - join two lists, each list being a queue @list: the new list to add. @head: the place to add it in the first list. */ | static void list_splice_tail(struct list_head *list, struct list_head *head) | /* list_splice_tail - join two lists, each list being a queue @list: the new list to add. @head: the place to add it in the first list. */
static void list_splice_tail(struct list_head *list, struct list_head *head) | {
if (!list_empty(list))
__list_splice(list, head->prev, head);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Lookup bus/target/lun and retrun corresponding struct hpsa_scsi_dev_t * Assume's h->devlock is held. */ | static struct hpsa_scsi_dev_t* lookup_hpsa_scsi_dev(struct ctlr_info *h, int bus, int target, int lun) | /* Lookup bus/target/lun and retrun corresponding struct hpsa_scsi_dev_t * Assume's h->devlock is held. */
static struct hpsa_scsi_dev_t* lookup_hpsa_scsi_dev(struct ctlr_info *h, int bus, int target, int lun) | {
int i;
struct hpsa_scsi_dev_t *sd;
for (i = 0; i < h->ndevices; i++) {
sd = h->dev[i];
if (sd->bus == bus && sd->target == target && sd->lun == lun)
return sd;
}
return NULL;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The fault interrupts are derived by performing a logical OR of each of the configured fault trigger signals for a given generator. Therefore, these interrupts are not directly related to the four possible FAULTn inputs to the device but indicate that a fault has been signaled to one of the four possible PWM generato... | void PWMFaultIntClearExt(uint32_t ui32Base, uint32_t ui32FaultInts) | /* The fault interrupts are derived by performing a logical OR of each of the configured fault trigger signals for a given generator. Therefore, these interrupts are not directly related to the four possible FAULTn inputs to the device but indicate that a fault has been signaled to one of the four possible PWM generato... | {
ASSERT(ui32Base == PWM0_BASE);
ASSERT((ui32FaultInts & ~(PWM_INT_FAULT0 | PWM_INT_FAULT1 |
PWM_INT_FAULT2 | PWM_INT_FAULT3)) == 0);
HWREG(ui32Base + PWM_O_ISC) = ui32FaultInts;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* pcie_set_ecrc_checking - set/unset PCIe ECRC checking for a device based on global policy @dev: the PCI device */ | void pcie_set_ecrc_checking(struct pci_dev *dev) | /* pcie_set_ecrc_checking - set/unset PCIe ECRC checking for a device based on global policy @dev: the PCI device */
void pcie_set_ecrc_checking(struct pci_dev *dev) | {
switch (ecrc_policy) {
case ECRC_POLICY_DEFAULT:
return;
case ECRC_POLICY_OFF:
disable_ecrc_checking(dev);
break;
case ECRC_POLICY_ON:
enable_ecrc_checking(dev);
break;
default:
return;
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* See mss_uart.h for details of how to use this function. */ | void MSS_UART_set_tx_endian(mss_uart_instance_t *this_uart, mss_uart_endian_t endian) | /* See mss_uart.h for details of how to use this function. */
void MSS_UART_set_tx_endian(mss_uart_instance_t *this_uart, mss_uart_endian_t endian) | {
ASSERT((this_uart == &g_mss_uart0) || (this_uart == &g_mss_uart1));
ASSERT(MSS_UART_INVALID_ENDIAN > endian);
if(((this_uart == &g_mss_uart0) || (this_uart == &g_mss_uart1)) &&
(MSS_UART_INVALID_ENDIAN > endian))
{
((MSS_UART_LITTLEEND == endian) ? (clear_bit_reg8(&this_uart->hw_reg->M... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Returns: the maximum space needed to store the formatted string */ | gsize g_printf_string_upper_bound(const gchar *format, va_list args) | /* Returns: the maximum space needed to store the formatted string */
gsize g_printf_string_upper_bound(const gchar *format, va_list args) | {
gchar c;
return _g_vsnprintf (&c, 1, format, args) + 1;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Measure lux and UV index using the Si1133 sensor. */ | uint32_t SI1133_measureLuxUvi(float *lux, float *uvi) | /* Measure lux and UV index using the Si1133 sensor. */
uint32_t SI1133_measureLuxUvi(float *lux, float *uvi) | {
SI1133_Samples_TypeDef samples;
uint32_t retval;
uint8_t response;
retval = SI1133_measurementForce();
UTIL_delay( 200 );
retval += SI1133_registerRead( SI1133_REG_IRQ_STATUS, &response );
while( response != 0x0F )
{
UTIL_delay( 5 );
retval += SI1133_registerRead( SI1133_REG_IRQ_ST... | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* DETAILS : Calculate a new FCS-16 given the current FCS-16 and the new data. */ | static guint16 mtp2_fcs16(tvbuff_t *tvbuff) | /* DETAILS : Calculate a new FCS-16 given the current FCS-16 and the new data. */
static guint16 mtp2_fcs16(tvbuff_t *tvbuff) | {
guint len = tvb_reported_length(tvbuff)-2;
if (len == 0)
return (0x0000);
return crc16_ccitt_tvb(tvbuff, len);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* @e1000_alloc_ring - allocate memory for a ring structure */ | static int e1000_alloc_ring_dma(struct e1000_adapter *adapter, struct e1000_ring *ring) | /* @e1000_alloc_ring - allocate memory for a ring structure */
static int e1000_alloc_ring_dma(struct e1000_adapter *adapter, struct e1000_ring *ring) | {
struct pci_dev *pdev = adapter->pdev;
ring->desc = dma_alloc_coherent(&pdev->dev, ring->size, &ring->dma,
GFP_KERNEL);
if (!ring->desc)
return -ENOMEM;
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* 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. */ | int32_t GPIOPinRead(uint32_t ui32Port, uint8_t ui8Pins) | /* 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. */
int32_t GPIOPinRead(uint32_t ui32Port, uint8_t ui8Pins) | {
ASSERT(_GPIOBaseValid(ui32Port));
return(HWREG(ui32Port + (GPIO_O_DATA + (ui8Pins << 2))));
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* parport_ip32_epp_write_data - write a block of data in EPP mode */ | static size_t parport_ip32_epp_write_data(struct parport *p, const void *buf, size_t len, int flags) | /* parport_ip32_epp_write_data - write a block of data in EPP mode */
static size_t parport_ip32_epp_write_data(struct parport *p, const void *buf, size_t len, int flags) | {
struct parport_ip32_private * const priv = p->physport->private_data;
return parport_ip32_epp_write(priv->regs.eppData0, p, buf, len, flags);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Any changes to the returned object will impact the original JSON value. */ | EDKII_JSON_OBJECT EFIAPI JsonValueGetObject(IN EDKII_JSON_VALUE Json) | /* Any changes to the returned object will impact the original JSON value. */
EDKII_JSON_OBJECT EFIAPI JsonValueGetObject(IN EDKII_JSON_VALUE Json) | {
if ((Json == NULL) || !JsonValueIsObject (Json)) {
return NULL;
}
return (EDKII_JSON_OBJECT)Json;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* 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, USB_SOF_Pin|USB_VBUS_Pin|USB_ID_Pin|USB_DM_Pin
|USB_DP_Pin);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* MTLOAD: Loads the tape. The default implementation just wait until the tape medium state changes to MS_LOADED. */ | int tape_std_mtload(struct tape_device *device, int count) | /* MTLOAD: Loads the tape. The default implementation just wait until the tape medium state changes to MS_LOADED. */
int tape_std_mtload(struct tape_device *device, int count) | {
return wait_event_interruptible(device->state_change_wq,
(device->medium_state == MS_LOADED));
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Resets a network adapter and allocates the transmit and receive buffers required by the network interface; optionally, also requests allocation of additional transmit and receive buffers. */ | EFI_STATUS EmuSnpInitialize(IN EMU_SNP_PROTOCOL *This, IN UINTN ExtraRxBufferSize OPTIONAL, IN UINTN ExtraTxBufferSize OPTIONAL) | /* Resets a network adapter and allocates the transmit and receive buffers required by the network interface; optionally, also requests allocation of additional transmit and receive buffers. */
EFI_STATUS EmuSnpInitialize(IN EMU_SNP_PROTOCOL *This, IN UINTN ExtraRxBufferSize OPTIONAL, IN UINTN ExtraTxBufferSize OPTIONA... | {
EMU_SNP_PRIVATE *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_THIS (This);
return EFI_UNSUPPORTED;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* calculate the y-projection of the runtime service curve by the given x-projection value */ | static u64 rtsc_y2x(struct runtime_sc *rtsc, u64 y) | /* calculate the y-projection of the runtime service curve by the given x-projection value */
static u64 rtsc_y2x(struct runtime_sc *rtsc, u64 y) | {
u64 x;
if (y < rtsc->y)
x = rtsc->x;
else if (y <= rtsc->y + rtsc->dy) {
if (rtsc->dy == 0)
x = rtsc->x + rtsc->dx;
else
x = rtsc->x + seg_y2x(y - rtsc->y, rtsc->ism1);
} else {
x = rtsc->x + rtsc->dx
+ seg_y2x(y - rtsc->y - rtsc->dy, rtsc->ism2);
}
return x;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Function for generating a description of a simplified EP OOB message according to the BLE AD structure.
This function declares and initializes a static instance of a simplified EP OOB message with Bluetooth Carrier Configuration EP record. Payload of this record can be configured via AD structure. */ | static ret_code_t nfc_ble_simplified_ep_oob_msg_declare(ble_advdata_t const *const p_ep_advdata, nfc_ndef_msg_desc_t **pp_ep_oob_msg_desc) | /* Function for generating a description of a simplified EP OOB message according to the BLE AD structure.
This function declares and initializes a static instance of a simplified EP OOB message with Bluetooth Carrier Configuration EP record. Payload of this record can be configured via AD structure. */
static ret_cod... | {
ret_code_t err_code;
nfc_ndef_record_desc_t * p_nfc_ep_oob_record;
NFC_NDEF_MSG_DEF(nfc_ep_oob_msg, 1);
nfc_ndef_msg_clear(&NFC_NDEF_MSG(nfc_ep_oob_msg));
if(p_ep_advdata != NULL)
{
p_nfc_ep_oob_record = nfc_ep_oob_rec_declare(0 , p_ep_advdata);
err_code = nfc_ndef_msg_record_a... | labapart/polymcu | C++ | null | 201 |
/* brief Return Frequency of I3C function Slow clock return Frequency of I3C function slow Clock */ | uint32_t CLOCK_GetI3cSClkFreq(void) | /* brief Return Frequency of I3C function Slow clock return Frequency of I3C function slow Clock */
uint32_t CLOCK_GetI3cSClkFreq(void) | {
uint32_t freq = 0U;
switch (SYSCON->I3CFCLKSSEL)
{
case 0U:
freq = CLOCK_GetFro1MFreq();
break;
default:
freq = 0U;
break;
}
return freq / ((SYSCON->I3CFCLKSDIV & SYSCON_I3CFCLKSDIV_DIV_MASK) + 1U);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Set DAC Channel LFSR Mask or Triangle Wave Amplitude.
Sets the digital to analog converter superimposed waveform generation characteristics. */ | void dac_set_waveform_characteristics(uint32_t dac_mamp) | /* Set DAC Channel LFSR Mask or Triangle Wave Amplitude.
Sets the digital to analog converter superimposed waveform generation characteristics. */
void dac_set_waveform_characteristics(uint32_t dac_mamp) | {
DAC_CR |= dac_mamp;
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* Wait for controller and FLASH to both be ready. */ | static int lpc32xx_waitfunc(struct mtd_info *mtd, struct nand_chip *chip) | /* Wait for controller and FLASH to both be ready. */
static int lpc32xx_waitfunc(struct mtd_info *mtd, struct nand_chip *chip) | {
int status;
unsigned int timeout;
for (timeout = LPC32X_NAND_TIMEOUT; timeout; timeout--) {
status = readl(&lpc32xx_nand_mlc_registers->isr);
if ((status & (ISR_CONTROLLER_READY || ISR_NAND_READY))
== (ISR_CONTROLLER_READY || ISR_NAND_READY))
break;
udelay(1);
}
if ((status & (ISR_CONTROLLER_READY... | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* change the user struct in a credentials set to match the new UID */ | static int set_user(struct cred *new) | /* change the user struct in a credentials set to match the new UID */
static int set_user(struct cred *new) | {
struct user_struct *new_user;
new_user = alloc_uid(current_user_ns(), new->uid);
if (!new_user)
return -EAGAIN;
if (!task_can_switch_user(new_user, current)) {
free_uid(new_user);
return -EINVAL;
}
if (atomic_read(&new_user->processes) >=
current->signal->rlim[RLIMIT_NPROC].rlim_cur &&
new_user != ... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* LZ4F_decompress_usingDict() : Same as LZ4F_decompress(), using a predefined dictionary. Dictionary is used "in place", without any preprocessing. It must remain accessible throughout the entire frame decoding. */ | size_t LZ4F_decompress_usingDict(LZ4F_dctx *dctx, void *dstBuffer, size_t *dstSizePtr, const void *srcBuffer, size_t *srcSizePtr, const void *dict, size_t dictSize, const LZ4F_decompressOptions_t *decompressOptionsPtr) | /* LZ4F_decompress_usingDict() : Same as LZ4F_decompress(), using a predefined dictionary. Dictionary is used "in place", without any preprocessing. It must remain accessible throughout the entire frame decoding. */
size_t LZ4F_decompress_usingDict(LZ4F_dctx *dctx, void *dstBuffer, size_t *dstSizePtr, const void *srcB... | {
if (dctx->dStage <= dstage_init) {
dctx->dict = (const BYTE*)dict;
dctx->dictSize = dictSize;
}
return LZ4F_decompress(dctx, dstBuffer, dstSizePtr,
srcBuffer, srcSizePtr,
decompressOptionsPtr);
} | xboot/xboot | C++ | MIT License | 779 |
/* Step up spinner data.
This function steps up the data, making sure it does not go beyond the upper limit. Wraps around if it does. */ | static void gfx_mono_spinctrl_step_up(struct gfx_mono_spinctrl *spinner) | /* Step up spinner data.
This function steps up the data, making sure it does not go beyond the upper limit. Wraps around if it does. */
static void gfx_mono_spinctrl_step_up(struct gfx_mono_spinctrl *spinner) | {
if (spinner->datatype == SPINTYPE_INTEGER) {
if (spinner->integer_data < spinner->upper_limit) {
spinner->integer_data++;
} else {
spinner->integer_data = spinner->lower_limit;
}
} else if (spinner->datatype == SPINTYPE_STRING) {
if (spinner->strings.index < spinner->upper_limit) {
spinner->strings... | memfault/zero-to-main | C++ | null | 200 |
/* Early init I2C for prepare read the clk through I2C. */ | void i2c_early_init_f(void) | /* Early init I2C for prepare read the clk through I2C. */
void i2c_early_init_f(void) | {
ulong base = mxc_i2c_buses[I2C_EARLY_INIT_INDEX].base;
bool quirk = mxc_i2c_buses[I2C_EARLY_INIT_INDEX].driver_data
& I2C_QUIRK_FLAG ? true : false;
int reg_shift = quirk ? VF610_I2C_REGSHIFT : IMX_I2C_REGSHIFT;
writeb(I2C_IFDR_DIV_CONSERVATIVE, base + (IFDR << reg_shift));
writeb(I2CR_IDIS, base + (I2CR <<... | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* do_IRQ handles all hardware IRQs. Decoded IRQs should not come via this function. Instead, they should provide their own 'handler' */ | asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) | /* do_IRQ handles all hardware IRQs. Decoded IRQs should not come via this function. Instead, they should provide their own 'handler' */
asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) | {
struct pt_regs *old_regs = set_irq_regs(regs);
irq_enter();
check_stack_overflow(irq);
if (irq >= NR_IRQS)
handle_bad_irq(irq, &bad_irq_desc);
else
generic_handle_irq(irq);
maybe_lower_to_irq14();
irq_exit();
set_irq_regs(old_regs);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Unregisters a callback.
Unregisters a callback function implemented by the user. The callback should be disabled before it is unregistered. */ | enum status_code tc_unregister_callback(struct tc_module *const module, const enum tc_callback callback_type) | /* Unregisters a callback.
Unregisters a callback function implemented by the user. The callback should be disabled before it is unregistered. */
enum status_code tc_unregister_callback(struct tc_module *const module, const enum tc_callback callback_type) | {
Assert(module);
module->callback[callback_type] = NULL;
if (callback_type == TC_CALLBACK_CC_CHANNEL0) {
module->register_callback_mask &= ~TC_INTFLAG_MC(1);
}
else if (callback_type == TC_CALLBACK_CC_CHANNEL1) {
module->register_callback_mask &= ~TC_INTFLAG_MC(2);
}
else {
module->register_callback_mask ... | memfault/zero-to-main | C++ | null | 200 |
/* Use the API defined in xemacps_bd.h to modify individual BDs. Traversal of the BD set can be done using XEmacPs_BdRingNext() and XEmacPs_BdRingPrev(). */ | LONG XEmacPs_BdRingAlloc(XEmacPs_BdRing *RingPtr, u32 NumBd, XEmacPs_Bd **BdSetPtr) | /* Use the API defined in xemacps_bd.h to modify individual BDs. Traversal of the BD set can be done using XEmacPs_BdRingNext() and XEmacPs_BdRingPrev(). */
LONG XEmacPs_BdRingAlloc(XEmacPs_BdRing *RingPtr, u32 NumBd, XEmacPs_Bd **BdSetPtr) | {
LONG Status;
if (RingPtr->FreeCnt < NumBd) {
Status = (LONG)(XST_FAILURE);
} else {
*BdSetPtr = RingPtr->FreeHead;
XEMACPS_RING_SEEKAHEAD(RingPtr, RingPtr->FreeHead, NumBd);
RingPtr->FreeCnt -= NumBd;
RingPtr->PreCnt += NumBd;
Status = (LONG)(XST_SUCCESS);
}
return Status;
} | ua1arn/hftrx | C++ | null | 69 |
/* This function traces 2 bytes of data as specified in the format string. */ | VOID EFIAPI DumpUint16(IN CONST CHAR16 *Format, IN UINT8 *Ptr) | /* This function traces 2 bytes of data as specified in the format string. */
VOID EFIAPI DumpUint16(IN CONST CHAR16 *Format, IN UINT8 *Ptr) | {
Print (Format, *(UINT16 *)Ptr);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* parport_ip32_dma_interrupt - DMA interrupt handler @irq: interrupt number @dev_id: unused */ | static irqreturn_t parport_ip32_dma_interrupt(int irq, void *dev_id) | /* parport_ip32_dma_interrupt - DMA interrupt handler @irq: interrupt number @dev_id: unused */
static irqreturn_t parport_ip32_dma_interrupt(int irq, void *dev_id) | {
if (parport_ip32_dma.left)
pr_trace(NULL, "(%d): ctx=%d", irq, parport_ip32_dma.ctx);
parport_ip32_dma_setup_context(MACEPAR_CONTEXT_DATA_BOUND);
return IRQ_HANDLED;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function computes the bit position of the lowest bit set in the 64-bit value specified by Operand. If Operand is zero, then -1 is returned. Otherwise, a value between 0 and 63 is returned. */ | INTN EFIAPI LowBitSet64(IN UINT64 Operand) | /* This function computes the bit position of the lowest bit set in the 64-bit value specified by Operand. If Operand is zero, then -1 is returned. Otherwise, a value between 0 and 63 is returned. */
INTN EFIAPI LowBitSet64(IN UINT64 Operand) | {
INTN BitIndex;
if (Operand == 0) {
return -1;
}
for (BitIndex = 0;
(Operand & 1) == 0;
BitIndex++, Operand = RShiftU64 (Operand, 1))
{
}
return BitIndex;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* walk up backref nodes until reach node presents tree root */ | static struct backref_node* walk_up_backref(struct backref_node *node, struct backref_edge *edges[], int *index) | /* walk up backref nodes until reach node presents tree root */
static struct backref_node* walk_up_backref(struct backref_node *node, struct backref_edge *edges[], int *index) | {
struct backref_edge *edge;
int idx = *index;
while (!list_empty(&node->upper)) {
edge = list_entry(node->upper.next,
struct backref_edge, list[LOWER]);
edges[idx++] = edge;
node = edge->node[UPPER];
}
*index = idx;
return node;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* System shutdown should not return, if it returns, it means the system does not support shut down reset. */ | VOID EFIAPI ResetShutdown(VOID) | /* System shutdown should not return, if it returns, it means the system does not support shut down reset. */
VOID EFIAPI ResetShutdown(VOID) | {
if (mAcpiHwReducedSleepCtl) {
IoWrite8 (mAcpiHwReducedSleepCtl, 5 << 2 | 1 << 5);
} else {
IoBitFieldWrite16 (mAcpiPmBaseAddress + 4, 10, 13, 0);
IoOr16 (mAcpiPmBaseAddress + 4, BIT13);
}
CpuDeadLoop ();
} | tianocore/edk2 | C++ | Other | 4,240 |
/* If RsaContext is NULL, then return FALSE. If BnSize is NULL, then return FALSE. If BnSize is large enough but BigNumber is NULL, then return FALSE. If this interface is not supported, then return FALSE. */ | BOOLEAN EFIAPI CryptoServiceRsaGetKey(IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, OUT UINT8 *BigNumber, IN OUT UINTN *BnSize) | /* If RsaContext is NULL, then return FALSE. If BnSize is NULL, then return FALSE. If BnSize is large enough but BigNumber is NULL, then return FALSE. If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI CryptoServiceRsaGetKey(IN OUT VOID *RsaContext, IN RSA_KEY_TAG KeyTag, OUT UINT8 *BigNumber, IN ... | {
return CALL_BASECRYPTLIB (Rsa.Services.GetKey, RsaGetKey, (RsaContext, KeyTag, BigNumber, BnSize), FALSE);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Resets a SCSI logical unit that is connected to a SCSI channel. */ | EFI_STATUS EFIAPI ExtScsiPassThruResetTargetLun(IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN UINT8 *Target, IN UINT64 Lun) | /* Resets a SCSI logical unit that is connected to a SCSI channel. */
EFI_STATUS EFIAPI ExtScsiPassThruResetTargetLun(IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, IN UINT8 *Target, IN UINT64 Lun) | {
ATA_ATAPI_PASS_THRU_INSTANCE *Instance;
LIST_ENTRY *Node;
UINT8 Port;
UINT8 PortMultiplier;
Instance = EXT_SCSI_PASS_THRU_PRIVATE_DATA_FROM_THIS (This);
if (Lun != 0) {
return EFI_INVALID_PARAMETER;
}
Port = Target[0];
... | tianocore/edk2 | C++ | Other | 4,240 |
/* initializes the event queue and the event processor
This function is called by the component initialization function, ixEthDBInit(). */ | IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBStartLearningFunction(void) | /* initializes the event queue and the event processor
This function is called by the component initialization function, ixEthDBInit(). */
IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBStartLearningFunction(void) | {
IxOsalThread eventProcessorThread;
IxOsalThreadAttr threadAttr;
threadAttr.name = "EthDB event thread";
threadAttr.stackSize = 32 * 1024;
threadAttr.priority = 128;
ixOsalMutexLock(&eventQueueLock, IX_OSAL_WAIT_FOREVER);
RESET_QUEUE(&eventQueue);
ixOsalMutexUnlock(&eventQueueLock... | EmcraftSystems/u-boot | C++ | Other | 181 |
/* This file is part of the Simba project. */ | int board_pin_string_to_device_index(const char *str_p) | /* This file is part of the Simba project. */
int board_pin_string_to_device_index(const char *str_p) | {
long pin;
if (strncmp(&str_p[0], "gpio", 4) == 0) {
if (std_strtol(&str_p[4], &pin) == NULL) {
return (-ENODEV);
}
if ((pin >= 0) && (pin <= 27)) {
} else if ((pin >= 32) && (pin <= 36)) {
pin -= 4;
} else if (pin == 39) {
pin -= 4;
... | eerimoq/simba | C++ | Other | 337 |
/* param base The I2C peripheral base address. param handle Pointer to the I2C slave driver handle. param callback User provided pointer to the asynchronous callback function. param userData User provided pointer to the application callback data. */ | void I2C_SlaveTransferCreateHandle(I2C_Type *base, i2c_slave_handle_t *handle, i2c_slave_transfer_callback_t callback, void *userData) | /* param base The I2C peripheral base address. param handle Pointer to the I2C slave driver handle. param callback User provided pointer to the asynchronous callback function. param userData User provided pointer to the application callback data. */
void I2C_SlaveTransferCreateHandle(I2C_Type *base, i2c_slave_handle_t... | {
assert(handle != NULL);
uint32_t instance;
i2c_to_flexcomm_t handler;
handler.i2c_slave_handler = I2C_SlaveTransferHandleIRQ;
(void)memset(handle, 0, sizeof(*handle));
instance = I2C_GetInstance(base);
handle->callback = callback;
handle->userData = userData;
handle->slaveFsm = kI2... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* set up the offset and length to receive the current frequency. */ | static int prepare_playback_sync_urb(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *urb) | /* set up the offset and length to receive the current frequency. */
static int prepare_playback_sync_urb(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *urb) | {
struct snd_urb_ctx *ctx = urb->context;
urb->dev = ctx->subs->dev;
urb->iso_frame_desc[0].length = 3;
urb->iso_frame_desc[0].offset = 0;
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Scale msgmni with the available lowmem size: the memory dedicated to msg queues should occupy at most 1/MSG_MEM_SCALE of lowmem. Also take into account the number of nsproxies created so far. This should be done staying within the (MSGMNI , IPCMNI/nr_ipc_ns) range. */ | void recompute_msgmni(struct ipc_namespace *ns) | /* Scale msgmni with the available lowmem size: the memory dedicated to msg queues should occupy at most 1/MSG_MEM_SCALE of lowmem. Also take into account the number of nsproxies created so far. This should be done staying within the (MSGMNI , IPCMNI/nr_ipc_ns) range. */
void recompute_msgmni(struct ipc_namespace *ns) | {
struct sysinfo i;
unsigned long allowed;
int nb_ns;
si_meminfo(&i);
allowed = (((i.totalram - i.totalhigh) / MSG_MEM_SCALE) * i.mem_unit)
/ MSGMNB;
nb_ns = atomic_read(&nr_ipc_ns);
allowed /= nb_ns;
if (allowed < MSGMNI) {
ns->msg_ctlmni = MSGMNI;
return;
}
if (allowed > IPCMNI / nb_ns) {
ns->msg_ct... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Sends received pdus to the connection state machine. */ | static int llc_conn_rcv(struct sock *sk, struct sk_buff *skb) | /* Sends received pdus to the connection state machine. */
static int llc_conn_rcv(struct sock *sk, struct sk_buff *skb) | {
struct llc_conn_state_ev *ev = llc_conn_ev(skb);
ev->type = LLC_CONN_EV_TYPE_PDU;
ev->reason = 0;
return llc_conn_state_process(sk, skb);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* 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_context_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_context_base_release(struct ttm_base_object **p_base) | {
struct ttm_base_object *base = *p_base;
struct vmw_user_context *ctx =
container_of(base, struct vmw_user_context, base);
struct vmw_resource *res = &ctx->res;
*p_base = NULL;
vmw_resource_unreference(&res);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Disable all display connectors on the interface module. */ | static void realview_clcd_disable(struct clcd_fb *fb) | /* Disable all display connectors on the interface module. */
static void realview_clcd_disable(struct clcd_fb *fb) | {
void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;
u32 val;
val = readl(sys_clcd);
val &= ~SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
writel(val, sys_clcd);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* When called for a USB interface, @dev->parent->sem must be held. */ | int device_attach(struct device *dev) | /* When called for a USB interface, @dev->parent->sem must be held. */
int device_attach(struct device *dev) | {
int ret = 0;
down(&dev->sem);
if (dev->driver) {
ret = device_bind_driver(dev);
if (ret == 0)
ret = 1;
else {
dev->driver = NULL;
ret = 0;
}
} else {
pm_runtime_get_noresume(dev);
ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach);
pm_runtime_put_sync(dev);
}
up(&dev->sem);
ret... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* De-Initializes the Low Level portion of the Device driver. */ | USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev) | /* De-Initializes the Low Level portion of the Device driver. */
USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev) | {
HAL_PCD_DeInit(pdev->pData);
return USBD_OK;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* This function returns after the IPI has been accepted by the target processors. */ | VOID EFIAPI SendFixedIpiAllExcludingSelf(IN UINT8 Vector) | /* This function returns after the IPI has been accepted by the target processors. */
VOID EFIAPI SendFixedIpiAllExcludingSelf(IN UINT8 Vector) | {
LOCAL_APIC_ICR_LOW IcrLow;
IcrLow.Uint32 = 0;
IcrLow.Bits.DeliveryMode = LOCAL_APIC_DELIVERY_MODE_FIXED;
IcrLow.Bits.Level = 1;
IcrLow.Bits.DestinationShorthand = LOCAL_APIC_DESTINATION_SHORTHAND_ALL_EXCLUDING_SELF;
IcrLow.Bits.Vector = Vector;
Se... | tianocore/edk2 | C++ | Other | 4,240 |
/* param base XRDC2 peripheral base address. param periph The peripheral to operate. param The domain ID of the lock owner. */ | uint8_t XRDC2_GetPeriphExclAccessLockDomainOwner(XRDC2_Type *base, xrdc2_periph_t periph) | /* param base XRDC2 peripheral base address. param periph The peripheral to operate. param The domain ID of the lock owner. */
uint8_t XRDC2_GetPeriphExclAccessLockDomainOwner(XRDC2_Type *base, xrdc2_periph_t periph) | {
uint32_t pac = XRDC2_GET_PAC((uint32_t)periph);
uint32_t pdac = XRDC2_GET_PDAC((uint32_t)periph);
return (uint8_t)((base->PACI_PDACJ[pac][pdac].PAC_PDAC_W0 & XRDC2_PAC_PDAC_W0_EALO_MASK) >>
XRDC2_PAC_PDAC_W0_EALO_SHIFT);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Tristate the PCM DAI lines, tristate can be disabled by calling wm9713_set_dai_fmt() */ | static int wm9713_set_dai_tristate(struct snd_soc_dai *codec_dai, int tristate) | /* Tristate the PCM DAI lines, tristate can be disabled by calling wm9713_set_dai_fmt() */
static int wm9713_set_dai_tristate(struct snd_soc_dai *codec_dai, int tristate) | {
struct snd_soc_codec *codec = codec_dai->codec;
u16 reg = ac97_read(codec, AC97_CENTER_LFE_MASTER) & 0x9fff;
if (tristate)
ac97_write(codec, AC97_CENTER_LFE_MASTER, reg);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Returns a node pointer with refcount incremented, use of_node_put() on it when done. */ | struct device_node* of_find_node_with_property(struct device_node *from, const char *prop_name) | /* Returns a node pointer with refcount incremented, use of_node_put() on it when done. */
struct device_node* of_find_node_with_property(struct device_node *from, const char *prop_name) | {
struct device_node *np;
struct property *pp;
read_lock(&devtree_lock);
np = from ? from->allnext : allnodes;
for (; np; np = np->allnext) {
for (pp = np->properties; pp != 0; pp = pp->next) {
if (of_prop_cmp(pp->name, prop_name) == 0) {
of_node_get(np);
goto out;
}
}
}
out:
of_node_put(from);... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* destroy_bud_list - destroy the list of buds to replay. */ | static void destroy_bud_list(struct ubifs_info *c) | /* destroy_bud_list - destroy the list of buds to replay. */
static void destroy_bud_list(struct ubifs_info *c) | {
struct bud_entry *b;
while (!list_empty(&c->replay_buds)) {
b = list_entry(c->replay_buds.next, struct bud_entry, list);
list_del(&b->list);
kfree(b);
}
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* Allocate device structure, err, instance, and register driver */ | static int scc_net_alloc(const char *name, struct scc_channel *scc) | /* Allocate device structure, err, instance, and register driver */
static int scc_net_alloc(const char *name, struct scc_channel *scc) | {
int err;
struct net_device *dev;
dev = alloc_netdev(0, name, scc_net_setup);
if (!dev)
return -ENOMEM;
dev->ml_priv = scc;
scc->dev = dev;
spin_lock_init(&scc->lock);
init_timer(&scc->tx_t);
init_timer(&scc->tx_wdog);
err = register_netdevice(dev);
if (err) {
printk(KERN_ERR "%s: can't register networ... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* These devices are always present and don't need any board-specific setup. */ | static int __init ks8695_add_standard_devices(void) | /* These devices are always present and don't need any board-specific setup. */
static int __init ks8695_add_standard_devices(void) | {
ks8695_add_device_watchdog();
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This API is the entry point. Call this API before using all other APIs. This API reads the chip-id of the sensor and sets the resolution. */ | uint16_t bma423_init(struct bma4_dev *dev) | /* This API is the entry point. Call this API before using all other APIs. This API reads the chip-id of the sensor and sets the resolution. */
uint16_t bma423_init(struct bma4_dev *dev) | {
uint16_t rslt;
rslt = bma4_init(dev);
if (rslt == BMA4_OK) {
if (dev->chip_id == BMA423_CHIP_ID) {
dev->resolution = 12;
dev->feature_len = BMA423_FEATURE_SIZE;
dev->variant = BMA42X_VARIANT;
} else {
rslt |= BMA4_E_INVALID_SENSOR;
}
}
return rslt;
} | arendst/Tasmota | C++ | GNU General Public License v3.0 | 21,318 |
/* Calculate a value of a Cubic Bezier function. */ | int32_t lv_bezier3(uint32_t t, int32_t u0, int32_t u1, int32_t u2, int32_t u3) | /* Calculate a value of a Cubic Bezier function. */
int32_t lv_bezier3(uint32_t t, int32_t u0, int32_t u1, int32_t u2, int32_t u3) | {
uint32_t t_rem = 1024 - t;
uint32_t t_rem2 = (t_rem * t_rem) >> 10;
uint32_t t_rem3 = (t_rem2 * t_rem) >> 10;
uint32_t t2 = (t * t) >> 10;
uint32_t t3 = (t2 * t) >> 10;
uint32_t v1 = ((uint32_t)t_rem3 * u0) >> 10;
uint32_t v2 = ((uint32_t)3 * t_rem2 * t * u1) >> 20;
uint32_t v... | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* If the pointer to the HOB list is NULL, then ASSERT(). */ | EFI_BOOT_MODE EFIAPI GetBootModeHob(VOID) | /* If the pointer to the HOB list is NULL, then ASSERT(). */
EFI_BOOT_MODE EFIAPI GetBootModeHob(VOID) | {
EFI_STATUS Status;
EFI_BOOT_MODE BootMode;
Status = PeiServicesGetBootMode (&BootMode);
ASSERT_EFI_ERROR (Status);
return BootMode;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* param base Pointer to FLEXIO_I2S_Type structure param format Pointer to FlexIO I2S audio data format structure. param srcClock_Hz I2S master clock source frequency in Hz. */ | void FLEXIO_I2S_MasterSetFormat(FLEXIO_I2S_Type *base, flexio_i2s_format_t *format, uint32_t srcClock_Hz) | /* param base Pointer to FLEXIO_I2S_Type structure param format Pointer to FlexIO I2S audio data format structure. param srcClock_Hz I2S master clock source frequency in Hz. */
void FLEXIO_I2S_MasterSetFormat(FLEXIO_I2S_Type *base, flexio_i2s_format_t *format, uint32_t srcClock_Hz) | {
uint32_t timDiv = srcClock_Hz / (format->sampleRate_Hz * format->bitWidth * 2U);
uint32_t bclkDiv = 0;
if (timDiv % 2)
{
timDiv += 1U;
}
base->flexioBase->TIMCMP[base->fsTimerIndex] = FLEXIO_TIMCMP_CMP(format->bitWidth * timDiv - 1U);
bclkDiv ... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* ring_buffer_iter_empty - check if an iterator has no more to read @iter: The iterator to check */ | int ring_buffer_iter_empty(struct ring_buffer_iter *iter) | /* ring_buffer_iter_empty - check if an iterator has no more to read @iter: The iterator to check */
int ring_buffer_iter_empty(struct ring_buffer_iter *iter) | {
struct ring_buffer_per_cpu *cpu_buffer;
cpu_buffer = iter->cpu_buffer;
return iter->head_page == cpu_buffer->commit_page &&
iter->head == rb_commit_index(cpu_buffer);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* a d d I n d e x */ | returnValue Bounds_addIndex(Bounds *_THIS, Indexlist *const indexlist, int newnumber, SubjectToStatus newstatus) | /* a d d I n d e x */
returnValue Bounds_addIndex(Bounds *_THIS, Indexlist *const indexlist, int newnumber, SubjectToStatus newstatus) | {
if ( _THIS->status != 0 )
{
if ( _THIS->status[newnumber] == newstatus )
return THROWERROR( RET_INDEX_ALREADY_OF_DESIRED_STATUS );
_THIS->status[newnumber] = newstatus;
}
else
return THROWERROR( RET_ADDINDEX_FAILED );
if ( indexlist != 0 )
{
if ( Indexlist_addNumber( indexlist,newnumber ) == RET_INDE... | DanielMartensson/EmbeddedLapack | C++ | MIT License | 129 |
/* Checks if the SPI in master mode has shifted out last data, or if the master has ended the transfer in slave mode.
This function will check if the SPI master module has shifted out last data, or if the slave select pin has been drawn high by the master for the SPI slave module. */ | static bool _spi_is_write_complete(Spi *const spi_module) | /* Checks if the SPI in master mode has shifted out last data, or if the master has ended the transfer in slave mode.
This function will check if the SPI master module has shifted out last data, or if the slave select pin has been drawn high by the master for the SPI slave module. */
static bool _spi_is_write_complete... | {
Assert(spi_module);
return (spi_module->TRANSMIT_STATUS.bit.TX_FIFO_EMPTY);
} | memfault/zero-to-main | C++ | null | 200 |
/* Apply stored offset values to sensor reading.
This function applies stored calibration offsets to the "input" vector of magnetometer values (the magnetic field vector) and returns the modified values. */ | static void ak8975_apply_offset(vector3_t *input) | /* Apply stored offset values to sensor reading.
This function applies stored calibration offsets to the "input" vector of magnetometer values (the magnetic field vector) and returns the modified values. */
static void ak8975_apply_offset(vector3_t *input) | {
input->x -= calibrated_offsets.x;
input->y -= calibrated_offsets.y;
input->z -= calibrated_offsets.z;
} | memfault/zero-to-main | C++ | null | 200 |
/* Set a usb device with a specified address. */ | EFI_STATUS PeiUsbSetDeviceAddress(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT16 AddressValue) | /* Set a usb device with a specified address. */
EFI_STATUS PeiUsbSetDeviceAddress(IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT16 AddressValue) | {
EFI_USB_DEVICE_REQUEST DevReq;
ASSERT (UsbIoPpi != NULL);
DevReq.RequestType = USB_DEV_SET_ADDRESS_REQ_TYPE;
DevReq.Request = USB_DEV_SET_ADDRESS;
DevReq.Value = AddressValue;
DevReq.Index = 0;
DevReq.Length = 0;
return UsbIoPpi->UsbControlTransfer (
PeiServi... | tianocore/edk2 | C++ | Other | 4,240 |
/* configure TIMER the internal trigger as external clock input */ | void timer_internal_trigger_as_external_clock_config(uint32_t timer_periph, uint32_t intrigger) | /* configure TIMER the internal trigger as external clock input */
void timer_internal_trigger_as_external_clock_config(uint32_t timer_periph, uint32_t intrigger) | {
timer_input_trigger_source_select(timer_periph, intrigger);
TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_SMC;
TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SLAVE_MODE_EXTERNAL0;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Interface for HD codec CORB / RIRB interface */ | static int azx_alloc_cmd_io(struct azx *chip) | /* Interface for HD codec CORB / RIRB interface */
static int azx_alloc_cmd_io(struct azx *chip) | {
int err;
err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV,
snd_dma_pci_data(chip->pci),
PAGE_SIZE, &chip->rb);
if (err < 0) {
snd_printk(KERN_ERR SFX "cannot allocate CORB/RIRB\n");
return err;
}
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* SD MSP De-Initialization This function freeze the hardware resources used in this example. */ | void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd) | /* SD MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd) | {
if(hsd->Instance==SDIO)
{
__HAL_RCC_SDIO_CLK_DISABLE();
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_12|GPIO_PIN_11|GPIO_PIN_10|GPIO_PIN_9
|GPIO_PIN_8);
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_2);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Clears or safeguards the OCREF4 signal on an external event. */ | void TIM_ClrOc4Ref(TIM_Module *TIMx, uint16_t TIM_OCClear) | /* Clears or safeguards the OCREF4 signal on an external event. */
void TIM_ClrOc4Ref(TIM_Module *TIMx, uint16_t TIM_OCClear) | {
uint16_t tmpccmr2 = 0;
assert_param(IsTimList3Module(TIMx));
assert_param(IsTimOcClrState(TIM_OCClear));
tmpccmr2 = TIMx->CCMOD2;
tmpccmr2 &= (uint16_t) ~((uint16_t)TIM_CCMOD2_OC4CEN);
tmpccmr2 |= (uint16_t)(TIM_OCClear << 8);
TIMx->CCMOD2 = tmpccmr2;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* The wdev NMI calls this function from pp_post() with SVC_MACLayer to set a pending interrupt service callback which flushs the queue of messages that the NMI stashes away. This interrupt will be triggered after the return from the NMI and when interrupts are enabled. The NMI can not touch the FreeRTOS queues itself.... | void IRAM PendSV(enum SVC_ReqType req) | /* The wdev NMI calls this function from pp_post() with SVC_MACLayer to set a pending interrupt service callback which flushs the queue of messages that the NMI stashes away. This interrupt will be triggered after the return from the NMI and when interrupts are enabled. The NMI can not touch the FreeRTOS queues itself.... | {
if (req == SVC_Software) {
vPortEnterCritical();
pending_soft_sv = 1;
WSR(BIT(INUM_SOFT), interrupt);
vPortExitCritical();
} else if (req == SVC_MACLayer) {
pending_maclayer_sv= 1;
WSR(BIT(INUM_SOFT), interrupt);
}
} | RavenSystem/esp-homekit-devices | C++ | Other | 2,577 |
/* In order to read a register from the EEPROM, we need to shift 'count' bits in from the EEPROM. Bits are "shifted in" by raising the clock input to the EEPROM (setting the SK bit), and then reading the value of the data out "DO" bit. During this "shifting in" process the data in "DI" bit should always be clear. */ | static u16 igb_shift_in_eec_bits(struct e1000_hw *hw, u16 count) | /* In order to read a register from the EEPROM, we need to shift 'count' bits in from the EEPROM. Bits are "shifted in" by raising the clock input to the EEPROM (setting the SK bit), and then reading the value of the data out "DO" bit. During this "shifting in" process the data in "DI" bit should always be clear. */
s... | {
u32 eecd;
u32 i;
u16 data;
eecd = rd32(E1000_EECD);
eecd &= ~(E1000_EECD_DO | E1000_EECD_DI);
data = 0;
for (i = 0; i < count; i++) {
data <<= 1;
igb_raise_eec_clk(hw, &eecd);
eecd = rd32(E1000_EECD);
eecd &= ~E1000_EECD_DI;
if (eecd & E1000_EECD_DO)
data |= 1;
igb_lower_eec_clk(hw, &eecd);
}
... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* byte_5 == (byte_1 + byte_2 + byte_3 + btye_4) & 0xFF Wait specified time for pin to go to a specified state. If timeout is reached and pin doesn't go to a requested state false is returned. The elapsed time is returned in pointer 'duration' if it is not NULL. */ | static bool dht_await_pin_state(uint8_t pin, uint32_t timeout, bool expected_pin_state, uint32_t *duration) | /* byte_5 == (byte_1 + byte_2 + byte_3 + btye_4) & 0xFF Wait specified time for pin to go to a specified state. If timeout is reached and pin doesn't go to a requested state false is returned. The elapsed time is returned in pointer 'duration' if it is not NULL. */
static bool dht_await_pin_state(uint8_t pin, uint32_t... | {
for (uint32_t i = 0; i < timeout; i += DHT_TIMER_INTERVAL) {
sdk_os_delay_us(DHT_TIMER_INTERVAL);
if (gpio_read(pin) == expected_pin_state) {
if (duration) {
*duration = i;
}
return true;
}
}
return false;
} | RavenSystem/esp-homekit-devices | C++ | Other | 2,577 |
/* Get to know Calibration is Failed or completed normally. */ | xtBoolean ADCCalibrationIsFailed(unsigned long ulBase) | /* Get to know Calibration is Failed or completed normally. */
xtBoolean ADCCalibrationIsFailed(unsigned long ulBase) | {
xASSERT(ulBase == ADC_BASE);
return((xHWREG(ulBase + ADC0_SC3) & ADC0_SC3_CALF) ? xtrue : xfalse);
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Fills each GPIO_InitStruct member with its default value. */ | void GPIO_InitStruct(GPIO_InitType *GPIO_InitStruct) | /* Fills each GPIO_InitStruct member with its default value. */
void GPIO_InitStruct(GPIO_InitType *GPIO_InitStruct) | {
GPIO_InitStruct->Pin = GPIO_PIN_ALL;
GPIO_InitStruct->GPIO_Slew_Rate = GPIO_Slew_Rate_High;
GPIO_InitStruct->GPIO_Mode = GPIO_Mode_Input;
GPIO_InitStruct->GPIO_Alternate = GPIO_NO_AF;
GPIO_InitStruct->GPIO_Pull = GPIO_No_Pull;
GPIO_InitStruct->GPIO_Current = GPIO_DC_2mA;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Sends the command to read a block of data from remote CPU system address */ | uint16_t IPCLtoRBlockRead(volatile tIpcController *psController, uint32_t ulAddress, uint32_t ulShareAddress, uint16_t usLength, uint16_t bBlock, uint32_t ulResponseFlag) | /* Sends the command to read a block of data from remote CPU system address */
uint16_t IPCLtoRBlockRead(volatile tIpcController *psController, uint32_t ulAddress, uint32_t ulShareAddress, uint16_t usLength, uint16_t bBlock, uint32_t ulResponseFlag) | {
uint16_t status;
tIpcMessage sMessage;
sMessage.ulcommand = IPC_BLOCK_READ;
sMessage.uladdress = ulAddress;
sMessage.uldataw1 = (ulResponseFlag & 0xFFFF0000) |(uint32_t)usLength;
sMessage.uldataw2 = ulShareAddress;
IpcRegs.IPCSET.all |= (ulResponseFlag & 0xFFFF0000);
status = IpcPut (p... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* It will first initialize some of the internal states then build and send a RRQ request packet, at last, it will start receive for the downloading. */ | EFI_STATUS Mtftp4RrqStart(IN MTFTP4_PROTOCOL *Instance, IN UINT16 Operation) | /* It will first initialize some of the internal states then build and send a RRQ request packet, at last, it will start receive for the downloading. */
EFI_STATUS Mtftp4RrqStart(IN MTFTP4_PROTOCOL *Instance, IN UINT16 Operation) | {
EFI_STATUS Status;
Status = Mtftp4InitBlockRange (&Instance->Blocks, 1, 0xffff);
if (EFI_ERROR (Status)) {
return Status;
}
Status = Mtftp4SendRequest (Instance);
if (EFI_ERROR (Status)) {
return Status;
}
return UdpIoRecvDatagram (Instance->UnicastPort, Mtftp4RrqInput, Instance, 0);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* write a 2-word data to a specific IDE port. */ | VOID EFIAPI IdeWritePortDW(IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT16 Port, IN UINT32 Data) | /* write a 2-word data to a specific IDE port. */
VOID EFIAPI IdeWritePortDW(IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT16 Port, IN UINT32 Data) | {
ASSERT (PciIo != NULL);
PciIo->Io.Write (
PciIo,
EfiPciIoWidthUint32,
EFI_PCI_IO_PASS_THROUGH_BAR,
(UINT64)Port,
1,
&Data
);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Since this function gets called with the 'nextarg' pointer from within the getparameter a lot, we must check it for NULL before accessing the str data. */ | static ParameterError str2double(double *val, const char *str, long max) | /* Since this function gets called with the 'nextarg' pointer from within the getparameter a lot, we must check it for NULL before accessing the str data. */
static ParameterError str2double(double *val, const char *str, long max) | {
if(str) {
char *endptr;
double num;
errno = 0;
num = strtod(str, &endptr);
if(errno == ERANGE)
return PARAM_NUMBER_TOO_LARGE;
if(num > max) {
return PARAM_NUMBER_TOO_LARGE;
}
if((endptr != str) && (endptr == str + strlen(str))) {
*val = num;
return PARAM_OK;
... | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Execute FMC_ISPCMD_BLOCK_ERASE command to erase a flash block. The block size is 4 pages. */ | int32_t FMC_Erase_Block(uint32_t u32BlockAddr) | /* Execute FMC_ISPCMD_BLOCK_ERASE command to erase a flash block. The block size is 4 pages. */
int32_t FMC_Erase_Block(uint32_t u32BlockAddr) | {
int32_t ret = 0;
FMC->ISPCMD = FMC_ISPCMD_BLOCK_ERASE;
FMC->ISPADDR = u32BlockAddr;
FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk;
while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { }
if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk)
{
FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk;
ret = -1;
}
return ... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* wl3501_release - unregister the net, release PCMCIA configuration */ | static void wl3501_release(struct pcmcia_device *link) | /* wl3501_release - unregister the net, release PCMCIA configuration */
static void wl3501_release(struct pcmcia_device *link) | {
struct net_device *dev = link->priv;
if (link->dev_node)
unregister_netdev(dev);
pcmcia_disable_device(link);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Called for each entry in a dissector table. */ | static void dissector_table_foreach_func(gpointer key, gpointer value, gpointer user_data) | /* Called for each entry in a dissector table. */
static void dissector_table_foreach_func(gpointer key, gpointer value, gpointer user_data) | {
dissector_foreach_info_t *info;
dtbl_entry_t *dtbl_entry;
g_assert(value);
g_assert(user_data);
dtbl_entry = (dtbl_entry_t *)value;
if (dtbl_entry->current == NULL ||
dtbl_entry->current->protocol == NULL) {
return;
}
info = (dissector_foreach_info_t *)user_data;
info->caller_func(info->ta... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Calculate the flat array subscript of a (Channel, Device) pair. */ | STATIC UINTN FlatDeviceIndex(IN CONST EFI_SATA_CONTROLLER_PRIVATE_DATA *Private, IN UINTN Channel, IN UINTN Device) | /* Calculate the flat array subscript of a (Channel, Device) pair. */
STATIC UINTN FlatDeviceIndex(IN CONST EFI_SATA_CONTROLLER_PRIVATE_DATA *Private, IN UINTN Channel, IN UINTN Device) | {
ASSERT (Private != NULL);
ASSERT (Channel < Private->IdeInit.ChannelCount);
ASSERT (Device < Private->DeviceCount);
return Channel * Private->DeviceCount + Device;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This API used to get the power control bit in the register 0x4B bit 0. */ | BMM050_RETURN_FUNCTION_TYPE bmm050_get_power_mode(u8 *v_power_mode_u8) | /* This API used to get the power control bit in the register 0x4B bit 0. */
BMM050_RETURN_FUNCTION_TYPE bmm050_get_power_mode(u8 *v_power_mode_u8) | {
BMM050_RETURN_FUNCTION_TYPE com_rslt = ERROR;
u8 v_data_u8 = BMM050_INIT_VALUE;
if (p_bmm050 == BMM050_NULL)
{
return E_BMM050_NULL_PTR;
}
else
{
com_rslt = p_bmm050->BMM050_BUS_READ_FUNC(
p_bmm050->dev_addr,
BMM050_POWER_CONTR... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* @pcie_port: PCIe port to write to @cfg_offset: Address to write @val: Value to write */ | static void cvmx_pcie_cfgx_write(int pcie_port, uint32_t cfg_offset, uint32_t val) | /* @pcie_port: PCIe port to write to @cfg_offset: Address to write @val: Value to write */
static void cvmx_pcie_cfgx_write(int pcie_port, uint32_t cfg_offset, uint32_t val) | {
union cvmx_pescx_cfg_wr pescx_cfg_wr;
pescx_cfg_wr.u64 = 0;
pescx_cfg_wr.s.addr = cfg_offset;
pescx_cfg_wr.s.data = val;
cvmx_write_csr(CVMX_PESCX_CFG_WR(pcie_port), pescx_cfg_wr.u64);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Encodes a 16-bit number into hexadecimal, writing exactly 4 hex chars. */ | static int write_hex16(char *out, uint16_t val) | /* Encodes a 16-bit number into hexadecimal, writing exactly 4 hex chars. */
static int write_hex16(char *out, uint16_t val) | {
const char *hex = "0123456789ABCDEF";
*out++ = hex[(val >> 12) & 0xF];
*out++ = hex[(val >> 8) & 0xF];
*out++ = hex[(val >> 4) & 0xF];
*out++ = hex[ val & 0xF];
return 4;
} | analogdevicesinc/EVAL-ADICUP3029 | C++ | Other | 36 |
/* Get the gyro biases and temperature record from MPL */ | void inv_get_gyro_bias(long *bias, long *temp) | /* Get the gyro biases and temperature record from MPL */
void inv_get_gyro_bias(long *bias, long *temp) | {
if (bias != NULL)
memcpy(bias, inv_data_builder.save.gyro_bias,
sizeof(inv_data_builder.save.gyro_bias));
if (temp != NULL)
temp[0] = inv_data_builder.save.gyro_temp;
} | Luos-io/luos_engine | C++ | MIT License | 496 |
/* Configure the internal clock of both SIO HS-UARTs, if they are enabled via FSP */ | int arch_cpu_init_dm(void) | /* Configure the internal clock of both SIO HS-UARTs, if they are enabled via FSP */
int arch_cpu_init_dm(void) | {
struct udevice *dev;
void *base;
int ret;
int i;
for (i = 0; i < 2; i++) {
ret = dm_pci_bus_find_bdf(PCI_BDF(0, 0x1e, 3 + i), &dev);
if (!ret) {
base = dm_pci_map_bar(dev, PCI_BASE_ADDRESS_0,
PCI_REGION_MEM);
hsuart_clock_set(base);
}
}
return 0;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Set bit field value to the buffer. Note: Data type UINT32 can cover all the bit field value. */ | VOID SetBitsQuestionValue(IN HII_STATEMENT *Question, IN OUT UINT8 *Buffer, IN UINT32 Value) | /* Set bit field value to the buffer. Note: Data type UINT32 can cover all the bit field value. */
VOID SetBitsQuestionValue(IN HII_STATEMENT *Question, IN OUT UINT8 *Buffer, IN UINT32 Value) | {
UINT32 Operand;
UINTN StartBit;
UINTN EndBit;
UINT32 RetVal;
StartBit = Question->BitVarOffset % 8;
EndBit = StartBit + Question->BitStorageWidth - 1;
CopyMem ((UINT8 *)&Operand, Buffer, Question->StorageWidth);
RetVal = BitFieldWrite32 (Operand, StartBit, EndBit, Value);
CopyMem (Buffer, (U... | tianocore/edk2 | C++ | Other | 4,240 |
/* This function does not return until the protection has been saved. */ | int32_t FlashUserSave(void) | /* This function does not return until the protection has been saved. */
int32_t FlashUserSave(void) | {
HWREG(FLASH_FMA) = 0x80000000;
HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_COMT;
while (HWREG(FLASH_FMC) & FLASH_FMC_COMT)
{
}
HWREG(FLASH_FMA) = 0x80000001;
HWREG(FLASH_FMC) = FLASH_FMC_WRKEY | FLASH_FMC_COMT;
while (HWREG(FLASH_FMC) & FLASH_FMC_COMT)
{
}
return (0);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* ks_read_config - read chip configuration of bus width. @ks: The chip information */ | static void ks_read_config(struct ks_net *ks) | /* ks_read_config - read chip configuration of bus width. @ks: The chip information */
static void ks_read_config(struct ks_net *ks) | {
u16 reg_data = 0;
reg_data = ks_rdreg8(ks, KS_CCR) & 0x00FF;
reg_data |= ks_rdreg8(ks, KS_CCR+1) << 8;
ks->sharedbus = (reg_data & CCR_SHARED) == CCR_SHARED;
if (reg_data & CCR_8BIT) {
ks->bus_width = ENUM_BUS_8BIT;
ks->extra_byte = 1;
} else if (reg_data & CCR_16BIT) {
ks->bus_width = ENUM_BUS_16BIT;
k... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Returns the previous prop/declaration pair of the list, or NULL if we reached end of list (or if an error occurs) */ | CRPropList* cr_prop_list_get_prev(CRPropList *a_this) | /* Returns the previous prop/declaration pair of the list, or NULL if we reached end of list (or if an error occurs) */
CRPropList* cr_prop_list_get_prev(CRPropList *a_this) | {
g_return_val_if_fail (a_this && PRIVATE (a_this), NULL);
return PRIVATE (a_this)->prev;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Return the Alternate Setting of the current interface. Input : Length - How many bytes are needed. */ | uint8_t* Standard_GetInterface(uint16_t Length) | /* Return the Alternate Setting of the current interface. Input : Length - How many bytes are needed. */
uint8_t* Standard_GetInterface(uint16_t Length) | {
if (Length == 0)
{
pInformation->Ctrl_Info.Usb_wLength = sizeof(pInformation->CurrentAlternateSetting);
return 0;
}
pUser_Standard_Requests->User_GetInterface();
return (uint8_t*)&pInformation->CurrentAlternateSetting;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* This function disables a periodic SMI handler that has been previously enabled with */ | BOOLEAN EFIAPI PeriodicSmiDisable(IN EFI_HANDLE DispatchHandle OPTIONAL) | /* This function disables a periodic SMI handler that has been previously enabled with */
BOOLEAN EFIAPI PeriodicSmiDisable(IN EFI_HANDLE DispatchHandle OPTIONAL) | {
PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT *PeriodicSmiLibraryHandler;
EFI_STATUS Status;
PeriodicSmiLibraryHandler = LookupPeriodicSmiLibraryHandler (DispatchHandle);
if (PeriodicSmiLibraryHandler == NULL) {
return FALSE;
}
Status = gSmmPeriodicTimerDispatch2->UnRegister (
... | tianocore/edk2 | C++ | Other | 4,240 |
/* In Half duplex GMAC disables the back pressure feature. */ | void synopGMAC_tx_flow_control_disable(synopGMACdevice *gmacdev) | /* In Half duplex GMAC disables the back pressure feature. */
void synopGMAC_tx_flow_control_disable(synopGMACdevice *gmacdev) | {
synopGMACClearBits(gmacdev -> MacBase, GmacFlowControl, GmacTxFlowControl);
return;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* HPF or SLOPE filter selection on wake-up and Activity/Inactivity functions.. */ | int32_t lsm6dso_xl_hp_path_internal_get(stmdev_ctx_t *ctx, lsm6dso_slope_fds_t *val) | /* HPF or SLOPE filter selection on wake-up and Activity/Inactivity functions.. */
int32_t lsm6dso_xl_hp_path_internal_get(stmdev_ctx_t *ctx, lsm6dso_slope_fds_t *val) | {
lsm6dso_tap_cfg0_t reg;
int32_t ret;
ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t *)®, 1);
switch (reg.slope_fds) {
case LSM6DSO_USE_SLOPE:
*val = LSM6DSO_USE_SLOPE;
break;
case LSM6DSO_USE_HPF:
*val = LSM6DSO_USE_HPF;
break;
default:
*val = LSM6DSO_USE_S... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Unlatch IO pins after waking up from shutdown This needs to be called during POST_KERNEL in order for "Booting Zephyr" message to show up */ | static int unlatch_pins(void) | /* Unlatch IO pins after waking up from shutdown This needs to be called during POST_KERNEL in order for "Booting Zephyr" message to show up */
static int unlatch_pins(void) | {
uint32_t rSrc = SysCtrlResetSourceGet();
if (rSrc == RSTSRC_WAKEUP_FROM_SHUTDOWN) {
PowerCtrlPadSleepDisable();
}
return 0;
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Deinitializes the XFMC NAND Banks registers to their default reset values. */ | void XFMC_DeInitNand(XFMC_Bank23_Module *Bank) | /* Deinitializes the XFMC NAND Banks registers to their default reset values. */
void XFMC_DeInitNand(XFMC_Bank23_Module *Bank) | {
assert_param(IS_XFMC_NAND_BANK(Bank));
Bank->CTRLx = XFMC_NAND_CTRL_RESET;
Bank->STSx = XFMC_NAND_STS_RESET;
Bank->CMEMTMx = XFMC_NAND_CMEMTM_RESET;
Bank->ATTMEMTMx = XFMC_NAND_ATTMEMTM_RESET;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* can_nice - check if a task can reduce its nice value */ | int can_nice(const struct task_struct *p, const int nice) | /* can_nice - check if a task can reduce its nice value */
int can_nice(const struct task_struct *p, const int nice) | {
int nice_rlim = 20 - nice;
return (nice_rlim <= p->signal->rlim[RLIMIT_NICE].rlim_cur ||
capable(CAP_SYS_NICE));
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Our memrchr() function clone for systems which lack this function. The memrchr() function is like the memchr() function, except that it searches backwards from the end of the n bytes pointed to by s instead of forward from the beginning. */ | void* Curl_memrchr(const void *s, int c, size_t n) | /* Our memrchr() function clone for systems which lack this function. The memrchr() function is like the memchr() function, except that it searches backwards from the end of the n bytes pointed to by s instead of forward from the beginning. */
void* Curl_memrchr(const void *s, int c, size_t n) | {
if(n > 0) {
const unsigned char *p = s;
const unsigned char *q = s;
p += n - 1;
while(p >= q) {
if(*p == (unsigned char)c)
return (void *)p;
p--;
}
}
return NULL;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* If Context is NULL, then ASSERT(). If CpuCount is NULL, then ASSERT(). If CpuIndex exceeds the range of all CPUs in the system, then ASSERT(). */ | VOID EFIAPI SmmCpuSyncLockDoor(IN OUT SMM_CPU_SYNC_CONTEXT *Context, IN UINTN CpuIndex, OUT UINTN *CpuCount) | /* If Context is NULL, then ASSERT(). If CpuCount is NULL, then ASSERT(). If CpuIndex exceeds the range of all CPUs in the system, then ASSERT(). */
VOID EFIAPI SmmCpuSyncLockDoor(IN OUT SMM_CPU_SYNC_CONTEXT *Context, IN UINTN CpuIndex, OUT UINTN *CpuCount) | {
ASSERT (Context != NULL);
ASSERT (CpuCount != NULL);
ASSERT (CpuIndex < Context->NumberOfCpus);
Context->ArrivedCpuCountUponLock = *Context->CpuCount;
*CpuCount = InternalLockdownSemaphore (Context->CpuCount);
Context->ArrivedCpuCountUponLock = *CpuCount;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* USBD_LL_OpenEP Open an endpoint of the Low Level Driver. */ | USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps) | /* USBD_LL_OpenEP Open an endpoint of the Low Level Driver. */
USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps) | {
HAL_PCD_EP_Open(pdev->pData,
ep_addr,
ep_mps,
ep_type);
return USBD_OK;
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* If the conversion results in an overflow or an underflow condition, then Result is set to INTN_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */ | RETURN_STATUS EFIAPI SafeInt64ToIntn(IN INT64 Operand, OUT INTN *Result) | /* If the conversion results in an overflow or an underflow condition, then Result is set to INTN_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeInt64ToIntn(IN INT64 Operand, OUT INTN *Result) | {
return SafeInt64ToInt32 (Operand, (INT32 *)Result);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This function dumps all LPT LEBs. The caller has to make sure the LPT is locked. */ | void ubifs_dump_lpt_lebs(const struct ubifs_info *c) | /* This function dumps all LPT LEBs. The caller has to make sure the LPT is locked. */
void ubifs_dump_lpt_lebs(const struct ubifs_info *c) | {
int i;
pr_err("(pid %d) start dumping all LPT LEBs\n", current->pid);
for (i = 0; i < c->lpt_lebs; i++)
dump_lpt_leb(c, i + c->lpt_first);
pr_err("(pid %d) finish dumping all LPT LEBs\n", current->pid);
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* This function waits until the SDIO DMA data transfer is finished. This function should be called after SDIO_ReadMultiBlocks() function to insure that all data sent by the card are already transferred by the DMA controller. */ | SD_Error SD_WaitReadOperation(void) | /* This function waits until the SDIO DMA data transfer is finished. This function should be called after SDIO_ReadMultiBlocks() function to insure that all data sent by the card are already transferred by the DMA controller. */
SD_Error SD_WaitReadOperation(void) | {
SD_Error errorstatus = SD_OK;
while ((SD_DMAEndOfTransferStatus() == RESET) && (TransferEnd == 0) && (TransferError == SD_OK))
{}
if (TransferError != SD_OK)
{
return(TransferError);
}
return(errorstatus);
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* search a mode with the right pixel format */ | static int gspca_get_mode(struct gspca_dev *gspca_dev, int mode, int pixfmt) | /* search a mode with the right pixel format */
static int gspca_get_mode(struct gspca_dev *gspca_dev, int mode, int pixfmt) | {
int modeU, modeD;
modeU = modeD = mode;
while ((modeU < gspca_dev->cam.nmodes) || modeD >= 0) {
if (--modeD >= 0) {
if (gspca_dev->cam.cam_mode[modeD].pixelformat
== pixfmt)
return modeD;
}
if (++modeU < gspca_dev->cam.nmodes) {
if (gspca_dev->cam.cam_mode[modeU].pixelformat
== pixf... | 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.