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 |
|---|---|---|---|---|---|---|---|
/* Reads the status of the Ethernet system time interrupt. */ | uint32_t EMACTimestampIntStatus(uint32_t ui32Base) | /* Reads the status of the Ethernet system time interrupt. */
uint32_t EMACTimestampIntStatus(uint32_t ui32Base) | {
ASSERT(ui32Base == EMAC0_BASE);
return(HWREG(ui32Base + EMAC_O_TIMSTAT));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Find a node by the associated data file name. Needs to be called with node_lock held. */ | static struct gcov_node* get_node_by_name(const char *name) | /* Find a node by the associated data file name. Needs to be called with node_lock held. */
static struct gcov_node* get_node_by_name(const char *name) | {
struct gcov_node *node;
struct gcov_info *info;
list_for_each_entry(node, &all_head, all) {
info = get_node_info(node);
if (info && (strcmp(info->filename, name) == 0))
return node;
}
return NULL;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* USB_OTG_otg_hcd_handle_sof_intr Handles the start-of-frame interrupt in host mode. */ | static uint32_t USB_OTG_USBH_handle_sof_ISR(USB_OTG_CORE_HANDLE *pdev) | /* USB_OTG_otg_hcd_handle_sof_intr Handles the start-of-frame interrupt in host mode. */
static uint32_t USB_OTG_USBH_handle_sof_ISR(USB_OTG_CORE_HANDLE *pdev) | {
USB_OTG_GINTSTS_TypeDef gintsts;
gintsts.d32 = 0;
USBH_HCD_INT_fops->SOF(pdev);
gintsts.b.sofintr = 1;
USB_OTG_WRITE_REG32(&pdev->regs.GREGS->GINTSTS, gintsts.d32);
return 1;
} | MaJerle/stm32f429 | C++ | null | 2,036 |
/* Sync local APIC timer setting from BSP to AP. */ | VOID SyncLocalApicTimerSetting(IN CPU_MP_DATA *CpuMpData) | /* Sync local APIC timer setting from BSP to AP. */
VOID SyncLocalApicTimerSetting(IN CPU_MP_DATA *CpuMpData) | {
InitializeApicTimer (
CpuMpData->DivideValue,
CpuMpData->CurrentTimerCount,
CpuMpData->PeriodicMode,
CpuMpData->Vector
);
DisableApicTimerInterrupt ();
} | tianocore/edk2 | C++ | Other | 4,240 |
/* unmute (and set max vol) the output amplifier */ | static int unmute_output(struct hda_codec *codec, struct hda_gnode *node) | /* unmute (and set max vol) the output amplifier */
static int unmute_output(struct hda_codec *codec, struct hda_gnode *node) | {
unsigned int val, ofs;
snd_printdd("UNMUTE OUT: NID=0x%x\n", node->nid);
val = (node->amp_out_caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT;
ofs = (node->amp_out_caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT;
if (val >= ofs)
val -= ofs;
snd_hda_codec_amp_stereo(codec, node->nid, HDA_OUTPUT, 0,... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* retval kStatus_Success Started successfully. retval kStatus_CSI_NoFullBuffer There is no full frame buffer in queue. */ | status_t CSI_TransferGetFullBuffer(CSI_Type *base, csi_handle_t *handle, uint32_t *frameBuffer) | /* retval kStatus_Success Started successfully. retval kStatus_CSI_NoFullBuffer There is no full frame buffer in queue. */
status_t CSI_TransferGetFullBuffer(CSI_Type *base, csi_handle_t *handle, uint32_t *frameBuffer) | {
uint32_t csicr1;
if (handle->queueUserReadIdx == handle->queueDrvWriteIdx)
{
return kStatus_CSI_NoFullBuffer;
}
csicr1 = base->CSICR1;
base->CSICR1 = (csicr1 & ~(CSI_CSICR1_FB2_DMA_DONE_INTEN_MASK | CSI_CSICR1_FB1_DMA_DONE_INTEN_MASK));
*frameBuffer = handle->frameBufferQueue[handl... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Initialize master decompression control and select active modules. This is performed at the start of jpeg_start_decompress. */ | jinit_master_decompress(j_decompress_ptr cinfo) | /* Initialize master decompression control and select active modules. This is performed at the start of jpeg_start_decompress. */
jinit_master_decompress(j_decompress_ptr cinfo) | {
my_master_ptr master;
master = (my_master_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
SIZEOF(my_decomp_master));
cinfo->master = (struct jpeg_decomp_master*) master;
master->pub.prepare_for_output_pass = prepare_for_output_pass;
master->pub.finish_output_... | nanoframework/nf-interpreter | C++ | MIT License | 293 |
/* Return value: the flattened copy of the path. If there is insufficient memory a pointer to a special static nil #cairo_path_t will be returned instead with status==CAIRO_STATUS_NO_MEMORY and data==NULL. */ | cairo_path_t* _cairo_path_create_flat(cairo_path_fixed_t *path, cairo_t *cr) | /* Return value: the flattened copy of the path. If there is insufficient memory a pointer to a special static nil #cairo_path_t will be returned instead with status==CAIRO_STATUS_NO_MEMORY and data==NULL. */
cairo_path_t* _cairo_path_create_flat(cairo_path_fixed_t *path, cairo_t *cr) | {
return _cairo_path_create_internal (path, cr, TRUE);
} | xboot/xboot | C++ | MIT License | 779 |
/* This module is a confidential and proprietary property of RealTek and possession or use of this module requires written permission of RealTek. */ | static SHELL_ROM_TEXT_SECTION u32 cmd_rom_help(u16 argc, u8 *argv[]) | /* This module is a confidential and proprietary property of RealTek and possession or use of this module requires written permission of RealTek. */
static SHELL_ROM_TEXT_SECTION u32 cmd_rom_help(u16 argc, u8 *argv[]) | {
u32 LoopINdex ;
MONITOR_LOG("----------------- COMMAND MODE HELP ------------------\n");
for( LoopINdex=0 ; LoopINdex < (sizeof(shell_cmd_table_rom) / sizeof(COMMAND_TABLE)) ; LoopINdex++ )
{
if( shell_cmd_table_rom[LoopINdex].msg )
{
MONITOR_LOG( "%s\n",shell_cmd_table_rom[LoopINdex].msg );
}
}
MONIT... | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Calculate number of days from Jan 1 1970 @prama year: import year to calculate month: import month to calculate day: import day to calculate. */ | uint32_t rtcGetEpochDate(uint32_t year, rtcMonths_t month, uint8_t day) | /* Calculate number of days from Jan 1 1970 @prama year: import year to calculate month: import month to calculate day: import day to calculate. */
uint32_t rtcGetEpochDate(uint32_t year, rtcMonths_t month, uint8_t day) | {
if (year >= 1900)
{
year -= 1900;
}
if ((year < RTC_MIN_EPOCH_YEAR) || (year > RTC_MAX_EPOCH_YEAR))
{
return 0;
}
uint8_t m = (uint8_t)(month & 0xFF);
return (1461 * (year + 6700 + (m - 14) / 12)) / 4 + (367 *
(m - 2 - 12 * ((m - 14) / 12))) / 12 -
(3 * ... | microbuilder/LPC11U_LPC13U_CodeBase | C++ | Other | 54 |
/* Vport is being deleted - awaiting lport delete completion to send LOGO to fabric. */ | static void bfa_fcs_vport_sm_deleting(struct bfa_fcs_vport_s *vport, enum bfa_fcs_vport_event event) | /* Vport is being deleted - awaiting lport delete completion to send LOGO to fabric. */
static void bfa_fcs_vport_sm_deleting(struct bfa_fcs_vport_s *vport, enum bfa_fcs_vport_event event) | {
bfa_trc(__vport_fcs(vport), __vport_pwwn(vport));
bfa_trc(__vport_fcs(vport), event);
switch (event) {
case BFA_FCS_VPORT_SM_DELETE:
break;
case BFA_FCS_VPORT_SM_DELCOMP:
bfa_sm_set_state(vport, bfa_fcs_vport_sm_logo);
bfa_fcs_vport_do_logo(vport);
break;
case BFA_FCS_VPORT_SM_OFFLINE:
bfa_sm_set_stat... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Retrieves current state of the USB host controller according to UEFI 2.0 spec. */ | EFI_STATUS EFIAPI Uhci2GetState(IN EFI_USB2_HC_PROTOCOL *This, OUT EFI_USB_HC_STATE *State) | /* Retrieves current state of the USB host controller according to UEFI 2.0 spec. */
EFI_STATUS EFIAPI Uhci2GetState(IN EFI_USB2_HC_PROTOCOL *This, OUT EFI_USB_HC_STATE *State) | {
USB_HC_DEV *Uhc;
UINT16 UsbSts;
UINT16 UsbCmd;
if (State == NULL) {
return EFI_INVALID_PARAMETER;
}
Uhc = UHC_FROM_USB2_HC_PROTO (This);
UsbCmd = UhciReadReg (Uhc->PciIo, USBCMD_OFFSET);
UsbSts = UhciReadReg (Uhc->PciIo, USBSTS_OFFSET);
if ((UsbCmd & USBCMD_EGSM) != 0 ) {
*State =... | tianocore/edk2 | C++ | Other | 4,240 |
/* Enables or disables the analog watchdog on single/all regular or injected channels. */ | void ADC_AnalogWatchdogCmd(ADC_TypeDef *ADCx, uint32_t ADC_AnalogWatchdog) | /* Enables or disables the analog watchdog on single/all regular or injected channels. */
void ADC_AnalogWatchdogCmd(ADC_TypeDef *ADCx, uint32_t ADC_AnalogWatchdog) | {
uint32_t tmpreg = 0;
assert_param(IS_ADC_ALL_PERIPH(ADCx));
assert_param(IS_ADC_ANALOG_WATCHDOG(ADC_AnalogWatchdog));
tmpreg = ADCx->ADCFG;
tmpreg &= ADCFG_AWDMode_Reset;
tmpreg |= ADC_AnalogWatchdog;
ADCx->ADCFG = tmpreg;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* In TDX a serial of TdIoRead16 is invoked to read data from the I/O port. */ | VOID EFIAPI IoReadFifo16(IN UINTN Port, IN UINTN Count, OUT VOID *Buffer) | /* In TDX a serial of TdIoRead16 is invoked to read data from the I/O port. */
VOID EFIAPI IoReadFifo16(IN UINTN Port, IN UINTN Count, OUT VOID *Buffer) | {
UINT16 *Buffer16;
Buffer16 = (UINT16 *)Buffer;
while (Count-- > 0) {
*Buffer16++ = IoRead16 (Port);
}
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Returns 1 if the current transmission is complete (the STOP has been sent); otherwise returns 0. */ | unsigned char TWI_TransferComplete(AT91S_TWI *pTwi) | /* Returns 1 if the current transmission is complete (the STOP has been sent); otherwise returns 0. */
unsigned char TWI_TransferComplete(AT91S_TWI *pTwi) | {
return ((pTwi->TWI_SR & AT91C_TWI_TXCOMP) == AT91C_TWI_TXCOMP);
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* atl1e_remove is called by the PCI subsystem to alert the driver that it should release a PCI device. The could be caused by a Hot-Plug event, or because the driver is going to be removed from memory. */ | static void __devexit atl1e_remove(struct pci_dev *pdev) | /* atl1e_remove is called by the PCI subsystem to alert the driver that it should release a PCI device. The could be caused by a Hot-Plug event, or because the driver is going to be removed from memory. */
static void __devexit atl1e_remove(struct pci_dev *pdev) | {
struct net_device *netdev = pci_get_drvdata(pdev);
struct atl1e_adapter *adapter = netdev_priv(netdev);
set_bit(__AT_DOWN, &adapter->flags);
atl1e_del_timer(adapter);
atl1e_cancel_work(adapter);
unregister_netdev(netdev);
atl1e_free_ring_resources(adapter);
atl1e_force_ps(&adapter->hw);
iounmap(adapter->hw.h... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* ADC Enable an External Trigger for Regular Channels.
This enables an external trigger for set of defined regular channels, and sets the polarity of the trigger event: rising or falling edge or both. Note that if the trigger polarity is zero, triggering is disabled. */ | void adc_enable_external_trigger_regular(uint32_t adc, uint32_t trigger, uint32_t polarity) | /* ADC Enable an External Trigger for Regular Channels.
This enables an external trigger for set of defined regular channels, and sets the polarity of the trigger event: rising or falling edge or both. Note that if the trigger polarity is zero, triggering is disabled. */
void adc_enable_external_trigger_regular(uint32... | {
ADC_CFGR1(adc) = (ADC_CFGR1(adc) & ~ADC_CFGR1_EXTSEL) | trigger;
ADC_CFGR1(adc) = (ADC_CFGR1(adc) & ~ADC_CFGR1_EXTEN_MASK) | polarity;
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* Notes: Given an integer : 0x0b030a04, this function returns a scsi_lun of : struct scsi_lun of: 0a 04 0b 03 00 00 00 00 */ | void int_to_scsilun(unsigned int lun, struct scsi_lun *scsilun) | /* Notes: Given an integer : 0x0b030a04, this function returns a scsi_lun of : struct scsi_lun of: 0a 04 0b 03 00 00 00 00 */
void int_to_scsilun(unsigned int lun, struct scsi_lun *scsilun) | {
int i;
memset(scsilun->scsi_lun, 0, sizeof(scsilun->scsi_lun));
for (i = 0; i < sizeof(lun); i += 2) {
scsilun->scsi_lun[i] = (lun >> 8) & 0xFF;
scsilun->scsi_lun[i+1] = lun & 0xFF;
lun = lun >> 16;
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* RTC MSP Initialization This function configures the hardware resources used in this example: */ | void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc) | /* RTC MSP Initialization This function configures the hardware resources used in this example: */
void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc) | {
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
while(1);
}... | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* for now, we send the IPI's one by one in the cpumask. TBD: Based on the cpu mask, we can send the IPI's to the cluster group at once. We have 16 cpu's in a cluster. This will minimize IPI register writes. */ | static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector) | /* for now, we send the IPI's one by one in the cpumask. TBD: Based on the cpu mask, we can send the IPI's to the cluster group at once. We have 16 cpu's in a cluster. This will minimize IPI register writes. */
static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector) | {
unsigned long query_cpu;
unsigned long flags;
x2apic_wrmsr_fence();
local_irq_save(flags);
for_each_cpu(query_cpu, mask) {
__x2apic_send_IPI_dest(
per_cpu(x86_cpu_to_logical_apicid, query_cpu),
vector, apic->dest_logical);
}
local_irq_restore(flags);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Finish up after inputting a compressed-data scan. This is called by the coefficient controller after it's read all the expected data of the scan. */ | finish_input_pass(j_decompress_ptr cinfo) | /* Finish up after inputting a compressed-data scan. This is called by the coefficient controller after it's read all the expected data of the scan. */
finish_input_pass(j_decompress_ptr cinfo) | {
cinfo->inputctl->consume_input = consume_markers;
} | nanoframework/nf-interpreter | C++ | MIT License | 293 |
/* This function sets the ciphers for use by a specified TLS object. */ | EFI_STATUS EFIAPI TlsSetCipherList(IN VOID *Tls, IN UINT16 *CipherId, IN UINTN CipherNum) | /* This function sets the ciphers for use by a specified TLS object. */
EFI_STATUS EFIAPI TlsSetCipherList(IN VOID *Tls, IN UINT16 *CipherId, IN UINTN CipherNum) | {
CALL_CRYPTO_SERVICE (TlsSetCipherList, (Tls, CipherId, CipherNum), EFI_UNSUPPORTED);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Do a soft reset of the card using the Configuration Option Register */ | static int orinoco_tmd_cor_reset(struct orinoco_private *priv) | /* Do a soft reset of the card using the Configuration Option Register */
static int orinoco_tmd_cor_reset(struct orinoco_private *priv) | {
hermes_t *hw = &priv->hw;
struct orinoco_pci_card *card = priv->card;
unsigned long timeout;
u16 reg;
iowrite8(COR_VALUE | COR_RESET, card->bridge_io);
mdelay(1);
iowrite8(COR_VALUE, card->bridge_io);
mdelay(1);
timeout = jiffies + (TMD_RESET_TIME * HZ / 1000);
reg = hermes_read_regn(hw, CMD);
while (time_... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Function for processing the BLE_GAP_EVT_AUTH_STATUS event from the SoftDevice. */ | static void auth_status_process(ble_gap_evt_t *p_gap_evt) | /* Function for processing the BLE_GAP_EVT_AUTH_STATUS event from the SoftDevice. */
static void auth_status_process(ble_gap_evt_t *p_gap_evt) | {
switch (p_gap_evt->params.auth_status.auth_status)
{
case BLE_GAP_SEC_STATUS_SUCCESS:
auth_status_success_process(p_gap_evt);
break;
default:
auth_status_failure_process(p_gap_evt);
break;
}
} | labapart/polymcu | C++ | null | 201 |
/* check whether driver with the same name is already loaded or not check whether driver with same name is already registered or not */ | int _bus_find_driver(struct u_driver *drv) | /* check whether driver with the same name is already loaded or not check whether driver with same name is already registered or not */
int _bus_find_driver(struct u_driver *drv) | {
drv_b = drv_p->drv;
if (!strcmp(drv->name, drv_b->name))
return 1;
}
return 0;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* This routine erase complete block from NAND FLASH. */ | uint32_t NAND_EraseBlock(NAND_ADDRESS Address) | /* This routine erase complete block from NAND FLASH. */
uint32_t NAND_EraseBlock(NAND_ADDRESS Address) | {
*(__IO uint8_t *)(Bank_NAND_ADDR | CMD_AREA) = NAND_CMD_ERASE0;
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = ADDR_1st_CYCLE(ROW_ADDRESS);
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = ADDR_2nd_CYCLE(ROW_ADDRESS);
*(__IO uint8_t *)(Bank_NAND_ADDR | ADDR_AREA) = ADDR_3rd_CYCLE(ROW_ADDRESS);
*(__IO uint8_... | avem-labs/Avem | C++ | MIT License | 1,752 |
/* If Guid is NULL, then ASSERT(). If HobStart is NULL, then ASSERT(). */ | VOID* EFIAPI GetNextGuidHob(IN CONST EFI_GUID *Guid, IN CONST VOID *HobStart) | /* If Guid is NULL, then ASSERT(). If HobStart is NULL, then ASSERT(). */
VOID* EFIAPI GetNextGuidHob(IN CONST EFI_GUID *Guid, IN CONST VOID *HobStart) | {
EFI_PEI_HOB_POINTERS GuidHob;
GuidHob.Raw = (UINT8 *)HobStart;
while ((GuidHob.Raw = GetNextHob (EFI_HOB_TYPE_GUID_EXTENSION, GuidHob.Raw)) != NULL) {
if (CompareGuid (Guid, &GuidHob.Guid->Name)) {
break;
}
GuidHob.Raw = GET_NEXT_HOB (GuidHob);
}
return GuidHob.Raw;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Starts a remote wake-up sequence if the host has explicitely enabled it by sending the appropriate SET_FEATURE request. */ | void MSDDriver_RemoteWakeUp(void) | /* Starts a remote wake-up sequence if the host has explicitely enabled it by sending the appropriate SET_FEATURE request. */
void MSDDriver_RemoteWakeUp(void) | {
if (USBDDriver_IsRemoteWakeUpEnabled(&usbdDriver)) {
USBD_RemoteWakeUp();
}
else {
TRACE_WARNING(
"MSD..RemoteWakeUp: Host has not enabled remote wake-up\n\r");
}
} | opentx/opentx | C++ | GNU General Public License v2.0 | 2,025 |
/* Fills each TIM_OCInitStruct member with its default value. */ | void TIM_OCStructInit(TIM_OCInitTypeDef *TIM_OCInitStruct) | /* Fills each TIM_OCInitStruct member with its default value. */
void TIM_OCStructInit(TIM_OCInitTypeDef *TIM_OCInitStruct) | {
TIM_OCInitStruct->TIM_OCMode = TIM_OCMode_Timing;
TIM_OCInitStruct->TIM_OutputState = TIM_OutputState_Disable;
TIM_OCInitStruct->TIM_OutputNState = TIM_OutputNState_Disable;
TIM_OCInitStruct->TIM_Pulse = 0x0000;
TIM_OCInitStruct->TIM_OCPolarity = TIM_OCPolarity_High;
TIM_OCInitStruct->TIM_OCNPolarity = TI... | gcallipo/RadioDSP-Stm32f103 | C++ | Common Creative - Attribution 3.0 | 51 |
/* ucc_geth_timeout gets called when a packet has not been transmitted after a set amount of time. */ | static void ucc_geth_timeout(struct net_device *dev) | /* ucc_geth_timeout gets called when a packet has not been transmitted after a set amount of time. */
static void ucc_geth_timeout(struct net_device *dev) | {
struct ucc_geth_private *ugeth = netdev_priv(dev);
netif_carrier_off(dev);
schedule_work(&ugeth->timeout_work);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Load DAC Dual Data Register.
Loads the appropriate digital to analog converter dual data register with 12 or 8 bit data to be converted for both channels. This allows high bandwidth simultaneous or independent analog output. The data in both channels are aligned identically. */ | void dac_load_data_buffer_dual(uint32_t dac, uint16_t data1, uint16_t data2, enum dac_align align) | /* Load DAC Dual Data Register.
Loads the appropriate digital to analog converter dual data register with 12 or 8 bit data to be converted for both channels. This allows high bandwidth simultaneous or independent analog output. The data in both channels are aligned identically. */
void dac_load_data_buffer_dual(uint32... | {
switch (align) {
case DAC_ALIGN_RIGHT8:
DAC_DHR8RD(dac) = ((data1 & 0xFF) | ((data2 & 0xFF) << 8));
break;
case DAC_ALIGN_RIGHT12:
DAC_DHR12RD(dac) = ((data1 & 0xFFF) |
((data2 & 0xFFF) << 16));
break;
case DAC_ALIGN_LEFT12:
DAC_DHR12LD(dac) = ((data1 & 0xFFF) |
((data2 & 0xFFF) << 16));
break... | libopencm3/libopencm3 | C++ | GNU General Public License v3.0 | 2,931 |
/* This function swaps the bytes in a 64-bit unsigned value to switch the value from little endian to big endian or vice versa. The byte swapped value is returned. */ | UINT64 EFIAPI InternalMathSwapBytes64(IN UINT64 Operand) | /* This function swaps the bytes in a 64-bit unsigned value to switch the value from little endian to big endian or vice versa. The byte swapped value is returned. */
UINT64 EFIAPI InternalMathSwapBytes64(IN UINT64 Operand) | {
_asm {
mov eax, dword ptr [Operand + 4]
mov edx, dword ptr [Operand + 0]
bswap eax
bswap edx
}
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Retrieves the attribute of the first page entry in the translation table. */ | STATIC UINT64 GetFirstPageAttribute(IN UINT64 *FirstLevelTableAddress, IN UINTN TableLevel) | /* Retrieves the attribute of the first page entry in the translation table. */
STATIC UINT64 GetFirstPageAttribute(IN UINT64 *FirstLevelTableAddress, IN UINTN TableLevel) | {
UINT64 FirstEntry;
FirstEntry = *FirstLevelTableAddress;
if ((TableLevel != 3) && ((FirstEntry & TT_TYPE_MASK) == TT_TYPE_TABLE_ENTRY)) {
return GetFirstPageAttribute ((UINT64 *)(FirstEntry & TT_ADDRESS_MASK_DESCRIPTION_TABLE), TableLevel + 1);
} else if (((FirstEntry & TT_TYPE_MASK) == TT_TYPE_BLOCK_ENT... | tianocore/edk2 | C++ | Other | 4,240 |
/* If Buffer was not allocated with a page allocation function in the Memory Allocation Library, then ASSERT(). If Pages is zero, then ASSERT(). */ | VOID EFIAPI FreePages(IN VOID *Buffer, IN UINTN Pages) | /* If Buffer was not allocated with a page allocation function in the Memory Allocation Library, then ASSERT(). If Pages is zero, then ASSERT(). */
VOID EFIAPI FreePages(IN VOID *Buffer, IN UINTN Pages) | {
EFI_STATUS Status;
ASSERT (Pages != 0);
Status = CoreFreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Buffer, Pages);
ASSERT_EFI_ERROR (Status);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This function will wakeup APs and collect CPU AP count and install the Mp Service Ppi. */ | EFI_STATUS EFIAPI CpuMpPeimInit(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices) | /* This function will wakeup APs and collect CPU AP count and install the Mp Service Ppi. */
EFI_STATUS EFIAPI CpuMpPeimInit(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices) | {
EFI_STATUS Status;
Status = PeiServicesNotifyPpi (&mPostMemNotifyList[0]);
ASSERT_EFI_ERROR (Status);
return Status;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* The C portion of the interrupt handler. Interrupts are triggered by pushing the button on the target board. This interrupt can cause a context switch so has an assembly file wrapper defined within ButtonISR.s26. */ | void vButtonISRHandler(void) | /* The C portion of the interrupt handler. Interrupts are triggered by pushing the button on the target board. This interrupt can cause a context switch so has an assembly file wrapper defined within ButtonISR.s26. */
void vButtonISRHandler(void) | {
short sHigherPriorityTaskWoken = pdFALSE;
xSemaphoreGiveFromISR( xButtonSemaphore, &sHigherPriorityTaskWoken );
portYIELD_FROM_ISR( sHigherPriorityTaskWoken );
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Get the touch screen Xn and Yn positions values in multi-touch mode. */ | int32_t MFXSTM32L152_TS_GetMultiTouchState(MFXSTM32L152_Object_t *pObj, MFXSTM32L152_MultiTouch_State_t *State) | /* Get the touch screen Xn and Yn positions values in multi-touch mode. */
int32_t MFXSTM32L152_TS_GetMultiTouchState(MFXSTM32L152_Object_t *pObj, MFXSTM32L152_MultiTouch_State_t *State) | {
(void)(pObj);
(void)(State);
return MFXSTM32L152_OK;
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* 8-bit unpacked samples => RGBA w/ unassociated alpha */ | DECLARESepPutFunc(putRGBUAseparate8bittile) | /* 8-bit unpacked samples => RGBA w/ unassociated alpha */
DECLARESepPutFunc(putRGBUAseparate8bittile) | {
(void) img; (void) y;
for( ; h > 0; --h) {
uint32 rv, gv, bv, av;
uint8* m;
for (x = w; x > 0; --x) {
av = *a++;
m = img->UaToAa+((size_t) av<<8);
rv = m[*r++];
gv = m[*g++];
bv = m[*b++];
*cp++ = PACK4(rv,gv,bv,av);
}
SKEW4(r, g, b, a, fromskew);
cp += toskew;
}
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Gets the direction and mode of a pin. */ | uint32_t GPIODirModeGet(uint32_t ui32Port, uint8_t ui8Pin) | /* Gets the direction and mode of a pin. */
uint32_t GPIODirModeGet(uint32_t ui32Port, uint8_t ui8Pin) | {
uint32_t ui32Dir, ui32AFSEL;
ASSERT(_GPIOBaseValid(ui32Port));
ASSERT(ui8Pin < 8);
ui8Pin = 1 << ui8Pin;
ui32Dir = HWREG(ui32Port + GPIO_O_DIR);
ui32AFSEL = HWREG(ui32Port + GPIO_O_AFSEL);
return(((ui32Dir & ui8Pin) ? 1 : 0) | ((ui32AFSEL & ui8Pin) ? 2 : 0));
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* note Don't use this function with DMA APIs. */ | void FLEXIO_MCULCD_ClearStatusFlags(FLEXIO_MCULCD_Type *base, uint32_t mask) | /* note Don't use this function with DMA APIs. */
void FLEXIO_MCULCD_ClearStatusFlags(FLEXIO_MCULCD_Type *base, uint32_t mask) | {
uint32_t flags = 0U;
if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_RxFullFlag))
{
flags |= (1UL << base->rxShifterEndIndex);
}
if (0U != (mask & (uint32_t)kFLEXIO_MCULCD_TxEmptyFlag))
{
flags |= (1UL << base->txShifterStartIndex);
}
FLEXIO_ClearShifterStatusFlags(base->fle... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Initialize the input controller module. This is called only once, when the decompression object is created. */ | jinit_input_controller(j_decompress_ptr cinfo) | /* Initialize the input controller module. This is called only once, when the decompression object is created. */
jinit_input_controller(j_decompress_ptr cinfo) | {
my_inputctl_ptr inputctl;
inputctl = (my_inputctl_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
SIZEOF(my_input_controller));
cinfo->inputctl = (struct jpeg_input_controller *) inputctl;
inputctl->pub.consume_input = consume_markers;
inputctl->pub.reset_input_controller = r... | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* ISR handler for a specific vector index in the interrupt vector table for linking the actual interrupts vectors to the one in the user program's vector table. */ | void Vector5_handler(void) | /* ISR handler for a specific vector index in the interrupt vector table for linking the actual interrupts vectors to the one in the user program's vector table. */
void Vector5_handler(void) | {
asm
{
LDX(VCT_USER_PROGRAM_VECTOR_TABLE_STARTADDR + (5 * 2))
JMP 0,X
}
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Write an abbreviated table-specification datastream. This consists of SOI, DQT and DHT tables, and EOI. Any table that is defined and not marked sent_table = TRUE will be emitted. Note that all tables will be marked sent_table = TRUE at exit. */ | write_tables_only(j_compress_ptr cinfo) | /* Write an abbreviated table-specification datastream. This consists of SOI, DQT and DHT tables, and EOI. Any table that is defined and not marked sent_table = TRUE will be emitted. Note that all tables will be marked sent_table = TRUE at exit. */
write_tables_only(j_compress_ptr cinfo) | {
int i;
emit_marker(cinfo, M_SOI);
for (i = 0; i < NUM_QUANT_TBLS; i++) {
if (cinfo->quant_tbl_ptrs[i] != NULL)
(void)emit_dqt(cinfo, i);
}
if (!cinfo->arith_code) {
for (i = 0; i < NUM_HUFF_TBLS; i++) {
if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
... | nanoframework/nf-interpreter | C++ | MIT License | 293 |
/* Return: false - we are done with this request true - still buffers pending for this request */ | static bool __blk_end_bidi_request(struct request *rq, int error, unsigned int nr_bytes, unsigned int bidi_bytes) | /* Return: false - we are done with this request true - still buffers pending for this request */
static bool __blk_end_bidi_request(struct request *rq, int error, unsigned int nr_bytes, unsigned int bidi_bytes) | {
if (blk_update_bidi_request(rq, error, nr_bytes, bidi_bytes))
return true;
blk_finish_request(rq, error);
return false;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* ajust RTC second or subsecond value of current time */ | ErrStatus rtc_second_ajust(uint32_t add, uint32_t minus) | /* ajust RTC second or subsecond value of current time */
ErrStatus rtc_second_ajust(uint32_t add, uint32_t minus) | {
uint32_t time_index = RTC_SHIFTCTL_TIMEOUT;
ErrStatus error_status = ERROR;
uint32_t flag_status = RESET;
RTC_WPK = RTC_UNLOCK_KEY1;
RTC_WPK = RTC_UNLOCK_KEY2;
do{
flag_status = RTC_STAT & RTC_STAT_SOPF;
}while((--time_index > 0) && ((uint32_t)RESET != flag_status));
if(((u... | liuxuming/trochili | C++ | Apache License 2.0 | 132 |
/* Queue segment on the new socket if the new socket is active, otherwise we just shortcircuit this and continue with the new socket. */ | int dccp_child_process(struct sock *parent, struct sock *child, struct sk_buff *skb) | /* Queue segment on the new socket if the new socket is active, otherwise we just shortcircuit this and continue with the new socket. */
int dccp_child_process(struct sock *parent, struct sock *child, struct sk_buff *skb) | {
int ret = 0;
const int state = child->sk_state;
if (!sock_owned_by_user(child)) {
ret = dccp_rcv_state_process(child, skb, dccp_hdr(skb),
skb->len);
if (state == DCCP_RESPOND && child->sk_state != state)
parent->sk_data_ready(parent, 0);
} else {
sk_add_backlog(child, skb);
}
bh_unlock_sock(c... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Allocated Resources (required) end tag -> Resource Configuration Options (optional) end tag -> Compitable Device IDs (optional) final end tag -> Allocated Resources */ | static void pnpbios_parse_allocated_ioresource(struct pnp_dev *dev, int start, int len) | /* Allocated Resources (required) end tag -> Resource Configuration Options (optional) end tag -> Compitable Device IDs (optional) final end tag -> Allocated Resources */
static void pnpbios_parse_allocated_ioresource(struct pnp_dev *dev, int start, int len) | {
int flags = 0;
int end = start + len - 1;
if (len <= 0 || end >= 0x10003)
flags |= IORESOURCE_DISABLED;
pnp_add_io_resource(dev, start, end, flags);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Get the Monitor Baud Rate control register value of the Low Power Rx Path. */ | u32 UART_RxMonBaudCtrlRegGet(UART_TypeDef *UARTx) | /* Get the Monitor Baud Rate control register value of the Low Power Rx Path. */
u32 UART_RxMonBaudCtrlRegGet(UART_TypeDef *UARTx) | {
return UARTx->MON_BAUD_CTRL;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Requires ipc_ids.rw_mutex locked. Returns the LOCKED pointer to the ipc structure if found or NULL if not. If key is found ipc points to the owning ipc structure */ | static struct kern_ipc_perm* ipc_findkey(struct ipc_ids *ids, key_t key) | /* Requires ipc_ids.rw_mutex locked. Returns the LOCKED pointer to the ipc structure if found or NULL if not. If key is found ipc points to the owning ipc structure */
static struct kern_ipc_perm* ipc_findkey(struct ipc_ids *ids, key_t key) | {
struct kern_ipc_perm *ipc;
int next_id;
int total;
for (total = 0, next_id = 0; total < ids->in_use; next_id++) {
ipc = idr_find(&ids->ipcs_idr, next_id);
if (ipc == NULL)
continue;
if (ipc->key != key) {
total++;
continue;
}
ipc_lock_by_ptr(ipc);
return ipc;
}
return NULL;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Returns the USB Host Speed from the Low Level Driver. */ | USBH_SpeedTypeDef USBH_LL_GetSpeed(USBH_HandleTypeDef *phost) | /* Returns the USB Host Speed from the Low Level Driver. */
USBH_SpeedTypeDef USBH_LL_GetSpeed(USBH_HandleTypeDef *phost) | {
USBH_SpeedTypeDef speed = USBH_SPEED_FULL;
switch (HAL_HCD_GetCurrentSpeed(phost->pData))
{
case 0:
speed = USBH_SPEED_HIGH;
break;
case 1:
speed = USBH_SPEED_FULL;
break;
case 2:
speed = USBH_SPEED_LOW;
break;
default:
speed = USBH_SPEED_FULL;
break; ... | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Set a low output level on all the PIOs defined in ul_mask. This has no immediate effects on PIOs that are not output, but the PIO controller will save the value if they are changed to outputs. */ | void pio_clear(Pio *p_pio, const uint32_t ul_mask) | /* Set a low output level on all the PIOs defined in ul_mask. This has no immediate effects on PIOs that are not output, but the PIO controller will save the value if they are changed to outputs. */
void pio_clear(Pio *p_pio, const uint32_t ul_mask) | {
p_pio->PIO_CODR = ul_mask;
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* get hclk ( SDRAM, CSI, Memory Stick, I2C, DMA ) */ | static unsigned long hclk_get_rate(struct clk *clk) | /* get hclk ( SDRAM, CSI, Memory Stick, I2C, DMA ) */
static unsigned long hclk_get_rate(struct clk *clk) | {
return clk_get_rate(clk->parent) / (((__raw_readl(CCM_CSCR) &
CCM_CSCR_BCLK_MASK) >> CCM_CSCR_BCLK_OFFSET) + 1);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* The OMAP3430ES2 SSI target CM_IDLEST bit is at a different shift from the CM_{I,F}CLKEN bit. Pass back the correct info via @idlest_reg and @idlest_bit. No return value. */ | static void omap3430es2_clk_ssi_find_idlest(struct clk *clk, void __iomem **idlest_reg, u8 *idlest_bit) | /* The OMAP3430ES2 SSI target CM_IDLEST bit is at a different shift from the CM_{I,F}CLKEN bit. Pass back the correct info via @idlest_reg and @idlest_bit. No return value. */
static void omap3430es2_clk_ssi_find_idlest(struct clk *clk, void __iomem **idlest_reg, u8 *idlest_bit) | {
u32 r;
r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20);
*idlest_reg = (__force void __iomem *)r;
*idlest_bit = OMAP3430ES2_ST_SSI_IDLE_SHIFT;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* zhenhua_interrupt() is called by the low level driver when characters are ready for us. We then buffer them for further processing, or call the packet processing routine. */ | static irqreturn_t zhenhua_interrupt(struct serio *serio, unsigned char data, unsigned int flags) | /* zhenhua_interrupt() is called by the low level driver when characters are ready for us. We then buffer them for further processing, or call the packet processing routine. */
static irqreturn_t zhenhua_interrupt(struct serio *serio, unsigned char data, unsigned int flags) | {
struct zhenhua *zhenhua = serio_get_drvdata(serio);
if (data == 0xef)
zhenhua->idx = 0;
else if (zhenhua->idx == 0)
return IRQ_HANDLED;
if (zhenhua->idx < ZHENHUA_MAX_LENGTH)
zhenhua->data[zhenhua->idx++] = zhenhua_bitreverse(data);
if (zhenhua->idx == ZHENHUA_MAX_LENGTH) {
zhenhua_process_packet(zhenhua... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Before you start, select your target, on the right of the "Load" button */ | int main(void) | /* Before you start, select your target, on the right of the "Load" button */
int main(void) | {
for (i = 0; i < 10; i++) {
TM_DISCO_LedToggle(LED_RED);
Delayms(100);
}
}
TM_RTC_Init(TM_RTC_ClockSource_Internal);
TM_RTC_Interrupts(TM_RTC_Int_10s);
TM_LOWPOWER_EnableWakeUpPin();
TM_DELAY_SetTime(0);
while (1) {
if (TM_DELAY_Time() >= 200) {
TM_DELAY_SetTime(0);
TM_DISCO_LedToggle(LED_GREEN... | MaJerle/stm32f429 | C++ | null | 2,036 |
/* Enable the SPI interrupt of the specified SPI port. */ | void SPIIntEnable(unsigned long ulBase, unsigned long ulIntFlags) | /* Enable the SPI interrupt of the specified SPI port. */
void SPIIntEnable(unsigned long ulBase, unsigned long ulIntFlags) | {
xASSERT((ulBase == SPI0_BASE) || (ulBase == SPI1_BASE));
xHWREG(ulBase + SPI_IIER) |= ulIntFlags;
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* param base CRC peripheral address. param data Input data stream, MSByte in data. param dataSize Size of the input data buffer in bytes. */ | void CRC_WriteData(CRC_Type *base, const uint8_t *data, size_t dataSize) | /* param base CRC peripheral address. param data Input data stream, MSByte in data. param dataSize Size of the input data buffer in bytes. */
void CRC_WriteData(CRC_Type *base, const uint8_t *data, size_t dataSize) | {
const uint32_t *data32;
while ((0U != dataSize) && (0U != ((uint32_t)data & 3U)))
{
*((__O uint8_t *)&(base->WR_DATA)) = *data;
data++;
dataSize--;
}
data32 = (const uint32_t *)data;
while (dataSize >= sizeof(uint32_t))
{
*((__O uint32_t *)&(base->WR_DATA)) ... | ARMmbed/DAPLink | C++ | Apache License 2.0 | 2,140 |
/* Enables or disables the specified DAC channel DMA request. When enabled DMA1 is generated when an external trigger (EXTI Line9, TIM2, TIM4, TIM6, TIM7 or TIM9 but not a software trigger) occurs. */ | void DAC_DMACmd(DAC_TypeDef *DACx, uint32_t DAC_Channel, FunctionalState NewState) | /* Enables or disables the specified DAC channel DMA request. When enabled DMA1 is generated when an external trigger (EXTI Line9, TIM2, TIM4, TIM6, TIM7 or TIM9 but not a software trigger) occurs. */
void DAC_DMACmd(DAC_TypeDef *DACx, uint32_t DAC_Channel, FunctionalState NewState) | {
assert_param(IS_DAC_ALL_PERIPH(DACx));
assert_param(IS_DAC_CHANNEL(DAC_Channel));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
DACx->CR |= (DAC_CR_DMAEN1 << DAC_Channel);
}
else
{
DACx->CR &= (~(DAC_CR_DMAEN1 << DAC_Channel));
}
} | avem-labs/Avem | C++ | MIT License | 1,752 |
/* Computes the CRC checksum for a data buffer. */ | uint8_t ad7124_compute_crc8(uint8_t *p_buf, uint8_t buf_size) | /* Computes the CRC checksum for a data buffer. */
uint8_t ad7124_compute_crc8(uint8_t *p_buf, uint8_t buf_size) | {
uint8_t i = 0;
uint8_t crc = 0;
while(buf_size) {
for(i = 0x80; i != 0; i >>= 1) {
bool cmp1 = (crc & 0x80) != 0;
bool cmp2 = (*p_buf & i) != 0;
if(cmp1 != cmp2) {
crc <<= 1;
crc ^= AD7124_CRC8_POLYNOMIAL_REPRESENTATION;
} else {
crc <<= 1;
}
}
p_buf++;
buf_size--;
}
return crc... | analogdevicesinc/EVAL-ADICUP3029 | C++ | Other | 36 |
/* Copy configuration data to urb transfer buffer if there is room for it. */ | void copy_config(struct urb *urb, void *data, int max_length, int max_buf) | /* Copy configuration data to urb transfer buffer if there is room for it. */
void copy_config(struct urb *urb, void *data, int max_length, int max_buf) | {
int available;
int length;
if (!data) {
dbg_ep0 (1, "data is NULL");
return;
}
length = max_length;
if (length > max_length) {
dbg_ep0 (1, "length: %d >= max_length: %d", length,
max_length);
return;
}
if ((available = max_buf - urb->actual_length) <= 0) {
return;
}
if (length > available) {
... | EmcraftSystems/u-boot | C++ | Other | 181 |
/* This function returns %0 on success and a negative error code on failure. */ | int ubifs_clean_lebs(const struct ubifs_info *c, void *sbuf) | /* This function returns %0 on success and a negative error code on failure. */
int ubifs_clean_lebs(const struct ubifs_info *c, void *sbuf) | {
dbg_rcvry("recovery");
while (!list_empty(&c->unclean_leb_list)) {
struct ubifs_unclean_leb *ucleb;
int err;
ucleb = list_entry(c->unclean_leb_list.next,
struct ubifs_unclean_leb, list);
err = clean_an_unclean_leb(c, ucleb, sbuf);
if (err)
return err;
list_del(&ucleb->list);
kfree(ucleb);
}... | EmcraftSystems/u-boot | C++ | Other | 181 |
/* set_attention_status - Turns the Amber LED for a slot on or off @hotplug_slot: slot to change LED on @status: LED control flag */ | static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) | /* set_attention_status - Turns the Amber LED for a slot on or off @hotplug_slot: slot to change LED on @status: LED control flag */
static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) | {
struct pci_func *slot_func;
struct slot *slot = hotplug_slot->private;
struct controller *ctrl = slot->ctrl;
u8 bus;
u8 devfn;
u8 device;
u8 function;
dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));
if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1)
return -ENODEV;
device = devfn ... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Message: StopMulticastMediaReceptionMessage Opcode: 0x0103 Type: MediaControl Direction: pbx2dev VarLength: no */ | static void handle_StopMulticastMediaReceptionMessage(ptvcursor_t *cursor, packet_info *pinfo _U_) | /* Message: StopMulticastMediaReceptionMessage Opcode: 0x0103 Type: MediaControl Direction: pbx2dev VarLength: no */
static void handle_StopMulticastMediaReceptionMessage(ptvcursor_t *cursor, packet_info *pinfo _U_) | {
ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN);
ptvcursor_add(cursor, hf_skinny_passThruPartyID, 4, ENC_LITTLE_ENDIAN);
si->callId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_skinny_callReference, 4, ENC_LITTLE_ENDIAN);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Erase All Option Bytes.
This performs all operations necessary to erase the option bytes. These must first be fully erased before attempting to program them, therefore it is recommended to check these after an erase attempt. */ | void flash_erase_option_bytes(void) | /* Erase All Option Bytes.
This performs all operations necessary to erase the option bytes. These must first be fully erased before attempting to program them, therefore it is recommended to check these after an erase attempt. */
void flash_erase_option_bytes(void) | {
flash_wait_for_last_operation();
if ((FLASH_CR & FLASH_CR_OPTWRE) == 0) {
flash_unlock_option_bytes();
}
FLASH_CR |= FLASH_CR_OPTER;
FLASH_CR |= FLASH_CR_STRT;
flash_wait_for_last_operation();
FLASH_CR &= ~FLASH_CR_OPTER;
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* Reads from the memory space of a PCI controller. Returns either when the polling exit criteria is satisfied or after a defined duration. */ | STATIC EFI_STATUS EFIAPI PciIoPollMem(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result) | /* Reads from the memory space of a PCI controller. Returns either when the polling exit criteria is satisfied or after a defined duration. */
STATIC EFI_STATUS EFIAPI PciIoPollMem(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT8 BarIndex, IN UINT64 Offset, IN UINT64 Mask, IN UINT64 Value, IN ... | {
NON_DISCOVERABLE_PCI_DEVICE *Dev;
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Desc;
UINTN Count;
EFI_STATUS Status;
if ((UINT32)Width > EfiPciIoWidthUint64) {
return EFI_INVALID_PARAMETER;
}
if (Result == NULL) {
return EFI_INVALID_PARAMETER;
... | tianocore/edk2 | C++ | Other | 4,240 |
/* Zero the heap and initialize start, end and lowest-free */ | void mem_init(void) | /* Zero the heap and initialize start, end and lowest-free */
void mem_init(void) | {
struct mem *mem;
LWIP_ASSERT("Sanity check alignment",
(SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT-1)) == 0);
ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER);
mem = (struct mem *)(void *)ram;
mem->next = MEM_SIZE_ALIGNED;
mem->prev = 0;
mem->used = 0;
ram_end = (struct mem *)(void *)&ram[MEM_SIZE_ALIG... | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Support for TX4938 in 2.6 - Manish Lachwani ( */ | void __init rbtx4938_prom_init(void) | /* Support for TX4938 in 2.6 - Manish Lachwani ( */
void __init rbtx4938_prom_init(void) | {
add_memory_region(0, tx4938_get_mem_size(), BOOT_MEM_RAM);
txx9_sio_putchar_init(TX4938_SIO_REG(0) & 0xfffffffffULL);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Application entry point for TRNG example.
Enable the TRNG, display the generated random value. */ | int main(void) | /* Application entry point for TRNG example.
Enable the TRNG, display the generated random value. */
int main(void) | {
sysclk_init();
board_init();
configure_console();
printf("-- TRNG Example --\n\r");
printf("-- %s\n\r", BOARD_NAME);
printf("-- Compiled: %s %s --\n\r", __DATE__, __TIME__);
pmc_enable_periph_clk(ID_TRNG);
trng_enable(TRNG);
NVIC_DisableIRQ(TRNG_IRQn);
NVIC_ClearPendingIRQ(TRNG_IRQn);
NVIC_SetPriority(TRNG... | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Get a free scb. If there are none, see if we can allocate a new SCB. */ | struct scb* ahc_get_scb(struct ahc_softc *ahc) | /* Get a free scb. If there are none, see if we can allocate a new SCB. */
struct scb* ahc_get_scb(struct ahc_softc *ahc) | {
struct scb *scb;
if ((scb = SLIST_FIRST(&ahc->scb_data->free_scbs)) == NULL) {
ahc_alloc_scbs(ahc);
scb = SLIST_FIRST(&ahc->scb_data->free_scbs);
if (scb == NULL)
return (NULL);
}
SLIST_REMOVE_HEAD(&ahc->scb_data->free_scbs, links.sle);
return (scb);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Created on: 10 feb. 2019 Author: Daniel Mårtensson Sub C = A-B with A size row_a x column_a and B have the size row_a x column_b and C have the size row_a x column_a */ | void sub(double *A, double *B, double *C, int row_a, int column_a, int column_b) | /* Created on: 10 feb. 2019 Author: Daniel Mårtensson Sub C = A-B with A size row_a x column_a and B have the size row_a x column_b and C have the size row_a x column_a */
void sub(double *A, double *B, double *C, int row_a, int column_a, int column_b) | {
for (int j = 0; j < columnMatrix; j++) {
if (column_b == 1 && column_a > 1)
*(C++) = *(A++) - *(B + i);
else if (column_b > 1 && column_a == 1)
*(C++) = *(A + i) - *(B++);
else
*(C++) = *(A++) - *(B++);
}
}
} | DanielMartensson/EmbeddedLapack | C++ | MIT License | 129 |
/* This unregisters the passed device. Future open calls will be met with errors. */ | void video_unregister_device(struct video_device *vdev) | /* This unregisters the passed device. Future open calls will be met with errors. */
void video_unregister_device(struct video_device *vdev) | {
if (!vdev || !video_is_registered(vdev))
return;
mutex_lock(&videodev_lock);
clear_bit(V4L2_FL_REGISTERED, &vdev->flags);
mutex_unlock(&videodev_lock);
device_unregister(&vdev->dev);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* We could use standard atomic bitops in the following root status manipulation routines, but let's prepare for SMP support in the same move, preventing CPU migration as required. */ | void __ipipe_stall_root(void) | /* We could use standard atomic bitops in the following root status manipulation routines, but let's prepare for SMP support in the same move, preventing CPU migration as required. */
void __ipipe_stall_root(void) | {
unsigned long *p, flags;
local_irq_save_hw(flags);
p = &__ipipe_root_status;
__set_bit(IPIPE_STALL_FLAG, p);
local_irq_restore_hw(flags);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Callback used by the exception stores to load exceptions when initialising. */ | static int dm_add_exception(void *context, chunk_t old, chunk_t new) | /* Callback used by the exception stores to load exceptions when initialising. */
static int dm_add_exception(void *context, chunk_t old, chunk_t new) | {
struct dm_snapshot *s = context;
struct dm_exception *e;
e = alloc_completed_exception();
if (!e)
return -ENOMEM;
e->old_chunk = old;
e->new_chunk = new;
dm_insert_exception(&s->complete, e);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Get the current state of a hat on a joystick */ | Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat) | /* Get the current state of a hat on a joystick */
Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat) | {
Uint8 state;
if (!SDL_PrivateJoystickValid(joystick)) {
return 0;
}
if (hat < joystick->nhats) {
state = joystick->hats[hat];
} else {
SDL_SetError("Joystick only has %d hats", joystick->nhats);
state = 0;
}
return state;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Return codes 0 - success (currently always success) */ | static int lpfc_post_rcv_buf(struct lpfc_hba *) | /* Return codes 0 - success (currently always success) */
static int lpfc_post_rcv_buf(struct lpfc_hba *) | {
struct lpfc_sli *psli = &phba->sli;
lpfc_post_buffer(phba, &psli->ring[LPFC_ELS_RING], LPFC_BUF_RING0);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred. */ | guint32 g_data_input_stream_read_uint32(GDataInputStream *stream, GCancellable *cancellable, GError **error) | /* Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred. */
guint32 g_data_input_stream_read_uint32(GDataInputStream *stream, GCancellable *cancellable, GError **error) | {
guint32 v;
g_return_val_if_fail (G_IS_DATA_INPUT_STREAM (stream), 0);
if (read_data (stream, &v, 4, cancellable, error))
{
switch (stream->priv->byte_order)
{
case G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN:
v = GUINT32_FROM_BE (v);
break;
case G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN:
v = GUINT32_... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* RLE compress the image, with maximum size of out_size */ | static int targa_encode_rle(uint8_t *outbuf, int out_size, AVFrame *pic, int bpp, int w, int h) | /* RLE compress the image, with maximum size of out_size */
static int targa_encode_rle(uint8_t *outbuf, int out_size, AVFrame *pic, int bpp, int w, int h) | {
int y,ret;
uint8_t *out;
out = outbuf;
for(y = 0; y < h; y ++) {
ret = ff_rle_encode(out, out_size, pic->data[0] + pic->linesize[0] * y, bpp, w, 0x7f, 0, -1, 0);
if(ret == -1){
return -1;
}
out+= ret;
out_size -= ret;
}
return out - outbuf;
} | DC-SWAT/DreamShell | C++ | null | 404 |
/* Get the manufacturer name from an EDID info. */ | static void edid_get_manufacturer_name(struct edid1_info *edid, char *name) | /* Get the manufacturer name from an EDID info. */
static void edid_get_manufacturer_name(struct edid1_info *edid, char *name) | {
name[0] = EDID1_INFO_MANUFACTURER_NAME_CHAR1(*edid) + 'A' - 1;
name[1] = EDID1_INFO_MANUFACTURER_NAME_CHAR2(*edid) + 'A' - 1;
name[2] = EDID1_INFO_MANUFACTURER_NAME_CHAR3(*edid) + 'A' - 1;
name[3] = '\0';
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Get number of memory blocks available in a Memory Pool. */ | uint32_t osMemoryPoolGetSpace(osMemoryPoolId_t mp_id) | /* Get number of memory blocks available in a Memory Pool. */
uint32_t osMemoryPoolGetSpace(osMemoryPoolId_t mp_id) | {
space = svcRtxMemoryPoolGetSpace(mp_id);
} else {
space = __svcMemoryPoolGetSpace(mp_id);
}
return space;
} | ARMmbed/DAPLink | C++ | Apache License 2.0 | 2,140 |
/* This function performs periodic timer processing in the ARP module and should be called at regular intervals. The recommended interval is 10 seconds between the calls. */ | void uip_arp_timer(void) | /* This function performs periodic timer processing in the ARP module and should be called at regular intervals. The recommended interval is 10 seconds between the calls. */
void uip_arp_timer(void) | {
struct arp_entry *tabptr = NULL;
++arptime;
for(i = 0; i < UIP_ARPTAB_SIZE; ++i) {
tabptr = &arp_table[i];
if(uip_ipaddr_cmp(&tabptr->ipaddr, &uip_all_zeroes_addr) &&
arptime - tabptr->time >= UIP_ARP_MAXAGE) {
memset(&tabptr->ipaddr, 0, 4);
}
}
} | prusa3d/Prusa-Firmware-Buddy | C++ | Other | 1,019 |
/* bsec_lock() - manage lock for each type SR/SP/SW @address: address of bsec IP register @otp: otp number (0 - BSEC_OTP_MAX_VALUE) Return: true if locked else false */ | static bool bsec_read_lock(u32 address, u32 otp) | /* bsec_lock() - manage lock for each type SR/SP/SW @address: address of bsec IP register @otp: otp number (0 - BSEC_OTP_MAX_VALUE) Return: true if locked else false */
static bool bsec_read_lock(u32 address, u32 otp) | {
u32 bit;
u32 bank;
bit = 1 << (otp & OTP_LOCK_MASK);
bank = ((otp >> OTP_LOCK_BANK_SHIFT) & OTP_LOCK_MASK) * sizeof(u32);
return !!(readl(address + bank) & bit);
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* This function will return whether this file has been opend. */ | int dfs_file_is_open(const char *pathname) | /* This function will return whether this file has been opend. */
int dfs_file_is_open(const char *pathname) | {
char *fullpath = NULL;
struct dfs_vnode *vnode = NULL;
int ret = 0;
fullpath = dfs_normalize_path(NULL, pathname);
dfs_fm_lock();
vnode = dfs_vnode_find(fullpath, NULL);
if (vnode)
{
ret = 1;
}
dfs_fm_unlock();
rt_free(fullpath);
return ret;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Read accelerometer device ID and revision numbers.
This function reads the accelerometer hardware identification registers and returns these values to the addresses specified in the function parameters. */ | static bool kxtf9_device_id(sensor_hal_t *hal, sensor_data_t *data) | /* Read accelerometer device ID and revision numbers.
This function reads the accelerometer hardware identification registers and returns these values to the addresses specified in the function parameters. */
static bool kxtf9_device_id(sensor_hal_t *hal, sensor_data_t *data) | {
data->device.id = (uint32_t)sensor_bus_get(hal, KXTF9_WHO_AM_I);
data->device.version = 0;
return true;
} | memfault/zero-to-main | C++ | null | 200 |
/* Return timestamp to next even whether it is RX_OFF or update event */ | static int64_t calc_next_event(void) | /* Return timestamp to next even whether it is RX_OFF or update event */
static int64_t calc_next_event(void) | {
return Z_MIN(next_update(), next_rx_off());
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Internal function to retrieve the ACPI I/O Port Base Address. */ | UINT16 InternalAcpiGetAcpiTimerIoPort(VOID) | /* Internal function to retrieve the ACPI I/O Port Base Address. */
UINT16 InternalAcpiGetAcpiTimerIoPort(VOID) | {
UINT16 Port;
Port = PcdGet16 (PcdAcpiIoPortBaseAddress);
if (PcdGet16 (PcdAcpiIoPciBarRegisterOffset) != 0x0000) {
Port = PciRead16 (
PCI_LIB_ADDRESS (
PcdGet8 (PcdAcpiIoPciBusNumber),
PcdGet8 (PcdAcpiIoPciDeviceNumber),
PcdGet8 (PcdAcpiIoPciFunctio... | tianocore/edk2 | C++ | Other | 4,240 |
/* Makes the native window associated with the given SDL window visible. */ | static void showWindow(_THIS, SDL_Window *window) | /* Makes the native window associated with the given SDL window visible. */
static void showWindow(_THIS, SDL_Window *window) | {
window_impl_t *impl = (window_impl_t *)window->driverdata;
const int visible = 1;
screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_VISIBLE,
&visible);
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* Returns: -1 on immediate error, file descriptor on success. */ | int inet_nonblocking_connect(const char *str, NonBlockingConnectHandler *callback, void *opaque, Error **errp) | /* Returns: -1 on immediate error, file descriptor on success. */
int inet_nonblocking_connect(const char *str, NonBlockingConnectHandler *callback, void *opaque, Error **errp) | {
QemuOpts *opts;
int sock = -1;
InetSocketAddress *addr;
g_assert(callback != NULL);
addr = inet_parse(str, errp);
if (addr != NULL) {
opts = qemu_opts_create(&socket_optslist, NULL, 0, &error_abort);
inet_addr_to_opts(opts, addr);
qapi_free_InetSocketAddress(addr);
... | ve3wwg/teensy3_qemu | C++ | Other | 15 |
/* Calculate prescaler value used to determine DAC clock.
The DAC clock is given by: HFPERCLK / (prescale ^ 2). */ | uint8_t DAC_PrescaleCalc(uint32_t dacFreq, uint32_t hfperFreq) | /* Calculate prescaler value used to determine DAC clock.
The DAC clock is given by: HFPERCLK / (prescale ^ 2). */
uint8_t DAC_PrescaleCalc(uint32_t dacFreq, uint32_t hfperFreq) | {
uint32_t ret;
if (dacFreq > DAC_MAX_CLOCK)
{
dacFreq = DAC_MAX_CLOCK;
}
if (!hfperFreq)
{
hfperFreq = CMU_ClockFreqGet(cmuClock_HFPER);
}
for (ret = 0; ret <= (_DAC_CTRL_PRESC_MASK >> _DAC_CTRL_PRESC_SHIFT); ret++)
{
if ((hfperFreq >> ret) <= dacFreq)
break;
}
return((uint8_t)r... | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Release the resource in the prefix list table, and destroy the list entry and corresponding addresses or route entries. */ | VOID Ip6CleanPrefixListTable(IN IP6_SERVICE *IpSb, IN LIST_ENTRY *ListHead) | /* Release the resource in the prefix list table, and destroy the list entry and corresponding addresses or route entries. */
VOID Ip6CleanPrefixListTable(IN IP6_SERVICE *IpSb, IN LIST_ENTRY *ListHead) | {
IP6_PREFIX_LIST_ENTRY *PrefixList;
BOOLEAN OnLink;
OnLink = (BOOLEAN)(ListHead == &IpSb->OnlinkPrefix);
while (!IsListEmpty (ListHead)) {
PrefixList = NET_LIST_HEAD (ListHead, IP6_PREFIX_LIST_ENTRY, Link);
Ip6DestroyPrefixListEntry (IpSb, PrefixList, OnLink, TRUE);
}
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Given a desired period (in ns), return the proper counter value (divider-1) for the internal clock. Sets the original period to be the true value. */ | static int rtd_ns_to_timer(unsigned int *ns, int roundMode) | /* Given a desired period (in ns), return the proper counter value (divider-1) for the internal clock. Sets the original period to be the true value. */
static int rtd_ns_to_timer(unsigned int *ns, int roundMode) | {
return rtd_ns_to_timer_base(ns, round_mode, RTD_CLOCK_BASE);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* 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_6|GPIO_PIN_7);
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_8);
}
else if(hspi->Instance==SPI2)
{
__HAL_RCC_SPI2_CLK_DISABLE();
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_2|GPIO_PIN_3);
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_1... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Returns the current protection level for an EEPROM block. */ | unsigned long EEPROMBlockProtectGet(unsigned long ulBlock) | /* Returns the current protection level for an EEPROM block. */
unsigned long EEPROMBlockProtectGet(unsigned long ulBlock) | {
ASSERT(ulBlock < BLOCKS_FROM_EESIZE(HWREG(EEPROM_EESIZE)));
HWREG(EEPROM_EEBLOCK) = ulBlock;
return(HWREG(EEPROM_EEPROT));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Called when closing the input device. This will unlink the URB */ | static void gtco_input_close(struct input_dev *inputdev) | /* Called when closing the input device. This will unlink the URB */
static void gtco_input_close(struct input_dev *inputdev) | {
struct gtco *device = input_get_drvdata(inputdev);
usb_kill_urb(device->urbinfo);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* e1000_get_hw_control sets {CTRL_EXT|SWSM}:DRV_LOAD bit. For ASF and Pass Through versions of f/w this means that the driver is loaded. For AMT version (only with 82573) of the f/w this means that the network i/f is open. */ | static void e1000_get_hw_control(struct e1000_adapter *adapter) | /* e1000_get_hw_control sets {CTRL_EXT|SWSM}:DRV_LOAD bit. For ASF and Pass Through versions of f/w this means that the driver is loaded. For AMT version (only with 82573) of the f/w this means that the network i/f is open. */
static void e1000_get_hw_control(struct e1000_adapter *adapter) | {
struct e1000_hw *hw = &adapter->hw;
u32 ctrl_ext;
u32 swsm;
if (adapter->flags & FLAG_HAS_SWSM_ON_LOAD) {
swsm = er32(SWSM);
ew32(SWSM, swsm | E1000_SWSM_DRV_LOAD);
} else if (adapter->flags & FLAG_HAS_CTRLEXT_ON_LOAD) {
ctrl_ext = er32(CTRL_EXT);
ew32(CTRL_EXT, ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* @event notified event @context pointer to the notification count */ | static void EFIAPI notify(struct efi_event *event, void *context) | /* @event notified event @context pointer to the notification count */
static void EFIAPI notify(struct efi_event *event, void *context) | {
unsigned int *count = context;
if (count)
++*count;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Waits for a character from the specified port. */ | long UARTCharGet(unsigned long ulBase) | /* Waits for a character from the specified port. */
long UARTCharGet(unsigned long ulBase) | {
xASSERT(UARTBaseValid(ulBase));
while(xHWREG(ulBase + UART_FSR) & UART_FSR_RX_EF)
{
}
return(xHWREG(ulBase + UART_RBR));
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Do AND operation with the value of the specified EMMC host controller mmio register. */ | EFI_STATUS EFIAPI EmmcPeimHcAndMmio(IN UINTN Address, IN UINT8 Count, IN VOID *AndData) | /* Do AND operation with the value of the specified EMMC host controller mmio register. */
EFI_STATUS EFIAPI EmmcPeimHcAndMmio(IN UINTN Address, IN UINT8 Count, IN VOID *AndData) | {
EFI_STATUS Status;
UINT64 Data;
UINT64 And;
Status = EmmcPeimHcRwMmio (Address, TRUE, Count, &Data);
if (EFI_ERROR (Status)) {
return Status;
}
if (Count == 1) {
And = *(UINT8 *)AndData;
} else if (Count == 2) {
And = *(UINT16 *)AndData;
} else if (Count == 4) {
And = *(UI... | tianocore/edk2 | C++ | Other | 4,240 |
/* Setup a few DMA registers so we can safely do DMA transfers early on in the kernel booting process. Really this just means using dma_memcpy(). */ | void __init blackfin_dma_early_init(void) | /* Setup a few DMA registers so we can safely do DMA transfers early on in the kernel booting process. Really this just means using dma_memcpy(). */
void __init blackfin_dma_early_init(void) | {
early_shadow_stamp();
bfin_write_MDMA_S0_CONFIG(0);
bfin_write_MDMA_S1_CONFIG(0);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Note: nobody should set the TTY_LDISC bit except via this function. Clearing directly is allowed. */ | void tty_ldisc_enable(struct tty_struct *tty) | /* Note: nobody should set the TTY_LDISC bit except via this function. Clearing directly is allowed. */
void tty_ldisc_enable(struct tty_struct *tty) | {
set_bit(TTY_LDISC, &tty->flags);
clear_bit(TTY_LDISC_CHANGING, &tty->flags);
wake_up(&tty_ldisc_wait);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This is notification function converts any registered PRM_RUNTIME_MMIO_RANGE addresses to a virtual address. */ | VOID EFIAPI PrmConfigVirtualAddressChangeEvent(IN EFI_EVENT Event, IN VOID *Context) | /* This is notification function converts any registered PRM_RUNTIME_MMIO_RANGE addresses to a virtual address. */
VOID EFIAPI PrmConfigVirtualAddressChangeEvent(IN EFI_EVENT Event, IN VOID *Context) | {
UINTN Index;
for (Index = 0; Index < mMaxRuntimeMmioRangeCount; Index++) {
ConvertRuntimeMemoryRangeAddresses (mRuntimeMmioRanges[Index]);
}
} | tianocore/edk2 | C++ | Other | 4,240 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.