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 |
|---|---|---|---|---|---|---|---|
/* Like many other parts of the driver, this code relies on being polled more than once per second as long as the controller is running. */ | static void uhci_get_current_frame_number(struct uhci_hcd *uhci) | /* Like many other parts of the driver, this code relies on being polled more than once per second as long as the controller is running. */
static void uhci_get_current_frame_number(struct uhci_hcd *uhci) | {
if (!uhci->is_stopped) {
unsigned delta;
delta = (inw(uhci->io_addr + USBFRNUM) - uhci->frame_number) &
(UHCI_NUMFRAMES - 1);
uhci->frame_number += delta;
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* the bootldr command loads an address, checks to see if there is a Boot stream that the on-chip BOOTROM can understand, and loads it via the BOOTROM Callback. It is possible to also add booting from SPI, or TWI, but this function does not currently support that. */ | int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) | /* the bootldr command loads an address, checks to see if there is a Boot stream that the on-chip BOOTROM can understand, and loads it via the BOOTROM Callback. It is possible to also add booting from SPI, or TWI, but this function does not currently support that. */
int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc... | {
void *addr;
if (argc < 2)
addr = (void *)load_addr;
else
addr = (void *)simple_strtoul(argv[1], NULL, 16);
if (ldr_valid_signature(addr)) {
printf("## Booting ldr image at 0x%p ...\n", addr);
ldr_load(addr);
icache_disable();
dcache_disable();
ldr_exec(addr);
} else
printf("## No ldr image at add... | EmcraftSystems/u-boot | C++ | Other | 181 |
/* Return the current status of the integrated USB DMA interrupts. */ | uint32_t USBDMAChannelIntStatus(uint32_t ui32Base) | /* Return the current status of the integrated USB DMA interrupts. */
uint32_t USBDMAChannelIntStatus(uint32_t ui32Base) | {
ASSERT(ui32Base == USB0_BASE);
return (HWREG(ui32Base + USB_O_DMAINTR));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This function apply tuner config to tuner specified by tun_setup structure. I addr is unset, then admin status and tun addr status is more precise then current status, it's applied. Otherwise status and type are applied only to tuner with exactly the same addr. */ | static void set_addr(struct i2c_client *c, struct tuner_setup *tun_setup) | /* This function apply tuner config to tuner specified by tun_setup structure. I addr is unset, then admin status and tun addr status is more precise then current status, it's applied. Otherwise status and type are applied only to tuner with exactly the same addr. */
static void set_addr(struct i2c_client *c, struct t... | {
struct tuner *t = to_tuner(i2c_get_clientdata(c));
if ( (t->type == UNSET && ((tun_setup->addr == ADDR_UNSET) &&
(t->mode_mask & tun_setup->mode_mask))) ||
(tun_setup->addr == c->addr)) {
set_type(c, tun_setup->type, tun_setup->mode_mask,
tun_setup->config, tun_setup->tuner_callback);
} else
tuner_db... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* If 64-bit I/O port operations are not supported, then ASSERT(). If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). */ | UINT64 EFIAPI S3IoBitFieldWrite64(IN UINTN Port, IN UINTN StartBit, IN UINTN EndBit, IN UINT64 Value) | /* If 64-bit I/O port operations are not supported, then ASSERT(). If StartBit is greater than 63, then ASSERT(). If EndBit is greater than 63, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). */
UINT64 EFIAPI... | {
return InternalSaveIoWrite64ValueToBootScript (Port, IoBitFieldWrite64 (Port, StartBit, EndBit, Value));
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Indicates whether or not the I2C Master is busy. */ | bool I2CMasterBusy(uint32_t ui32Base) | /* Indicates whether or not the I2C Master is busy. */
bool I2CMasterBusy(uint32_t ui32Base) | {
ASSERT(_I2CBaseValid(ui32Base));
if(HWREG(ui32Base + I2C_O_MCS) & I2C_MCS_BUSY)
{
return(true);
}
else
{
return(false);
}
} | micropython/micropython | C++ | Other | 18,334 |
/* Mark the block reservation window as not allocated, and unlink it from the filesystem reservation window rb tree. Must be called with rsv_lock hold. */ | static void rsv_window_remove(struct super_block *sb, struct ext3_reserve_window_node *rsv) | /* Mark the block reservation window as not allocated, and unlink it from the filesystem reservation window rb tree. Must be called with rsv_lock hold. */
static void rsv_window_remove(struct super_block *sb, struct ext3_reserve_window_node *rsv) | {
rsv->rsv_start = EXT3_RESERVE_WINDOW_NOT_ALLOCATED;
rsv->rsv_end = EXT3_RESERVE_WINDOW_NOT_ALLOCATED;
rsv->rsv_alloc_hit = 0;
rb_erase(&rsv->rsv_node, &EXT3_SB(sb)->s_rsv_window_root);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Returns 0 if the device function was successfully reset or negative if the device doesn't support resetting a single function. */ | int __pci_reset_function(struct pci_dev *dev) | /* Returns 0 if the device function was successfully reset or negative if the device doesn't support resetting a single function. */
int __pci_reset_function(struct pci_dev *dev) | {
return pci_dev_reset(dev, 0);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Enables or disables the TIM Capture Compare Channel xN. */ | void TIM_CCxNCmd(TIM_TypeDef *TIMx, uint16_t TIM_Channel, uint16_t TIM_CCxN) | /* Enables or disables the TIM Capture Compare Channel xN. */
void TIM_CCxNCmd(TIM_TypeDef *TIMx, uint16_t TIM_Channel, uint16_t TIM_CCxN) | {
assert_param(IS_TIM_18_PERIPH(TIMx));
assert_param(IS_TIM_COMPLEMENTARY_CHANNEL(TIM_Channel));
assert_param(IS_TIM_CCXN(TIM_CCxN));
TIMx->CCER &= (uint16_t)(~((uint16_t)(CCER_CCNE_Set << TIM_Channel)));
TIMx->CCER |= (uint16_t)(TIM_CCxN << TIM_Channel);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* 3) Change the name of the function __cs3_isr_interrupt_80() within portasm.S to be correct for whichever vector number is being used. By default interrupt controller 0 vector number 16 is used, which corresponds to vector number 80. */ | void vApplicationSetupInterrupts(void) | /* 3) Change the name of the function __cs3_isr_interrupt_80() within portasm.S to be correct for whichever vector number is being used. By default interrupt controller 0 vector number 16 is used, which corresponds to vector number 80. */
void vApplicationSetupInterrupts(void) | {
const unsigned portSHORT usCompareMatchValue = ( ( configCPU_CLOCK_HZ / portPRESCALE_VALUE ) / configTICK_RATE_HZ );
MCF_INTC0_ICR55 = ( 1 | ( configKERNEL_INTERRUPT_PRIORITY << 3 ) );
MCF_INTC0_IMRH &= ~( MCF_INTC_IMRH_INT_MASK55 );
MCF_INTC0_ICR16 = ( 0 | ( configKERNEL_INTERRUPT_PRIORITY << 3 ) );
... | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Returns 0 on success or -ENOMEM on error. */ | static int smack_sb_alloc_security(struct super_block *sb) | /* Returns 0 on success or -ENOMEM on error. */
static int smack_sb_alloc_security(struct super_block *sb) | {
struct superblock_smack *sbsp;
sbsp = kzalloc(sizeof(struct superblock_smack), GFP_KERNEL);
if (sbsp == NULL)
return -ENOMEM;
sbsp->smk_root = smack_known_floor.smk_known;
sbsp->smk_default = smack_known_floor.smk_known;
sbsp->smk_floor = smack_known_floor.smk_known;
sbsp->smk_hat = smack_known_hat.smk_known... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Requests a uDMA channel to start a transfer. */ | void uDMAChannelRequest(unsigned long ulChannelNum) | /* Requests a uDMA channel to start a transfer. */
void uDMAChannelRequest(unsigned long ulChannelNum) | {
ASSERT((ulChannelNum & 0xffff) < 32);
HWREG(UDMA_SWREQ) = 1 << (ulChannelNum & 0x1f);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Sends an amount of data in non blocking mode. */ | ald_status_t ald_uart_send_by_it(ald_uart_handle_t *hperh, uint8_t *buf, uint16_t size) | /* Sends an amount of data in non blocking mode. */
ald_status_t ald_uart_send_by_it(ald_uart_handle_t *hperh, uint8_t *buf, uint16_t size) | {
assert_param(IS_UART_ALL(hperh->perh));
if ((hperh->state != ALD_UART_STATE_READY) && (hperh->state != ALD_UART_STATE_BUSY_RX))
return ALD_BUSY;
if ((buf == NULL ) || (size == 0))
return ALD_ERROR;
__LOCK(hperh);
hperh->tx_buf = buf;
hperh->tx_size = size;
hperh->tx_coun... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Free all blocks associated with the releasing file_priv */ | void nouveau_mem_release(struct drm_file *file_priv, struct mem_block *heap) | /* Free all blocks associated with the releasing file_priv */
void nouveau_mem_release(struct drm_file *file_priv, struct mem_block *heap) | {
struct mem_block *p;
if (!heap || !heap->next)
return;
list_for_each(p, heap) {
if (p->file_priv == file_priv)
p->file_priv = NULL;
}
list_for_each(p, heap) {
while ((p->file_priv == NULL) &&
(p->next->file_priv == NULL) &&
(p->next != heap)) {
struct mem_block *q = p->next;
p->size += q... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function sets the information about the file for the opened handle specified. */ | EFI_STATUS EFIAPI FileHandleSetInfo(IN EFI_FILE_HANDLE FileHandle, IN CONST EFI_FILE_INFO *FileInfo) | /* This function sets the information about the file for the opened handle specified. */
EFI_STATUS EFIAPI FileHandleSetInfo(IN EFI_FILE_HANDLE FileHandle, IN CONST EFI_FILE_INFO *FileInfo) | {
if ((FileHandle == NULL) || (FileInfo == NULL)) {
return (EFI_INVALID_PARAMETER);
}
return (FileHandle->SetInfo (
FileHandle,
&gEfiFileInfoGuid,
(UINTN)FileInfo->Size,
(EFI_FILE_INFO *)FileInfo
... | tianocore/edk2 | C++ | Other | 4,240 |
/* Go through timeout list (for this task only) and remove the first matching entry, even though the timeout has not triggered yet. */ | void sys_untimeout(sys_timeout_handler h, void *arg) | /* Go through timeout list (for this task only) and remove the first matching entry, even though the timeout has not triggered yet. */
void sys_untimeout(sys_timeout_handler h, void *arg) | {
struct sys_timeouts *timeouts;
struct sys_timeo *prev_t, *t;
timeouts = sys_arch_timeouts();
if (timeouts == NULL) {
LWIP_ASSERT("sys_untimeout: timeouts != NULL", timeouts != NULL);
return;
}
if (timeouts->next == NULL) {
return;
}
for (t = timeouts->next, prev_t = NULL; t != NULL; prev_t... | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* This routine is called whenever a serial port is opened. It enables interrupts for a serial port, linking in its async structure into the IRQ chain. It also performs the serial-specific initialization for the tty structure. */ | static int mxser_open(struct tty_struct *tty, struct file *filp) | /* This routine is called whenever a serial port is opened. It enables interrupts for a serial port, linking in its async structure into the IRQ chain. It also performs the serial-specific initialization for the tty structure. */
static int mxser_open(struct tty_struct *tty, struct file *filp) | {
struct mxser_port *info;
int line;
line = tty->index;
if (line == MXSER_PORTS)
return 0;
if (line < 0 || line > MXSER_PORTS)
return -ENODEV;
info = &mxser_boards[line / MXSER_PORTS_PER_BOARD].ports[line % MXSER_PORTS_PER_BOARD];
if (!info->ioaddr)
return -ENODEV;
return tty_port_open(&info->port, tty, f... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* NULL request string support depends on the ExportConfig interface of HiiConfigRouting protocol in UEFI specification. */ | BOOLEAN EFIAPI HiiSetToDefaults(IN CONST EFI_STRING Request OPTIONAL, IN UINT16 DefaultId) | /* NULL request string support depends on the ExportConfig interface of HiiConfigRouting protocol in UEFI specification. */
BOOLEAN EFIAPI HiiSetToDefaults(IN CONST EFI_STRING Request OPTIONAL, IN UINT16 DefaultId) | {
return InternalHiiIfrValueAction (Request, DefaultId, ACTION_SET_DEFAUTL_VALUE);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* ADC Power On.
If the ADC is in power-down mode then it is powered up. The application needs to wait a time of about 3 microseconds for stabilization before using the ADC. If the ADC is already on this function call will initiate a conversion. */ | void adc_on(uint32_t adc) | /* ADC Power On.
If the ADC is in power-down mode then it is powered up. The application needs to wait a time of about 3 microseconds for stabilization before using the ADC. If the ADC is already on this function call will initiate a conversion. */
void adc_on(uint32_t adc) | {
ADC_CR2(adc) |= ADC_CR2_ADON;
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* Return the required GTT alignment for an object, taking into account potential fence register mapping if needed. */ | static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj) | /* Return the required GTT alignment for an object, taking into account potential fence register mapping if needed. */
static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj) | {
struct drm_device *dev = obj->dev;
struct drm_i915_gem_object *obj_priv = obj->driver_private;
int start, i;
if (IS_I965G(dev) || obj_priv->tiling_mode == I915_TILING_NONE)
return 4096;
if (IS_I9XX(dev))
start = 1024*1024;
else
start = 512*1024;
for (i = start; i < obj->size; i <<= 1)
;
return i;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Erase all chip of Serial Flash device.
The CE instruction is for erasing the data of the whole chip to be "1". */ | enum status_code mx25l_erase_chip(void) | /* Erase all chip of Serial Flash device.
The CE instruction is for erasing the data of the whole chip to be "1". */
enum status_code mx25l_erase_chip(void) | {
enum status_code status;
uint8_t tx_buf[1] = {MX25L_CMD_CE};
if (_mx25l_is_flash_busy()) {
return STATUS_BUSY;
}
_mx25l_send_cmd_write_latch(MX25L_CMD_WREN);
_mx25l_chip_select();
status = spi_write_buffer_wait(&_mx25l_spi, tx_buf, 1);
if (status != STATUS_OK) {
return STATUS_ERR_IO;
}
_mx25l_chip_desel... | memfault/zero-to-main | C++ | null | 200 |
/* Calling copy_to_user() in atomic context is not desirable. Hence first copying the data to a pre-allocated kernel page and then copying to user space in non-atomic context. */ | ssize_t copy_oldmem_page(unsigned long pfn, char *buf, size_t csize, unsigned long offset, int userbuf) | /* Calling copy_to_user() in atomic context is not desirable. Hence first copying the data to a pre-allocated kernel page and then copying to user space in non-atomic context. */
ssize_t copy_oldmem_page(unsigned long pfn, char *buf, size_t csize, unsigned long offset, int userbuf) | {
void *vaddr;
if (!csize)
return 0;
vaddr = __va(pfn<<PAGE_SHIFT);
if (userbuf) {
if (copy_to_user(buf, (vaddr + offset), csize)) {
return -EFAULT;
}
} else
memcpy(buf, (vaddr + offset), csize);
return csize;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This API is used to get the fifo watermark interrupt2 data in the register 0x1A bit 6. */ | BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr2_fifo_wm(u8 *intr2_fifo_wm_u8) | /* This API is used to get the fifo watermark interrupt2 data in the register 0x1A bit 6. */
BMA2x2_RETURN_FUNCTION_TYPE bma2x2_get_intr2_fifo_wm(u8 *intr2_fifo_wm_u8) | {
u8 data_u8 = BMA2x2_INIT_VALUE;
BMA2x2_RETURN_FUNCTION_TYPE com_rslt = ERROR;
if (p_bma2x2 == BMA2x2_NULL)
{
return E_BMA2x2_NULL_PTR;
}
else
{
com_rslt = p_bma2x2->BMA2x2_BUS_READ_FUNC
(p_bma2x2->dev_addr,
BMA2x2_ENABLE_INTR2_PAD_FIFO... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Read current date/time or alarm date/time from RTC setting. This function is to Read current date/time or alarm date/time from RTC setting. */ | void xRTCTimeRead(xtTime *pxtTime, unsigned long ulTimeAlarm) | /* Read current date/time or alarm date/time from RTC setting. This function is to Read current date/time or alarm date/time from RTC setting. */
void xRTCTimeRead(xtTime *pxtTime, unsigned long ulTimeAlarm) | {
xASSERT(pxtTime != 0);
xASSERT((ulTimeAlarm == xRTC_TIME_CURRENT) || (ulTimeAlarm == xRTC_TIME_ALARM));
switch(ulTimeAlarm)
{
case xRTC_TIME_CURRENT:
{
break;
}
case xRTC_TIME_ALARM:
{
break;
}
def... | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* The function is used to return if the provided JSON value contains a JSON integer. */ | BOOLEAN EFIAPI JsonValueIsInteger(IN EDKII_JSON_VALUE Json) | /* The function is used to return if the provided JSON value contains a JSON integer. */
BOOLEAN EFIAPI JsonValueIsInteger(IN EDKII_JSON_VALUE Json) | {
return json_is_integer ((json_t *)Json);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This function is executed in case of error occurrence. */ | static void Timeout_Error_Handler(void) | /* This function is executed in case of error occurrence. */
static void Timeout_Error_Handler(void) | {
while(1)
{
BSP_LED_On(LED4);
HAL_Delay(500);
BSP_LED_Off(LED4);
HAL_Delay(500);
}
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* ZigBee Device Profile dissector for the system server discovery */ | void dissect_zbee_zdp_rsp_system_server_disc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) | /* ZigBee Device Profile dissector for the system server discovery */
void dissect_zbee_zdp_rsp_system_server_disc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) | {
guint offset = 0;
guint8 status;
status = zdp_parse_status(tree, tvb, &offset); zdp_parse_server_flags(tree, ett_zbee_zdp_server, tvb, &offset);
zbee_append_info(tree, pinfo, ", Status: %s", zdp_status_name(status));
zdp_dump_excess(tvb, offset, pinfo, tree);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* EXTINT Ch.7 as KEYSCAN row 2 callback function. */ | static void BSP_KEY_ROW2_IrqCallback(void) | /* EXTINT Ch.7 as KEYSCAN row 2 callback function. */
static void BSP_KEY_ROW2_IrqCallback(void) | {
uint8_t u8Idx = (uint8_t)KEYSCAN_GetKeyoutIdx();
if (SET == EXTINT_GetExtIntStatus(BSP_KEYIN_PORT_PIN[2].ch)) {
for (;;) {
if (PIN_RESET == GPIO_ReadInputPins(BSP_KEYIN_PORT_PIN[2].port, BSP_KEYIN_PORT_PIN[2].pin)) {
m_u32GlobalKey |= (0x100UL) << u8Idx;
} else ... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* bind the write only socket file description into the SSL */ | int SSL_set_wfd(SSL *ssl, int fd) | /* bind the write only socket file description into the SSL */
int SSL_set_wfd(SSL *ssl, int fd) | {
SSL_ASSERT1(ssl);
SSL_ASSERT1(fd >= 0);
SSL_METHOD_CALL(set_fd, ssl, fd, 0);
return 1;
} | retro-esp32/RetroESP32 | C++ | Creative Commons Attribution Share Alike 4.0 International | 581 |
/* Clears a Stall condition on an endpoint of the Low Level Driver. */ | USBD_StatusTypeDef USBD_LL_ClearStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) | /* Clears a Stall condition on an endpoint of the Low Level Driver. */
USBD_StatusTypeDef USBD_LL_ClearStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) | {
HAL_PCD_EP_ClrStall(pdev->pData, ep_addr);
return USBD_OK;
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Message: SubscribeDtmfPayloadResMessage Opcode: 0x012a Type: CallControl Direction: pbx2dev VarLength: no */ | static void handle_SubscribeDtmfPayloadResMessage(ptvcursor_t *cursor, packet_info *pinfo _U_) | /* Message: SubscribeDtmfPayloadResMessage Opcode: 0x012a Type: CallControl Direction: pbx2dev VarLength: no */
static void handle_SubscribeDtmfPayloadResMessage(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 |
/* This function returns the current status of the last program or erase operation performed by the EEPROM. It is intended to provide error information to applications programming or setting EEPROM protection options under interrupt control. */ | unsigned long EEPROMStatusGet(void) | /* This function returns the current status of the last program or erase operation performed by the EEPROM. It is intended to provide error information to applications programming or setting EEPROM protection options under interrupt control. */
unsigned long EEPROMStatusGet(void) | {
return(HWREG(EEPROM_EEDONE));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Reads the value from a PHY register hw - Struct containing variables accessed by shared code reg_addr - address of the PHY register to read */ | int atl1c_read_phy_reg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data) | /* Reads the value from a PHY register hw - Struct containing variables accessed by shared code reg_addr - address of the PHY register to read */
int atl1c_read_phy_reg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data) | {
u32 val;
int i;
val = ((u32)(reg_addr & MDIO_REG_ADDR_MASK)) << MDIO_REG_ADDR_SHIFT |
MDIO_START | MDIO_SUP_PREAMBLE | MDIO_RW |
MDIO_CLK_25_4 << MDIO_CLK_SEL_SHIFT;
AT_WRITE_REG(hw, REG_MDIO_CTRL, val);
for (i = 0; i < MDIO_WAIT_TIMES; i++) {
udelay(2);
AT_READ_REG(hw, REG_MDIO_CTRL, &val);
if (!(val ... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Clear the slave select pins of the specified SPI port. */ | void SPISSClear(unsigned long ulBase) | /* Clear the slave select pins of the specified SPI port. */
void SPISSClear(unsigned long ulBase) | {
xASSERT((ulBase == SPI0_BASE) || (ulBase == SPI1_BASE));
xHWREGB(ulBase + SPI_C2) &= ~SPI_C2_MODFEN;
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* div_s64_rem - signed 64bit divide with 32bit divisor with remainder */ | LIBC_ROM_TEXT_SECTION static _LONG_CALL_ s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) | /* div_s64_rem - signed 64bit divide with 32bit divisor with remainder */
LIBC_ROM_TEXT_SECTION static _LONG_CALL_ s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) | {
*remainder = (s32)dividend % divisor;
return (s32)dividend / divisor;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* get the SSL ahead signal if we can read as many as data */ | int SSL_get_read_ahead(const SSL *ssl) | /* get the SSL ahead signal if we can read as many as data */
int SSL_get_read_ahead(const SSL *ssl) | {
SSL_ASSERT1(ssl);
return ssl->rlayer.read_ahead;
} | retro-esp32/RetroESP32 | C++ | Creative Commons Attribution Share Alike 4.0 International | 581 |
/* Wrapper for the DTR/RTS raise logic. For the moment this is used to hide some internal details. This will eventually become entirely internal to the tty port. */ | void tty_port_raise_dtr_rts(struct tty_port *port) | /* Wrapper for the DTR/RTS raise logic. For the moment this is used to hide some internal details. This will eventually become entirely internal to the tty port. */
void tty_port_raise_dtr_rts(struct tty_port *port) | {
if (port->ops->dtr_rts)
port->ops->dtr_rts(port, 1);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* ring_buffer_event_length - return the length of the event @event: the event to get the length of */ | unsigned ring_buffer_event_length(struct ring_buffer_event *event) | /* ring_buffer_event_length - return the length of the event @event: the event to get the length of */
unsigned ring_buffer_event_length(struct ring_buffer_event *event) | {
unsigned length = rb_event_length(event);
if (event->type_len > RINGBUF_TYPE_DATA_TYPE_LEN_MAX)
return length;
length -= RB_EVNT_HDR_SIZE;
if (length > RB_MAX_SMALL_DATA + sizeof(event->array[0]))
length -= sizeof(event->array[0]);
return length;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Encrypts the len-bytes in the specified data-array, using the specified 256-bit (32 bytes) key. The results are written back into the same array. */ | void TbxCryptoAes256Encrypt(uint8_t *data, size_t len, uint8_t const *key) | /* Encrypts the len-bytes in the specified data-array, using the specified 256-bit (32 bytes) key. The results are written back into the same array. */
void TbxCryptoAes256Encrypt(uint8_t *data, size_t len, uint8_t const *key) | {
tbx_aes256_context ctx;
TBX_ASSERT(data != NULL);
TBX_ASSERT(len > 0U);
TBX_ASSERT(key != NULL);
TBX_ASSERT((len % TBX_CRYPTO_AES_BLOCK_SIZE) == 0U);
if ( (data != NULL) && (len > 0U) && (key != NULL) && \
((len % TBX_CRYPTO_AES_BLOCK_SIZE) == 0U) )
{
tbx_aes256_init(&ctx, key);
for (size... | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Process TX_DATA_ACK CPL messages: -> host Process an acknowledgment of WR completion. Advance snd_una and send the next batch of work requests from the write queue. */ | static void check_wr_invariants(struct s3_conn *c3cn) | /* Process TX_DATA_ACK CPL messages: -> host Process an acknowledgment of WR completion. Advance snd_una and send the next batch of work requests from the write queue. */
static void check_wr_invariants(struct s3_conn *c3cn) | {
int pending = count_pending_wrs(c3cn);
if (unlikely(c3cn->wr_avail + pending != c3cn->wr_max))
cxgb3i_log_error("TID %u: credit imbalance: avail %u, "
"pending %u, total should be %u\n",
c3cn->tid, c3cn->wr_avail, pending,
c3cn->wr_max);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* param handle codec handle. param mclk master clock frequency in HZ. param sampleRate sample rate in HZ. param bitWidth bit width. return kStatus_Success is success, else configure failed. */ | status_t HAL_CODEC_SetFormat(void *handle, uint32_t mclk, uint32_t sampleRate, uint32_t bitWidth) | /* param handle codec handle. param mclk master clock frequency in HZ. param sampleRate sample rate in HZ. param bitWidth bit width. return kStatus_Success is success, else configure failed. */
status_t HAL_CODEC_SetFormat(void *handle, uint32_t mclk, uint32_t sampleRate, uint32_t bitWidth) | {
assert(handle != NULL);
return WM8960_ConfigDataFormat((wm8960_handle_t *)((uint32_t)(((codec_handle_t *)handle)->codecDevHandle)), mclk,
sampleRate, bitWidth);
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Enables offset cancellation in single measurement mode. The OFF_CANC bit must be set to 1 when enabling offset cancellation in single measurement mode this means a call function: set_rst_mode(SENS_OFF_CANC_EVERY_ODR) is need.. */ | int32_t lis2mdl_set_rst_sensor_single_set(stmdev_ctx_t *ctx, uint8_t val) | /* Enables offset cancellation in single measurement mode. The OFF_CANC bit must be set to 1 when enabling offset cancellation in single measurement mode this means a call function: set_rst_mode(SENS_OFF_CANC_EVERY_ODR) is need.. */
int32_t lis2mdl_set_rst_sensor_single_set(stmdev_ctx_t *ctx, uint8_t val) | {
lis2mdl_cfg_reg_b_t reg;
int32_t ret;
ret = lis2mdl_read_reg(ctx, LIS2MDL_CFG_REG_B, (uint8_t*)®, 1);
if(ret == 0){
reg.off_canc_one_shot = val;
ret = lis2mdl_write_reg(ctx, LIS2MDL_CFG_REG_B, (uint8_t*)®, 1);
}
return ret;
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Set the order of the data to be crypted. */ | void crypto_set_datatype(enum crypto_datatype datatype) | /* Set the order of the data to be crypted. */
void crypto_set_datatype(enum crypto_datatype datatype) | {
CRYP_CR = (CRYP_CR & ~CRYP_CR_DATATYPE) |
(datatype << CRYP_CR_DATATYPE_SHIFT);
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* Returns 0 in case of success, -1 otherwise */ | int xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler) | /* Returns 0 in case of success, -1 otherwise */
int xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler) | {
return(xmlSwitchInputEncodingInt(ctxt, input, handler, -1));
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* This function allows a caller to extract the current configuration for one or more named elements from the target driver. */ | EFI_STATUS EFIAPI RamDiskExtractConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results) | /* This function allows a caller to extract the current configuration for one or more named elements from the target driver. */
EFI_STATUS EFIAPI RamDiskExtractConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results) | {
if ((Progress == NULL) || (Results == NULL)) {
return EFI_INVALID_PARAMETER;
}
*Progress = Request;
return EFI_NOT_FOUND;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Process a link control command sent from the host to the controller. The HCI command has a 3 byte command header followed by data. The header is: -> opcode (2 bytes) -> Length of parameters (1 byte; does include command header bytes). */ | static int ble_ll_hci_link_ctrl_cmd_proc(const uint8_t *cmdbuf, uint8_t len, uint16_t ocf) | /* Process a link control command sent from the host to the controller. The HCI command has a 3 byte command header followed by data. The header is: -> opcode (2 bytes) -> Length of parameters (1 byte; does include command header bytes). */
static int ble_ll_hci_link_ctrl_cmd_proc(const uint8_t *cmdbuf, uint8_t len, ui... | {
int rc;
switch (ocf) {
case BLE_HCI_OCF_DISCONNECT_CMD:
rc = ble_ll_hci_disconnect(cmdbuf, len);
rc += (BLE_ERR_MAX + 1);
break;
case BLE_HCI_OCF_RD_REM_VER_INFO:
rc = ble_ll_conn_hci_rd_rem_ver_cmd(cmdbuf, len);
rc += (BLE_ERR_MAX + 1);
break;
defau... | arendst/Tasmota | C++ | GNU General Public License v3.0 | 21,318 |
/* If Sha384Context is NULL, then return FALSE. If NewSha384Context is NULL, then return FALSE. If this interface is not supported, then return FALSE. */ | BOOLEAN EFIAPI Sha384Duplicate(IN CONST VOID *Sha384Context, OUT VOID *NewSha384Context) | /* If Sha384Context is NULL, then return FALSE. If NewSha384Context is NULL, then return FALSE. If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI Sha384Duplicate(IN CONST VOID *Sha384Context, OUT VOID *NewSha384Context) | {
if ((Sha384Context == NULL) || (NewSha384Context == NULL)) {
return FALSE;
}
CopyMem (NewSha384Context, Sha384Context, sizeof (SHA512_CTX));
return TRUE;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Sets the functional address for the device that is connected to an endpoint in host mode. */ | void USBHostAddrSet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Addr, uint32_t ui32Flags) | /* Sets the functional address for the device that is connected to an endpoint in host mode. */
void USBHostAddrSet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Addr, uint32_t ui32Flags) | {
ASSERT(ui32Base == USB0_BASE);
ASSERT((ui32Endpoint == USB_EP_0) || (ui32Endpoint == USB_EP_1) ||
(ui32Endpoint == USB_EP_2) || (ui32Endpoint == USB_EP_3) ||
(ui32Endpoint == USB_EP_4) || (ui32Endpoint == USB_EP_5) ||
(ui32Endpoint == USB_EP_6) || (ui32Endpoint == USB_EP_7));
... | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Update DRP IEs and, if necessary, the DRP Availability IE and send the updated IEs to the radio controller. */ | static void uwb_rsv_update_work(struct work_struct *work) | /* Update DRP IEs and, if necessary, the DRP Availability IE and send the updated IEs to the radio controller. */
static void uwb_rsv_update_work(struct work_struct *work) | {
struct uwb_rc *rc = container_of(work, struct uwb_rc,
rsv_update_work.work);
bool ie_updated;
mutex_lock(&rc->rsvs_mutex);
ie_updated = uwb_rsv_update_all(rc);
if (!rc->drp_avail.ie_valid) {
uwb_drp_avail_ie_update(rc);
ie_updated = true;
}
if (ie_updated && (rc->set_drp_ie_pending == 0))
uwb_rc_se... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Writes and returns a new value to DR7. This function is only available on IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64. */ | UINTN EFIAPI AsmWriteDr7(UINTN Dr7) | /* Writes and returns a new value to DR7. This function is only available on IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64. */
UINTN EFIAPI AsmWriteDr7(UINTN Dr7) | {
__asm__ __volatile__ (
"mov %0, %%dr7"
:
: "r" (Dr7)
);
return Dr7;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Config the DMA Receive status watchdog timer register value. */ | void ETH_ConfigReceiveWatchdogTimer(uint8_t value) | /* Config the DMA Receive status watchdog timer register value. */
void ETH_ConfigReceiveWatchdogTimer(uint8_t value) | {
ETH->DMARXFLGWDT_B.RXWDTCNT = value;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* omap_get_dma_chain_index - Get the element and frame index of the ongoing DMA in chain */ | int omap_get_dma_chain_index(int chain_id, int *ei, int *fi) | /* omap_get_dma_chain_index - Get the element and frame index of the ongoing DMA in chain */
int omap_get_dma_chain_index(int chain_id, int *ei, int *fi) | {
int lch;
int *channels;
if (unlikely((chain_id < 0 || chain_id >= dma_lch_count))) {
printk(KERN_ERR "Invalid chain id\n");
return -EINVAL;
}
if (dma_linked_lch[chain_id].linked_dmach_q == NULL) {
printk(KERN_ERR "Chain doesn't exists\n");
return -EINVAL;
}
if ((!ei) || (!fi))
return -EINVAL;
channe... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Returns a pointer to a kmalloc'ed buffer containing the descriptor string, or NULL if the index is 0 or the string could not be read. */ | char* usb_cache_string(struct usb_device *udev, int index) | /* Returns a pointer to a kmalloc'ed buffer containing the descriptor string, or NULL if the index is 0 or the string could not be read. */
char* usb_cache_string(struct usb_device *udev, int index) | {
char *buf;
char *smallbuf = NULL;
int len;
if (index <= 0)
return NULL;
buf = kmalloc(MAX_USB_STRING_SIZE, GFP_NOIO);
if (buf) {
len = usb_string(udev, index, buf, MAX_USB_STRING_SIZE);
if (len > 0) {
smallbuf = kmalloc(++len, GFP_NOIO);
if (!smallbuf)
return buf;
memcpy(smallbuf, buf, len);
... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Checks whether the Early Wakeup interrupt flag is set or not. */ | FlagStatus WWDG_GetFlagStatus(void) | /* Checks whether the Early Wakeup interrupt flag is set or not. */
FlagStatus WWDG_GetFlagStatus(void) | {
return (FlagStatus)(WWDG->SR);
} | gcallipo/RadioDSP-Stm32f103 | C++ | Common Creative - Attribution 3.0 | 51 |
/* Returns: the index of the first bit set which is lower than @nth_bit, or -1 if no lower bits are set */ | gint() g_bit_nth_msf(gulong mask, gint nth_bit) | /* Returns: the index of the first bit set which is lower than @nth_bit, or -1 if no lower bits are set */
gint() g_bit_nth_msf(gulong mask, gint nth_bit) | {
return g_bit_nth_msf_impl (mask, nth_bit);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Divide a 128-bit dividend by a 32-bit divisor, leaving a 128 bit result. */ | void div128_by_32(u64 dividend_high, u64 dividend_low, unsigned divisor, struct div_result *dr) | /* Divide a 128-bit dividend by a 32-bit divisor, leaving a 128 bit result. */
void div128_by_32(u64 dividend_high, u64 dividend_low, unsigned divisor, struct div_result *dr) | {
unsigned long a, b, c, d;
unsigned long w, x, y, z;
u64 ra, rb, rc;
a = dividend_high >> 32;
b = dividend_high & 0xffffffff;
c = dividend_low >> 32;
d = dividend_low & 0xffffffff;
w = a / divisor;
ra = ((u64)(a - (w * divisor)) << 32) + b;
rb = ((u64) do_div(ra, divisor) << 32) + c;
x = ra;
rc = ((u64) do... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag */ | static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) | /* This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag */
static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) | {
if (var->vmode & FB_VMODE_YWRAP) {
if (var->yoffset < 0
|| var->yoffset >= info->var.yres_virtual
|| var->xoffset)
return -EINVAL;
} else {
if (var->xoffset + var->xres > info->var.xres_virtual ||
var->yoffset + var->yres > info->var.yres_virtual)
return -EINVAL;
}
info->var.xoffset = ... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function reads from a local APIC register either in xAPIC or x2APIC mode. It is required that in xAPIC mode wider registers (64-bit or 256-bit) must be accessed using multiple 32-bit loads or stores, so this function only performs 32-bit read. */ | UINT32 EFIAPI ReadLocalApicReg(IN UINTN MmioOffset) | /* This function reads from a local APIC register either in xAPIC or x2APIC mode. It is required that in xAPIC mode wider registers (64-bit or 256-bit) must be accessed using multiple 32-bit loads or stores, so this function only performs 32-bit read. */
UINT32 EFIAPI ReadLocalApicReg(IN UINTN MmioOffset) | {
UINT32 MsrIndex;
ASSERT ((MmioOffset & 0xf) == 0);
if (GetApicMode () == LOCAL_APIC_MODE_XAPIC) {
return MmioRead32 (GetLocalApicBaseAddress () + MmioOffset);
} else {
ASSERT (MmioOffset != XAPIC_ICR_DFR_OFFSET);
ASSERT (MmioOffset != XAPIC_ICR_HIGH_OFFSET);
MsrIndex = (UINT32)(MmioOffset >> ... | tianocore/edk2 | C++ | Other | 4,240 |
/* This function will return the first occurrence of a string, without the terminator '\0'. */ | char* rt_strstr(const char *s1, const char *s2) | /* This function will return the first occurrence of a string, without the terminator '\0'. */
char* rt_strstr(const char *s1, const char *s2) | {
int l1 = 0, l2 = 0;
l2 = rt_strlen(s2);
if (!l2)
{
return (char *)s1;
}
l1 = rt_strlen(s1);
while (l1 >= l2)
{
l1 --;
if (!rt_memcmp(s1, s2, l2))
{
return (char *)s1;
}
s1 ++;
}
return RT_NULL;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Invoked by DPC handler to consume an error. */ | static struct aer_err_source* get_e_source(struct aer_rpc *rpc) | /* Invoked by DPC handler to consume an error. */
static struct aer_err_source* get_e_source(struct aer_rpc *rpc) | {
struct aer_err_source *e_source;
unsigned long flags;
spin_lock_irqsave(&rpc->e_lock, flags);
if (rpc->prod_idx == rpc->cons_idx) {
spin_unlock_irqrestore(&rpc->e_lock, flags);
return NULL;
}
e_source = &rpc->e_sources[rpc->cons_idx];
rpc->cons_idx++;
if (rpc->cons_idx == AER_ERROR_SOURCES_MAX)
rpc->con... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Setup the MAC address in the MAC itself, and in the uIP stack. */ | static void prvSetMACAddress(void) | /* Setup the MAC address in the MAC itself, and in the uIP stack. */
static void prvSetMACAddress(void) | {
struct uip_eth_addr xAddr;
xAddr.addr[ 0 ] = configMAC_ADDR0;
xAddr.addr[ 1 ] = configMAC_ADDR1;
xAddr.addr[ 2 ] = configMAC_ADDR2;
xAddr.addr[ 3 ] = configMAC_ADDR3;
xAddr.addr[ 4 ] = configMAC_ADDR4;
xAddr.addr[ 5 ] = configMAC_ADDR5;
uip_setethaddr( xAddr );
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Given a handle, find an active connection matching the handle */ | struct ble_ll_conn_sm* ble_ll_conn_find_active_conn(uint16_t handle) | /* Given a handle, find an active connection matching the handle */
struct ble_ll_conn_sm* ble_ll_conn_find_active_conn(uint16_t handle) | {
struct ble_ll_conn_sm *connsm;
connsm = NULL;
if ((handle != 0) && (handle <= MYNEWT_VAL(BLE_MAX_CONNECTIONS))) {
connsm = &g_ble_ll_conn_sm[handle - 1];
if (connsm->conn_state == BLE_LL_CONN_STATE_IDLE) {
connsm = NULL;
}
}
return connsm;
} | arendst/Tasmota | C++ | GNU General Public License v3.0 | 21,318 |
/* param base USDHC peripheral base address. param enable/disable flag param nibble position */ | void USDHC_EnableDDRMode(USDHC_Type *base, bool enable, uint32_t nibblePos) | /* param base USDHC peripheral base address. param enable/disable flag param nibble position */
void USDHC_EnableDDRMode(USDHC_Type *base, bool enable, uint32_t nibblePos) | {
uint32_t prescaler = (base->SYS_CTRL & USDHC_SYS_CTRL_SDCLKFS_MASK) >> USDHC_SYS_CTRL_SDCLKFS_SHIFT;
if (enable)
{
base->MIX_CTRL &= ~USDHC_MIX_CTRL_NIBBLE_POS_MASK;
base->MIX_CTRL |= (USDHC_MIX_CTRL_DDR_EN_MASK | USDHC_MIX_CTRL_NIBBLE_POS(nibblePos));
prescaler >>= 1U;
}
e... | nanoframework/nf-interpreter | C++ | MIT License | 293 |
/* Useful subroutines to manage the modem of the WaveLAN Read the Parameter Storage Area from the WaveLAN card's memory Read bytes from the PSA. */ | static void psa_read(unsigned long ioaddr, u16 hacr, int o, u8 *b, int n) | /* Useful subroutines to manage the modem of the WaveLAN Read the Parameter Storage Area from the WaveLAN card's memory Read bytes from the PSA. */
static void psa_read(unsigned long ioaddr, u16 hacr, int o, u8 *b, int n) | {
wv_16_off(ioaddr, hacr);
while (n-- > 0) {
outw(o, PIOR2(ioaddr));
o++;
*b++ = inb(PIOP2(ioaddr));
}
wv_16_on(ioaddr, hacr);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Fills each CAN1_PELI_InitStruct member with its default value. */ | void CAN_Peli_StructInit(CAN_Peli_InitTypeDef *CAN_Peli_InitStruct) | /* Fills each CAN1_PELI_InitStruct member with its default value. */
void CAN_Peli_StructInit(CAN_Peli_InitTypeDef *CAN_Peli_InitStruct) | {
CAN_Peli_InitStruct->BRP = 0x0;
CAN_Peli_InitStruct->SJW = 0x0;
CAN_Peli_InitStruct->TESG1 = 0x0;
CAN_Peli_InitStruct->TESG2 = 0x0;
CAN_Peli_InitStruct->SAM = RESET;
CAN_Peli_InitStruct->LOM = DISABLE;
CAN_Peli_InitStruct->STM = DISABLE;
CAN_Peli_InitStruct->SM = DISABLE;
CAN_Peli_... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Return a pointer to a NANDFLASH_Info_TypeDef structure, which contain vital nand flash device information. */ | NANDFLASH_Info_TypeDef* NANDFLASH_DeviceInfo(void) | /* Return a pointer to a NANDFLASH_Info_TypeDef structure, which contain vital nand flash device information. */
NANDFLASH_Info_TypeDef* NANDFLASH_DeviceInfo(void) | {
if (flashInitialized)
{
return &flashInfo;
}
return NULL;
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Returns the current setting of the ADC reference. */ | unsigned long ADCReferenceGet(unsigned long ulBase) | /* Returns the current setting of the ADC reference. */
unsigned long ADCReferenceGet(unsigned long ulBase) | {
ASSERT((ulBase == ADC0_BASE) || (ulBase == ADC1_BASE));
return(HWREG(ulBase + ADC_O_CTL) & ADC_CTL_VREF);
} | watterott/WebRadio | C++ | null | 71 |
/* The following *_destroy functions are used to free any memory allocated for each kind of symbol data in the policy database. */ | static int perm_destroy(void *key, void *datum, void *p) | /* The following *_destroy functions are used to free any memory allocated for each kind of symbol data in the policy database. */
static int perm_destroy(void *key, void *datum, void *p) | {
kfree(key);
kfree(datum);
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This function handles the RCC Wake up interrupt (rcc_mcu_wkup_irq/rcc_mpu_wkup_irq) */ | void HAL_RCC_WAKEUP_IRQHandler(void) | /* This function handles the RCC Wake up interrupt (rcc_mcu_wkup_irq/rcc_mpu_wkup_irq) */
void HAL_RCC_WAKEUP_IRQHandler(void) | {
if (__HAL_RCC_GET_IT(RCC_IT_WKUP) != RESET)
{
__HAL_RCC_CLEAR_IT(RCC_IT_WKUP);
HAL_RCC_WAKEUP_Callback();
}
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Writes and returns a new value to DR0. This function is only available on IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64. */ | UINTN EFIAPI AsmWriteDr0(UINTN Dr0) | /* Writes and returns a new value to DR0. This function is only available on IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64. */
UINTN EFIAPI AsmWriteDr0(UINTN Dr0) | {
__asm__ __volatile__ (
"mov %0, %%dr0"
:
: "r" (Dr0)
);
return Dr0;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* SPI MSP De-Initialization This function freeze the hardware resources used in this example. */ | void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi) | /* SPI MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi) | {
if(hspi->Instance==SPI1)
{
__HAL_RCC_SPI1_CLK_DISABLE();
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
}
else if(hspi->Instance==SPI2)
{
__HAL_RCC_SPI2_CLK_DISABLE();
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Set the boundaries of an aperture to invalid values having size zero and start MaxValue (yields Start > Limit which depicts an invalid range) */ | STATIC VOID InvalidateRootBridgeAperture(OUT PCI_ROOT_BRIDGE_APERTURE *Aperture) | /* Set the boundaries of an aperture to invalid values having size zero and start MaxValue (yields Start > Limit which depicts an invalid range) */
STATIC VOID InvalidateRootBridgeAperture(OUT PCI_ROOT_BRIDGE_APERTURE *Aperture) | {
if (Aperture == NULL) {
return;
}
Aperture->Base = MAX_UINT64;
Aperture->Limit = 0;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Configure pins as Analog Input Output EVENT_OUT EXTI */ | void MY_PWM_Init(void) | /* Configure pins as Analog Input Output EVENT_OUT EXTI */
void MY_PWM_Init(void) | {
hpwm.Instance = PWM;
hpwm.Init.AutoReloadPreload = PWM_AUTORELOAD_PRELOAD_ENABLE;
hpwm.Init.CounterMode = PWM_COUNTERMODE_EDGEALIGNED_DOWN;
hpwm.Init.Prescaler = 4;
hpwm.Init.Period = 2000 -1;
hpwm.Init.Pulse = 50 -1;
hpwm.Init.OutMode = PWM_OUT_MODE_5SYNC;
hpwm.Channel = ch;
HAL_PWM_Init(&hpwm);
HAL_PWM_St... | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Enable or disable the TMR4 OC of the specified channel. */ | void TMR4_OC_Cmd(CM_TMR4_TypeDef *TMR4x, uint32_t u32Ch, en_functional_state_t enNewState) | /* Enable or disable the TMR4 OC of the specified channel. */
void TMR4_OC_Cmd(CM_TMR4_TypeDef *TMR4x, uint32_t u32Ch, en_functional_state_t enNewState) | {
__IO uint16_t *OCSR;
DDL_ASSERT(IS_TMR4_UNIT(TMR4x));
DDL_ASSERT(IS_TMR4_OC_CH(u32Ch));
DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState));
OCSR = TMR4_OCSR(TMR4x, u32Ch);
MODIFY_REG16(*OCSR, TMR4_OCSR_OCEx_MASK(u32Ch), TMR4_OCSR_OCEx(u32Ch, enNewState));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Inserts a new node entry donated by NewEntry after the node entry donated by PrevEntry of the doubly linked list. */ | VOID EFIAPI NetListInsertAfter(IN OUT LIST_ENTRY *PrevEntry, IN OUT LIST_ENTRY *NewEntry) | /* Inserts a new node entry donated by NewEntry after the node entry donated by PrevEntry of the doubly linked list. */
VOID EFIAPI NetListInsertAfter(IN OUT LIST_ENTRY *PrevEntry, IN OUT LIST_ENTRY *NewEntry) | {
ASSERT (PrevEntry != NULL && NewEntry != NULL);
NewEntry->BackLink = PrevEntry;
NewEntry->ForwardLink = PrevEntry->ForwardLink;
PrevEntry->ForwardLink->BackLink = NewEntry;
PrevEntry->ForwardLink = NewEntry;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* If ICH8, set the current Kumeran workaround state (enabled - true /disabled - false). */ | void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw, bool state) | /* If ICH8, set the current Kumeran workaround state (enabled - true /disabled - false). */
void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw, bool state) | {
struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
if (hw->mac.type != e1000_ich8lan) {
e_dbg("Workaround applies to ICH8 only.\n");
return;
}
dev_spec->kmrn_lock_loss_workaround_enabled = state;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Checks whether the specified TIM flag is set or not. */ | FlagStatus TIM_GetCCENStatus(TIM_Module *TIMx, uint32_t TIM_CCEN) | /* Checks whether the specified TIM flag is set or not. */
FlagStatus TIM_GetCCENStatus(TIM_Module *TIMx, uint32_t TIM_CCEN) | {
INTStatus bitstatus = RESET;
assert_param(IsTimList3Module(TIMx));
if(TIMx==TIM1 || TIMx==TIM8)
{
assert_param(IsAdvancedTimCCENFlag(TIM_CCEN));
if ((TIMx->CCEN & TIM_CCEN) != (uint32_t)RESET)
{
bitstatus = SET;
}
else
{
bitstatus... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This function should be passed as a parameter to netifapi_netif_add(). */ | static err_t ethernetif_init(struct netif *netif) | /* This function should be passed as a parameter to netifapi_netif_add(). */
static err_t ethernetif_init(struct netif *netif) | {
osalDbgAssert((netif != NULL), "netif != NULL");
MIB2_INIT_NETIF(netif, snmp_ifType_ethernet_csmacd, LWIP_LINK_SPEED);
netif->state = NULL;
netif->name[0] = LWIP_IFNAME0;
netif->name[1] = LWIP_IFNAME1;
netif->output = etharp_output;
netif->linkoutput = low_level_output;
low_level_init(... | nanoframework/nf-interpreter | C++ | MIT License | 293 |
/* Set the specified data holding register value for DAC channel1. */ | void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data) | /* Set the specified data holding register value for DAC channel1. */
void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data) | {
assert_param(IS_DAC_ALIGN(DAC_Align));
assert_param(IS_DAC_DATA(Data));
*((__IO uint32_t *)(DAC_BASE + DHR12R1_Offset + DAC_Align)) = (uint32_t)Data;
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* gethex(vp,p,n) convert n hex digits from p to binary, result in vp, rtn 1 on success */ | int gethex(int32_t *vp, char *p, int n) | /* gethex(vp,p,n) convert n hex digits from p to binary, result in vp, rtn 1 on success */
int gethex(int32_t *vp, char *p, int n) | {
u_long v;
int digit;
for (v = 0; n > 0; n--) {
if (*p == 0)
return (0);
if (*p >= '0' && *p <= '9')
digit = *p - '0';
else if (*p >= 'a' && *p <= 'f')
digit = *p - 'a' + 10;
else if (*p >= 'A' && *p <= 'F')
digit = *p - 'A' + ... | Nicholas3388/LuaNode | C++ | Other | 1,055 |
/* Angular rate sensor. The value is expressed as a 16-bit word in two’s complement.. */ | int32_t lsm6dsl_angular_rate_raw_get(stmdev_ctx_t *ctx, uint8_t *buff) | /* Angular rate sensor. The value is expressed as a 16-bit word in two’s complement.. */
int32_t lsm6dsl_angular_rate_raw_get(stmdev_ctx_t *ctx, uint8_t *buff) | {
int32_t ret;
ret = lsm6dsl_read_reg(ctx, LSM6DSL_OUTX_L_G, buff, 6);
return ret;
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* In current usage, the access requests are usually for nonoverlapping strips; that is, successive access start_row numbers differ by exactly num_rows = maxaccess. This means we can get good performance with simple buffer dump/reload logic, by making the in-memory buffer be a multiple of the access height; then there ... | request_virt_sarray(j_common_ptr cinfo, int pool_id, boolean pre_zero, JDIMENSION samplesperrow, JDIMENSION numrows, JDIMENSION maxaccess) | /* In current usage, the access requests are usually for nonoverlapping strips; that is, successive access start_row numbers differ by exactly num_rows = maxaccess. This means we can get good performance with simple buffer dump/reload logic, by making the in-memory buffer be a multiple of the access height; then there ... | {
my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
jvirt_sarray_ptr result;
if (pool_id != JPOOL_IMAGE)
ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);
result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id,
SIZEOF(struct jvirt_sarray_control));
result->mem_buffer = NULL;
result->rows_in_array = numrows;
... | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* And for microcontrollers that have a USB peripheral: */ | void uDMAChannelEnable(unsigned long ulChannel) | /* And for microcontrollers that have a USB peripheral: */
void uDMAChannelEnable(unsigned long ulChannel) | {
ASSERT(ulChannel < 32);
HWREG(UDMA_ENASET) = 1 << ulChannel;
} | watterott/WebRadio | C++ | null | 71 |
/* If the requested operation results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */ | RETURN_STATUS EFIAPI SafeUint64Sub(IN UINT64 Minuend, IN UINT64 Subtrahend, OUT UINT64 *Result) | /* If the requested operation results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeUint64Sub(IN UINT64 Minuend, IN UINT64 Subtrahend, OUT UINT64 *Result) | {
RETURN_STATUS Status;
if (Result == NULL) {
return RETURN_INVALID_PARAMETER;
}
if (Minuend >= Subtrahend) {
*Result = (Minuend - Subtrahend);
Status = RETURN_SUCCESS;
} else {
*Result = UINT64_ERROR;
Status = RETURN_BUFFER_TOO_SMALL;
}
return Status;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Return the new port slot index or -ENOENT if we are out of free slots. */ | static int ide_find_port_slot(const struct ide_port_info *d) | /* Return the new port slot index or -ENOENT if we are out of free slots. */
static int ide_find_port_slot(const struct ide_port_info *d) | {
int idx = -ENOENT;
u8 bootable = (d && (d->host_flags & IDE_HFLAG_NON_BOOTABLE)) ? 0 : 1;
u8 i = (d && (d->host_flags & IDE_HFLAG_QD_2ND_PORT)) ? 1 : 0;
mutex_lock(&ide_cfg_mtx);
if (bootable) {
if ((ide_indexes | i) != (1 << MAX_HWIFS) - 1)
idx = ffz(ide_indexes | i);
} else {
if ((ide_indexes | 3) != (... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Enable or disable the BMA250 sleep mode.
This routine enables or disables the BMA250 sleep mode depending upon the value of the \sleep parameter; a \true value enables sleep mode and a \false value disables sleep mode by setting or clearing the 'sleep_en' bit, respectively. */ | static void bma250_sleep_en(sensor_hal_t *hal, bool sleep) | /* Enable or disable the BMA250 sleep mode.
This routine enables or disables the BMA250 sleep mode depending upon the value of the \sleep parameter; a \true value enables sleep mode and a \false value disables sleep mode by setting or clearing the 'sleep_en' bit, respectively. */
static void bma250_sleep_en(sensor_hal... | {
uint8_t const power_mode_val = (sleep== true)
? (BMA250_LOWPOWER_EN | BMA250_SLEEP_DUR_1ms) : 0;
sensor_bus_put(hal, BMA250_POWER_MODES, power_mode_val);
} | memfault/zero-to-main | C++ | null | 200 |
/* Sends a STOP condition. STOP Condition is sent just after completing the current byte transmission in master read mode. */ | void TWI_SendSTOPCondition(AT91S_TWI *pTwi) | /* Sends a STOP condition. STOP Condition is sent just after completing the current byte transmission in master read mode. */
void TWI_SendSTOPCondition(AT91S_TWI *pTwi) | {
SANITY_CHECK(pTwi);
pTwi->TWI_CR |= AT91C_TWI_STOP;
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Get the instance id for this opened sensor */ | SDL_SensorID SDL_SensorGetInstanceID(SDL_Sensor *sensor) | /* Get the instance id for this opened sensor */
SDL_SensorID SDL_SensorGetInstanceID(SDL_Sensor *sensor) | {
if (!SDL_PrivateSensorValid(sensor)) {
return -1;
}
return sensor->instance_id;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Unified function for getting and setting netapi options. */ | static int _get_set(kernel_pid_t pid, uint16_t type, netopt_t opt, uint16_t context, void *data, size_t data_len) | /* Unified function for getting and setting netapi options. */
static int _get_set(kernel_pid_t pid, uint16_t type, netopt_t opt, uint16_t context, void *data, size_t data_len) | {
msg_t cmd;
msg_t ack;
gnrc_netapi_opt_t o;
o.opt = opt;
o.context = context;
o.data = data;
o.data_len = data_len;
cmd.type = type;
cmd.content.ptr = (void *)&o;
msg_send_receive(&cmd, &ack, pid);
return (int)ack.content.value;
} | labapart/polymcu | C++ | null | 201 |
/* Checks whether the specified RTC interrupt has occurred or not. */ | ITStatus RTC_GetITStatus(uint32_t RTC_IT) | /* Checks whether the specified RTC interrupt has occurred or not. */
ITStatus RTC_GetITStatus(uint32_t RTC_IT) | {
ITStatus bitstatus = RESET;
uint32_t tmpreg = 0, enablestatus = 0;
assert_param(IS_RTC_GET_IT(RTC_IT));
tmpreg = (uint32_t)(RTC->TAFCR & (RTC_TAFCR_TAMPIE));
enablestatus = (uint32_t)((RTC->CR & RTC_IT) | (tmpreg & ((RTC_IT >> (RTC_IT >> 18)) >> 15)));
tmpreg = (uint32_t)((RTC->ISR & (uint32_t... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This I2C function puts the SHA204 device into low-power state. */ | uint8_t sha204p_sleep(void) | /* This I2C function puts the SHA204 device into low-power state. */
uint8_t sha204p_sleep(void) | {
return sha204p_send(SHA204_I2C_PACKET_FUNCTION_SLEEP, 0, NULL);
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* This function returns either the unmodified CRC result or the post- processed CRC result from the EC module. The post-processing options are selectable through */ | uint32_t CRCDataProcess(uint32_t ui32Base, void *puiDataIn, uint32_t ui32DataLength, uint32_t ui32Config) | /* This function returns either the unmodified CRC result or the post- processed CRC result from the EC module. The post-processing options are selectable through */
uint32_t CRCDataProcess(uint32_t ui32Base, void *puiDataIn, uint32_t ui32DataLength, uint32_t ui32Config) | {
uint8_t *pui8DataIn;
uint32_t *pui32DataIn;
ASSERT(ui32Base == DTHE_BASE);
if(ui32Config & DTHE_CRC_CTRL_SIZE)
{
pui8DataIn = (uint8_t *)puiDataIn;
while(ui32DataLength--)
{
HWREG(ui32Base + DTHE_O_CRC_DIN) = *pui8DataIn++;
}
}
else
{
pu... | micropython/micropython | C++ | Other | 18,334 |
/* Note that currently this is an internal only function: it will be exposed to machine drivers after further backporting of ASoC v2 registration APIs. */ | static int snd_soc_register_card(struct snd_soc_card *card) | /* Note that currently this is an internal only function: it will be exposed to machine drivers after further backporting of ASoC v2 registration APIs. */
static int snd_soc_register_card(struct snd_soc_card *card) | {
if (!card->name || !card->dev)
return -EINVAL;
INIT_LIST_HEAD(&card->list);
card->instantiated = 0;
mutex_lock(&client_mutex);
list_add(&card->list, &card_list);
snd_soc_instantiate_cards();
mutex_unlock(&client_mutex);
dev_dbg(card->dev, "Registered card '%s'\n", card->name);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Read the PHY management control register and check whether a PHY reset is blocked. If a reset is not blocked return 0, otherwise return E1000_BLK_PHY_RESET (12). */ | s32 igb_check_reset_block(struct e1000_hw *hw) | /* Read the PHY management control register and check whether a PHY reset is blocked. If a reset is not blocked return 0, otherwise return E1000_BLK_PHY_RESET (12). */
s32 igb_check_reset_block(struct e1000_hw *hw) | {
u32 manc;
manc = rd32(E1000_MANC);
return (manc & E1000_MANC_BLK_PHY_RST_ON_IDE) ?
E1000_BLK_PHY_RESET : 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Checks whether the specified ETHERNET Rx Desc flag is set or not. */ | FlagStatus ETH_GetDmaRxDescFlagStatus(ETH_DMADescType *DMARxDesc, uint32_t ETH_DMARxDescFlag) | /* Checks whether the specified ETHERNET Rx Desc flag is set or not. */
FlagStatus ETH_GetDmaRxDescFlagStatus(ETH_DMADescType *DMARxDesc, uint32_t ETH_DMARxDescFlag) | {
FlagStatus bitstatus = RESET;
assert_param(IS_ETH_DMA_RX_DESC_GET_FLAG(ETH_DMARxDescFlag));
if ((DMARxDesc->Status & ETH_DMARxDescFlag) != (uint32_t)RESET)
{
bitstatus = SET;
}
else
{
bitstatus = RESET;
}
return bitstatus;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* e1000_rx_checksum - Receive Checksum Offload for 82543 @adapter: board private structure @status_err: receive descriptor status and error fields @csum: receive descriptor csum field @sk_buff: socket buffer with received data */ | static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err, u32 csum, struct sk_buff *skb) | /* e1000_rx_checksum - Receive Checksum Offload for 82543 @adapter: board private structure @status_err: receive descriptor status and error fields @csum: receive descriptor csum field @sk_buff: socket buffer with received data */
static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err, u32 csum, s... | {
struct e1000_hw *hw = &adapter->hw;
u16 status = (u16)status_err;
u8 errors = (u8)(status_err >> 24);
skb->ip_summed = CHECKSUM_NONE;
if (unlikely(hw->mac_type < e1000_82543)) return;
if (unlikely(status & E1000_RXD_STAT_IXSM)) return;
if (unlikely(errors & E1000_RXD_ERR_TCPE)) {
adapter->hw_csum_err++;
re... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Return the pointer to register settings of specific afec. */ | static uint8_t _afec_get_regs(const uint32_t hw_addr) | /* Return the pointer to register settings of specific afec. */
static uint8_t _afec_get_regs(const uint32_t hw_addr) | {
uint8_t n = _afec_get_hardware_index((const void *)hw_addr);
uint8_t i;
for (i = 0; i < sizeof(_afecs) / sizeof(struct afec_configuration); i++) {
if (_afecs[i].number == n) {
return i;
}
}
return 0;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Return Value 0 in case of success; -ENOMEM in case of failure */ | static int __devinit pmcraid_allocate_cmd_blocks(struct pmcraid_instance *pinstance) | /* Return Value 0 in case of success; -ENOMEM in case of failure */
static int __devinit pmcraid_allocate_cmd_blocks(struct pmcraid_instance *pinstance) | {
int i;
sprintf(pinstance->cmd_pool_name, "pmcraid_cmd_pool_%d",
pinstance->host->unique_id);
pinstance->cmd_cachep = kmem_cache_create(
pinstance->cmd_pool_name,
sizeof(struct pmcraid_cmd), 0,
SLAB_HWCACHE_ALIGN, NULL);
if (!pinstance->cmd_cachep)
return -ENOMEM;
for (i = 0; i < PMCRAID_MAX_CM... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The function fills in the provided Buffer with the supported protocol list of the device specified. */ | TCG_RESULT EFIAPI OpalRetrieveSupportedProtocolList(OPAL_SESSION *Session, UINTN BufferSize, VOID *BuffAddress) | /* The function fills in the provided Buffer with the supported protocol list of the device specified. */
TCG_RESULT EFIAPI OpalRetrieveSupportedProtocolList(OPAL_SESSION *Session, UINTN BufferSize, VOID *BuffAddress) | {
return (OpalTrustedRecv (
Session->Sscp,
Session->MediaId,
TCG_SECURITY_PROTOCOL_INFO,
TCG_SP_SPECIFIC_PROTOCOL_LIST,
BuffAddress,
BufferSize,
0
));
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Retrieve number of data bytes present in payload of received frame @rmtoll RFL RFL LL_SWPMI_GetReceiveFrameLength. */ | uint32_t LL_SWPMI_GetReceiveFrameLength(SWPMI_TypeDef *SWPMIx) | /* Retrieve number of data bytes present in payload of received frame @rmtoll RFL RFL LL_SWPMI_GetReceiveFrameLength. */
uint32_t LL_SWPMI_GetReceiveFrameLength(SWPMI_TypeDef *SWPMIx) | {
return (uint32_t)(READ_BIT(SWPMIx->RFL, SWPMI_RFL_RFL));
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.