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
/* configure the different system clocks , V1.0.0, platform GD32F1x0(x=3,5) , V2.0.0, platform GD32F1x0(x=3,5,7,9) , V3.0.0, firmware update for GD32F1x0(x=3,5,7,9) */
void rcu_config(void)
/* configure the different system clocks , V1.0.0, platform GD32F1x0(x=3,5) , V2.0.0, platform GD32F1x0(x=3,5,7,9) , V3.0.0, firmware update for GD32F1x0(x=3,5,7,9) */ void rcu_config(void)
{ rcu_periph_clock_enable(RCU_PMU); pmu_backup_write_enable(); rcu_osci_on(RCU_IRC40K); rcu_osci_stab_wait(RCU_IRC40K); rcu_slcd_clock_config(RCU_RTC_IRC40K); }
liuxuming/trochili
C++
Apache License 2.0
132
/* Enables generator and fault interrupts for a PWM module. */
void PWMIntEnable(uint32_t ui32Base, uint32_t ui32GenFault)
/* Enables generator and fault interrupts for a PWM module. */ void PWMIntEnable(uint32_t ui32Base, uint32_t ui32GenFault)
{ ASSERT(ui32Base == PWM0_BASE); ASSERT((ui32GenFault & ~(PWM_INT_GEN_0 | PWM_INT_GEN_1 | PWM_INT_GEN_2 | PWM_INT_GEN_3 | PWM_INT_FAULT0 | PWM_INT_FAULT1 | PWM_INT_FAULT2 | PWM_INT_FAULT3)) == 0); HWREG(ui32Base + PWM_O_INTEN) |= ui32GenFault; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* this function registers th driver to the device subsystem( either PCI, USB, etc) */
static int __init rar_init_handler(void)
/* this function registers th driver to the device subsystem( either PCI, USB, etc) */ static int __init rar_init_handler(void)
{ return pci_register_driver(&rar_pci_driver); }
robutest/uclinux
C++
GPL-2.0
60
/* Writes and returns a new value to DR6. 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 AsmWriteDr6(UINTN Dr6)
/* Writes and returns a new value to DR6. 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 AsmWriteDr6(UINTN Dr6)
{ __asm__ __volatile__ ( "movl %0, %%dr6" : : "r" (Dr6) ); return Dr6; }
tianocore/edk2
C++
Other
4,240
/* Writes a 32 bit integer to the address space of a given SDIO function. @err_ret will contain the status of the actual transfer. */
void sdio_writel(struct sdio_func *func, u32 b, unsigned int addr, int *err_ret)
/* Writes a 32 bit integer to the address space of a given SDIO function. @err_ret will contain the status of the actual transfer. */ void sdio_writel(struct sdio_func *func, u32 b, unsigned int addr, int *err_ret)
{ int ret; *(__le32 *)func->tmpbuf = cpu_to_le32(b); ret = sdio_memcpy_toio(func, addr, func->tmpbuf, 4); if (err_ret) *err_ret = ret; }
robutest/uclinux
C++
GPL-2.0
60
/* memory_bm_find_bit - find the bit in the bitmap @bm that corresponds to given pfn. The cur_zone_bm member of @bm and the cur_block member of @bm->cur_zone_bm are updated. */
static int memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn, void **addr, unsigned int *bit_nr)
/* memory_bm_find_bit - find the bit in the bitmap @bm that corresponds to given pfn. The cur_zone_bm member of @bm and the cur_block member of @bm->cur_zone_bm are updated. */ static int memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn, void **addr, unsigned int *bit_nr)
{ struct bm_block *bb; bb = bm->cur.block; if (pfn < bb->start_pfn) list_for_each_entry_continue_reverse(bb, &bm->blocks, hook) if (pfn >= bb->start_pfn) break; if (pfn >= bb->end_pfn) list_for_each_entry_continue(bb, &bm->blocks, hook) if (pfn >= bb->start_pfn && pfn < bb->end_pfn) break; if (&bb->hook == &bm->blocks) return -EFAULT; bm->cur.block = bb; pfn -= bb->start_pfn; bm->cur.bit = pfn + 1; *bit_nr = pfn; *addr = bb->data; return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* See the Unified Extensible Firmware Interface (UEFI) specification for details. */
static efi_status_t EFIAPI efi_cin_set_state(struct efi_simple_text_input_ex_protocol *this, u8 *key_toggle_state)
/* See the Unified Extensible Firmware Interface (UEFI) specification for details. */ static efi_status_t EFIAPI efi_cin_set_state(struct efi_simple_text_input_ex_protocol *this, u8 *key_toggle_state)
{ EFI_ENTRY("%p, %p", this, key_toggle_state); return EFI_EXIT(EFI_UNSUPPORTED); }
4ms/stm32mp1-baremetal
C++
Other
137
/* Schedule a run of i2400ms_tx_submit() to handle it. */
void i2400ms_bus_tx_kick(struct i2400m *i2400m)
/* Schedule a run of i2400ms_tx_submit() to handle it. */ void i2400ms_bus_tx_kick(struct i2400m *i2400m)
{ struct i2400ms *i2400ms = container_of(i2400m, struct i2400ms, i2400m); struct device *dev = &i2400ms->func->dev; d_fnstart(3, dev, "(i2400m %p) = void\n", i2400m); queue_work(i2400ms->tx_workqueue, &i2400ms->tx_worker); d_fnend(3, dev, "(i2400m %p) = void\n", i2400m); }
robutest/uclinux
C++
GPL-2.0
60
/* Called from the driver init routine to register a driver. The cx_drv struct contains the driver name, a pointer to a table of part/mfg numbers and a pointer to the driver's probe/attach routine. */
int cx_driver_register(struct cx_drv *cx_driver)
/* Called from the driver init routine to register a driver. The cx_drv struct contains the driver name, a pointer to a table of part/mfg numbers and a pointer to the driver's probe/attach routine. */ int cx_driver_register(struct cx_drv *cx_driver)
{ cx_driver->driver.name = cx_driver->name; cx_driver->driver.bus = &tiocx_bus_type; return driver_register(&cx_driver->driver); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* This routine is invoked to remove the memory region that provided rpi via a bitmask. */
void lpfc_sli4_remove_rpis(struct lpfc_hba *phba)
/* This routine is invoked to remove the memory region that provided rpi via a bitmask. */ void lpfc_sli4_remove_rpis(struct lpfc_hba *phba)
{ kfree(phba->sli4_hba.rpi_bmask); }
robutest/uclinux
C++
GPL-2.0
60
/* fc_set_rport_loss_tmo() - Set the remote port loss timeout @rport: The remote port that gets a new timeout value @timeout: The new timeout value (in seconds) */
void fc_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout)
/* fc_set_rport_loss_tmo() - Set the remote port loss timeout @rport: The remote port that gets a new timeout value @timeout: The new timeout value (in seconds) */ void fc_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout)
{ if (timeout) rport->dev_loss_tmo = timeout + 5; else rport->dev_loss_tmo = 30; }
robutest/uclinux
C++
GPL-2.0
60
/* Stores the incoming character in the ring buffer */
static void atmel_buffer_rx_char(struct uart_port *port, unsigned int status, unsigned int ch)
/* Stores the incoming character in the ring buffer */ static void atmel_buffer_rx_char(struct uart_port *port, unsigned int status, unsigned int ch)
{ struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); struct circ_buf *ring = &atmel_port->rx_ring; struct atmel_uart_char *c; if (!CIRC_SPACE(ring->head, ring->tail, ATMEL_SERIAL_RINGSIZE)) return; c = &((struct atmel_uart_char *)ring->buf)[ring->head]; c->status = status; c->ch = ch; smp_wmb(); ring->head = (ring->head + 1) & (ATMEL_SERIAL_RINGSIZE - 1); }
robutest/uclinux
C++
GPL-2.0
60
/* The result is not NUL-terminated if the source exceeds */
char* strncpy(char *dest, const char *src, size_t n)
/* The result is not NUL-terminated if the source exceeds */ char* strncpy(char *dest, const char *src, size_t n)
{ size_t len = __strnend(src, n) - src; __builtin_memset(dest + len, 0, n - len); __builtin_memcpy(dest, src, len); return dest; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
/* Event handler for the library USB Configuration Changed event. */ void EVENT_USB_Device_ConfigurationChanged(void)
{ bool ConfigSuccess = true; ConfigSuccess &= CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface); PulseMSRemaining.PingPongLEDPulse = 0; LEDs_SetAllLEDs(ConfigSuccess ? LEDS_NO_LEDS : LEDMASK_ERROR); }
prusa3d/Prusa-Firmware-Buddy
C++
Other
1,019
/* Command response callback function for sd_ble_gap_rssi_stop BLE command. Callback for decoding the output parameters and the command response return code. */
static uint32_t gap_rssi_stop_rsp_dec(const uint8_t *p_buffer, uint16_t length)
/* Command response callback function for sd_ble_gap_rssi_stop BLE command. Callback for decoding the output parameters and the command response return code. */ static uint32_t gap_rssi_stop_rsp_dec(const uint8_t *p_buffer, uint16_t length)
{ uint32_t result_code = 0; const uint32_t err_code = ble_gap_rssi_stop_rsp_dec(p_buffer, length, &result_code); APP_ERROR_CHECK(err_code); return result_code; }
labapart/polymcu
C++
null
201
/* UART MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_UART_MspDeInit(UART_HandleTypeDef *huart)
/* UART MSP De-Initialization This function freeze the hardware resources used in this example. */ void HAL_UART_MspDeInit(UART_HandleTypeDef *huart)
{ if(huart->Instance==UART4) { __HAL_RCC_UART4_CLK_DISABLE(); HAL_GPIO_DeInit(GPIOC, GPIO_PIN_10|GPIO_PIN_11); } else if(huart->Instance==USART1) { __HAL_RCC_USART1_CLK_DISABLE(); HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10); } else if(huart->Instance==USART2) { __HAL_RCC_USART2_CLK_DISABLE(); HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3); } else if(huart->Instance==USART3) { __HAL_RCC_USART3_CLK_DISABLE(); HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10|GPIO_PIN_11); } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Checks RTC peripheral is enabled for programming to its registers */
bool XMC_RTC_IsEnabled(void)
/* Checks RTC peripheral is enabled for programming to its registers */ bool XMC_RTC_IsEnabled(void)
{ return !XMC_SCU_CLOCK_IsPeripheralClockGated(XMC_SCU_PERIPHERAL_CLOCK_RTC); }
remotemcu/remcu-chip-sdks
C++
null
436
/* Configures the ADCx external trigger for injected channels conversion. */
void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef *ADCx, uint32_t ADC_ExternalTrigInjecConv)
/* Configures the ADCx external trigger for injected channels conversion. */ void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef *ADCx, uint32_t ADC_ExternalTrigInjecConv)
{ uint32_t tmpreg = 0; assert_param(IS_ADC_ALL_PERIPH(ADCx)); assert_param(IS_ADC_EXT_INJEC_TRIG(ADC_ExternalTrigInjecConv)); tmpreg = ADCx->CR2; tmpreg &= (uint32_t) (~ADC_CR2_JEXTSEL); tmpreg |= ADC_ExternalTrigInjecConv; ADCx->CR2 = tmpreg; }
avem-labs/Avem
C++
MIT License
1,752
/* Set custom decoder functions. See the typdefs of the function typed above for more info about them */
void lv_img_decoder_set_custom(lv_img_decoder_info_f_t info_fp, lv_img_decoder_open_f_t open_fp, lv_img_decoder_read_line_f_t read_fp, lv_img_decoder_close_f_t close_fp)
/* Set custom decoder functions. See the typdefs of the function typed above for more info about them */ void lv_img_decoder_set_custom(lv_img_decoder_info_f_t info_fp, lv_img_decoder_open_f_t open_fp, lv_img_decoder_read_line_f_t read_fp, lv_img_decoder_close_f_t close_fp)
{ lv_img_decoder_info_custom = info_fp; lv_img_decoder_open_custom = open_fp; lv_img_decoder_read_line_custom = read_fp; lv_img_decoder_close_custom = close_fp; }
RavenSystem/esp-homekit-devices
C++
Other
2,577
/* Reverse the stack segment from 'from' to 'to' (auxiliary to 'lua_rotate') */
static void reverse(lua_State *L, StkId from, StkId to)
/* Reverse the stack segment from 'from' to 'to' (auxiliary to 'lua_rotate') */ static void reverse(lua_State *L, StkId from, StkId to)
{ TValue temp; setobj(L, &temp, from); setobjs2s(L, from, to); setobj2s(L, to, &temp); } }
nodemcu/nodemcu-firmware
C++
MIT License
7,566
/* We fire the reap timer every group expiry interval so we always have a reaper ready to run. This makes shutdown and flushing of the reaper easy to do. Hence we need to keep when the next reap must occur so we can determine at each interval whether there is anything we need to do. */
STATIC void _xfs_mru_cache_reap(struct work_struct *work)
/* We fire the reap timer every group expiry interval so we always have a reaper ready to run. This makes shutdown and flushing of the reaper easy to do. Hence we need to keep when the next reap must occur so we can determine at each interval whether there is anything we need to do. */ STATIC void _xfs_mru_cache_reap(struct work_struct *work)
{ xfs_mru_cache_t *mru = container_of(work, xfs_mru_cache_t, work.work); unsigned long now, next; ASSERT(mru && mru->lists); if (!mru || !mru->lists) return; spin_lock(&mru->lock); next = _xfs_mru_cache_migrate(mru, jiffies); _xfs_mru_cache_clear_reap_list(mru); mru->queued = next; if ((mru->queued > 0)) { now = jiffies; if (next <= now) next = 0; else next -= now; queue_delayed_work(xfs_mru_reap_wq, &mru->work, next); } spin_unlock(&mru->lock); }
robutest/uclinux
C++
GPL-2.0
60
/* @data: String to parse. @is_not: True if it is "no_keep_domain" entry. @is_delete: True if it is a delete request. */
int tomoyo_write_domain_keeper_policy(char *data, const bool is_not, const bool is_delete)
/* @data: String to parse. @is_not: True if it is "no_keep_domain" entry. @is_delete: True if it is a delete request. */ int tomoyo_write_domain_keeper_policy(char *data, const bool is_not, const bool is_delete)
{ char *cp = strstr(data, " from "); if (cp) { *cp = '\0'; return tomoyo_update_domain_keeper_entry(cp + 6, data, is_not, is_delete); } return tomoyo_update_domain_keeper_entry(data, NULL, is_not, is_delete); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Read the size of the whitelist. This is the total number of whitelist entries allowed by the controller. */
int ble_ll_whitelist_read_size(uint8_t *rspbuf, uint8_t *rsplen)
/* Read the size of the whitelist. This is the total number of whitelist entries allowed by the controller. */ int ble_ll_whitelist_read_size(uint8_t *rspbuf, uint8_t *rsplen)
{ struct ble_hci_le_rd_white_list_rp *rsp = (void *) rspbuf; rsp->size = BLE_LL_WHITELIST_SIZE; *rsplen = sizeof(*rsp); return BLE_ERR_SUCCESS; }
arendst/Tasmota
C++
GNU General Public License v3.0
21,318
/* Get EC point affine (x,y) coordinates. This function will set the provided Big Number objects to the corresponding values. The caller needs to make sure all the "out" BigNumber parameters are properly initialized. */
BOOLEAN EFIAPI EcPointGetAffineCoordinates(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint, OUT VOID *BnX, OUT VOID *BnY, IN VOID *BnCtx)
/* Get EC point affine (x,y) coordinates. This function will set the provided Big Number objects to the corresponding values. The caller needs to make sure all the "out" BigNumber parameters are properly initialized. */ BOOLEAN EFIAPI EcPointGetAffineCoordinates(IN CONST VOID *EcGroup, IN CONST VOID *EcPoint, OUT VOID *BnX, OUT VOID *BnY, IN VOID *BnCtx)
{ CALL_CRYPTO_SERVICE (EcPointGetAffineCoordinates, (EcGroup, EcPoint, BnX, BnY, BnCtx), FALSE); }
tianocore/edk2
C++
Other
4,240
/* This file is part of the Simba project. */
int mock_write_esp_wifi_module_init(int res)
/* This file is part of the Simba project. */ int mock_write_esp_wifi_module_init(int res)
{ harness_mock_write("esp_wifi_module_init()", NULL, 0); harness_mock_write("esp_wifi_module_init(): return (res)", &res, sizeof(res)); return (0); }
eerimoq/simba
C++
Other
337
/* Loads and relocates a PE/COFF image in place. */
EFI_STATUS LoadAndRelocatePeCoffImageInPlace(IN VOID *Pe32Data, IN VOID *ImageAddress)
/* Loads and relocates a PE/COFF image in place. */ EFI_STATUS LoadAndRelocatePeCoffImageInPlace(IN VOID *Pe32Data, IN VOID *ImageAddress)
{ EFI_STATUS Status; PE_COFF_LOADER_IMAGE_CONTEXT ImageContext; ZeroMem (&ImageContext, sizeof (ImageContext)); ImageContext.Handle = Pe32Data; ImageContext.ImageRead = PeiImageRead; Status = PeCoffLoaderGetImageInfo (&ImageContext); if (EFI_ERROR (Status)) { ASSERT_EFI_ERROR (Status); return Status; } ImageContext.ImageAddress = (PHYSICAL_ADDRESS)(UINTN)ImageAddress; Status = PeCoffLoaderLoadImage (&ImageContext); if (EFI_ERROR (Status)) { ASSERT_EFI_ERROR (Status); return Status; } Status = PeCoffLoaderRelocateImage (&ImageContext); if (EFI_ERROR (Status)) { ASSERT_EFI_ERROR (Status); return Status; } if (ImageContext.ImageAddress != (EFI_PHYSICAL_ADDRESS)(UINTN)Pe32Data) { InvalidateInstructionCacheRange ((VOID *)(UINTN)ImageContext.ImageAddress, (UINTN)ImageContext.ImageSize); } return Status; }
tianocore/edk2
C++
Other
4,240
/* Max AMPDU length = (2 ^ (13 + exponent)) - 1 bytes */
static __u32 compute_ampdu_length(__u8 exponent)
/* Max AMPDU length = (2 ^ (13 + exponent)) - 1 bytes */ static __u32 compute_ampdu_length(__u8 exponent)
{ switch (exponent) { case 0: return 8191; case 1: return 16383; case 2: return 32767; case 3: return 65535; default: return 0; } }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* HPF or SLOPE filter selection on wake-up and Activity/Inactivity functions.. */
int32_t lsm6dso_xl_hp_path_internal_get(lsm6dso_ctx_t *ctx, lsm6dso_slope_fds_t *val)
/* HPF or SLOPE filter selection on wake-up and Activity/Inactivity functions.. */ int32_t lsm6dso_xl_hp_path_internal_get(lsm6dso_ctx_t *ctx, lsm6dso_slope_fds_t *val)
{ lsm6dso_tap_cfg0_t reg; int32_t ret; ret = lsm6dso_read_reg(ctx, LSM6DSO_TAP_CFG0, (uint8_t*)&reg, 1); switch (reg.slope_fds) { case LSM6DSO_USE_SLOPE: *val = LSM6DSO_USE_SLOPE; break; case LSM6DSO_USE_HPF: *val = LSM6DSO_USE_HPF; break; default: *val = LSM6DSO_USE_SLOPE; break; } return ret; }
alexander-g-dean/ESF
C++
null
41
/* The current transformation matrix of a #cairo_t, represented as a #cairo_matrix_t, defines the transformation from user-space coordinates to device-space coordinates. See cairo_get_matrix() and cairo_set_matrix(). */
static void _cairo_matrix_scalar_multiply(cairo_matrix_t *matrix, double scalar)
/* The current transformation matrix of a #cairo_t, represented as a #cairo_matrix_t, defines the transformation from user-space coordinates to device-space coordinates. See cairo_get_matrix() and cairo_set_matrix(). */ static void _cairo_matrix_scalar_multiply(cairo_matrix_t *matrix, double scalar)
{ matrix->xx *= scalar; matrix->yx *= scalar; matrix->xy *= scalar; matrix->yy *= scalar; matrix->x0 *= scalar; matrix->y0 *= scalar; }
xboot/xboot
C++
MIT License
779
/* According to the ACPI spec this should be called after _STM has been evaluated for the interface. Some ACPI vendors interpret that as a hard requirement and modify the taskfile according to the Identify Drive information passed down with _STM. So one should really make sure to call this only after _STM has been executed. */
int ide_acpi_exec_tfs(ide_drive_t *drive)
/* According to the ACPI spec this should be called after _STM has been evaluated for the interface. Some ACPI vendors interpret that as a hard requirement and modify the taskfile according to the Identify Drive information passed down with _STM. So one should really make sure to call this only after _STM has been executed. */ int ide_acpi_exec_tfs(ide_drive_t *drive)
{ int ret; unsigned int gtf_length; unsigned long gtf_address; unsigned long obj_loc; DEBPRINT("call get_GTF, drive=%s port=%d\n", drive->name, drive->dn); ret = do_drive_get_GTF(drive, &gtf_length, &gtf_address, &obj_loc); if (ret < 0) { DEBPRINT("get_GTF error (%d)\n", ret); return ret; } DEBPRINT("call set_taskfiles, drive=%s\n", drive->name); ret = do_drive_set_taskfiles(drive, gtf_length, gtf_address); kfree((void *)obj_loc); if (ret < 0) { DEBPRINT("set_taskfiles error (%d)\n", ret); } DEBPRINT("ret=%d\n", ret); return ret; }
robutest/uclinux
C++
GPL-2.0
60
/* Returns: the contents of the @attribute value as a UTF-8 string, or NULL otherwise. */
const char* g_file_info_get_attribute_string(GFileInfo *info, const char *attribute)
/* Returns: the contents of the @attribute value as a UTF-8 string, or NULL otherwise. */ const char* g_file_info_get_attribute_string(GFileInfo *info, const char *attribute)
{ GFileAttributeValue *value; g_return_val_if_fail (G_IS_FILE_INFO (info), NULL); g_return_val_if_fail (attribute != NULL && *attribute != '\0', NULL); value = g_file_info_find_value_by_name (info, attribute); return _g_file_attribute_value_get_string (value); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Should allocate a pbuf and transfer the bytes of the incoming packet from the interface into the pbuf. */
static struct pbuf* low_level_input(struct netif *netif)
/* Should allocate a pbuf and transfer the bytes of the incoming packet from the interface into the pbuf. */ static struct pbuf* low_level_input(struct netif *netif)
{ struct xemac_s *xemac = (struct xemac_s *)(netif->state); xemacpsif_s *xemacpsif = (xemacpsif_s *)(xemac->state); struct pbuf *p; if (pq_qlength(xemacpsif->recv_q) == 0) return NULL; p = (struct pbuf *)pq_dequeue(xemacpsif->recv_q); return p; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Reads and returns the current IDTR descriptor and returns it in Idtr. This function is only available on IA-32 and x64. */
VOID EFIAPI InternalX86ReadIdtr(OUT IA32_DESCRIPTOR *Idtr)
/* Reads and returns the current IDTR descriptor and returns it in Idtr. This function is only available on IA-32 and x64. */ VOID EFIAPI InternalX86ReadIdtr(OUT IA32_DESCRIPTOR *Idtr)
{ _asm { mov eax, Idtr sidt fword ptr [eax] } }
tianocore/edk2
C++
Other
4,240
/* Enables or disables the MAC BackPressure operation activation (Half-duplex only). */
void ETH_EnableBackPressureActivation(FunctionalState Cmd)
/* Enables or disables the MAC BackPressure operation activation (Half-duplex only). */ void ETH_EnableBackPressureActivation(FunctionalState Cmd)
{ assert_param(IS_FUNCTIONAL_STATE(Cmd)); if (Cmd != DISABLE) { ETH->MACFLWCTRL |= ETH_MACFLWCTRL_FCB_BPA; } else { ETH->MACFLWCTRL &= ~ETH_MACFLWCTRL_FCB_BPA; } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Message: ModifyConferenceResMessage Opcode: 0x0037 Type: IntraCCM Direction: pbx2pbx VarLength: no */
static void handle_ModifyConferenceResMessage(ptvcursor_t *cursor, packet_info *pinfo _U_)
/* Message: ModifyConferenceResMessage Opcode: 0x0037 Type: IntraCCM Direction: pbx2pbx VarLength: no */ static void handle_ModifyConferenceResMessage(ptvcursor_t *cursor, packet_info *pinfo _U_)
{ guint32 dataLength = 0; ptvcursor_add(cursor, hf_skinny_conferenceID, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_modify_conf_result, 4, ENC_LITTLE_ENDIAN); dataLength = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); ptvcursor_add(cursor, hf_skinny_dataLength, 4, ENC_LITTLE_ENDIAN); ptvcursor_add(cursor, hf_skinny_passThruData, dataLength, ENC_ASCII|ENC_NA); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Here we set accurate tv format according to connector type i.e Component TV should not be assigned by NTSC or PAL */
static void intel_tv_find_better_format(struct drm_connector *connector)
/* Here we set accurate tv format according to connector type i.e Component TV should not be assigned by NTSC or PAL */ static void intel_tv_find_better_format(struct drm_connector *connector)
{ struct intel_output *intel_output = to_intel_output(connector); struct intel_tv_priv *tv_priv = intel_output->dev_priv; const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output); int i; if ((tv_priv->type == DRM_MODE_CONNECTOR_Component) == tv_mode->component_only) return; for (i = 0; i < sizeof(tv_modes) / sizeof(*tv_modes); i++) { tv_mode = tv_modes + i; if ((tv_priv->type == DRM_MODE_CONNECTOR_Component) == tv_mode->component_only) break; } tv_priv->tv_format = tv_mode->name; drm_connector_property_set_value(connector, connector->dev->mode_config.tv_mode_property, i); }
robutest/uclinux
C++
GPL-2.0
60
/* This is the code that gets called on processor reset. To initialize the device, and call the main() routine. */
void Reset_Handler(void)
/* This is the code that gets called on processor reset. To initialize the device, and call the main() routine. */ void Reset_Handler(void)
{ uint32_t *pSrc, *pDest; pSrc = &_etext; pDest = &_srelocate; if (pSrc != pDest) { for (; pDest < &_erelocate;) { *pDest++ = *pSrc++; } } for (pDest = &_szero; pDest < &_ezero;) { *pDest++ = 0; } pSrc = (uint32_t *) & _sfixed; SCB->VTOR = ((uint32_t) pSrc & SCB_VTOR_TBLOFF_Msk); __libc_init_array(); main(); while (1); }
remotemcu/remcu-chip-sdks
C++
null
436
/* Checks for error conditions for R2 (CID or CSD) response. */
static SD_Error CmdResp2Error(void)
/* Checks for error conditions for R2 (CID or CSD) response. */ static SD_Error CmdResp2Error(void)
{ SD_Error errorstatus = SD_OK; uint32_t status; status = SDIO->STA; while (!(status & (SDIO_FLAG_CCRCFAIL | SDIO_FLAG_CTIMEOUT | SDIO_FLAG_CMDREND))) { status = SDIO->STA; } if (status & SDIO_FLAG_CTIMEOUT) { errorstatus = SD_CMD_RSP_TIMEOUT; SDIO_ClearFlag(SDIO_FLAG_CTIMEOUT); return(errorstatus); } else if (status & SDIO_FLAG_CCRCFAIL) { errorstatus = SD_CMD_CRC_FAIL; SDIO_ClearFlag(SDIO_FLAG_CCRCFAIL); return(errorstatus); } SDIO_ClearFlag(SDIO_STATIC_FLAGS); return(errorstatus); }
avem-labs/Avem
C++
MIT License
1,752
/* The RT-CORBA priority is a CDR encoded short value in a sequence<octet> buffer. */
static void decode_RTCorbaPriority(tvbuff_t *tvb, proto_tree *tree, int *offset, gboolean stream_is_be, guint32 boundary)
/* The RT-CORBA priority is a CDR encoded short value in a sequence<octet> buffer. */ static void decode_RTCorbaPriority(tvbuff_t *tvb, proto_tree *tree, int *offset, gboolean stream_is_be, guint32 boundary)
{ gint16 rtpriority; rtpriority = get_CDR_short(tvb, offset, stream_is_be, -((gint32) boundary) ); proto_tree_add_uint(tree, hf_giop_rt_corba_priority, tvb, *offset - 2, 2, rtpriority); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Write value to pma{i}cfg entry which are packed into CSRs pmacfg{j} */
static void write_pmacfg_entry(const uint32_t entry_index, uint8_t entry_value)
/* Write value to pma{i}cfg entry which are packed into CSRs pmacfg{j} */ static void write_pmacfg_entry(const uint32_t entry_index, uint8_t entry_value)
{ uint32_t index = PMACFG_NUM(entry_index); uint8_t shift = PMACFG_SHIFT(entry_index); unsigned long pmacfg = 0; #define SWITCH_CASE_PMACFG_READ(x) \ case (x): \ pmacfg = csr_read(NDS_PMACFG##x); break; switch (index) { FOR_EACH(SWITCH_CASE_PMACFG_READ, (;), 0, 1, 2, 3); } pmacfg &= ~(0xFF << shift); pmacfg |= entry_value << shift; #define SWITCH_CASE_PMACFG_WRITE(x) \ case (x): \ csr_write(NDS_PMACFG##x, pmacfg); break; switch (index) { FOR_EACH(SWITCH_CASE_PMACFG_WRITE, (;), 0, 1, 2, 3); } }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* This function, called very early during the creation of a new process VM image, sets up which VM layout function to use: */
void arch_pick_mmap_layout(struct mm_struct *mm)
/* This function, called very early during the creation of a new process VM image, sets up which VM layout function to use: */ void arch_pick_mmap_layout(struct mm_struct *mm)
{ if (mmap_is_legacy()) { mm->mmap_base = TASK_UNMAPPED_BASE; mm->get_unmapped_area = arch_get_unmapped_area; mm->unmap_area = arch_unmap_area; } else { mm->mmap_base = mmap_base(); mm->get_unmapped_area = arch_get_unmapped_area_topdown; mm->unmap_area = arch_unmap_area_topdown; } }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Locking: The routine gets called under an irqsave() spinlock; and the routine locks the struct hvc_iucv_private->lock to call helper functions. */
static int hvc_iucv_get_chars(uint32_t vtermno, char *buf, int count)
/* Locking: The routine gets called under an irqsave() spinlock; and the routine locks the struct hvc_iucv_private->lock to call helper functions. */ static int hvc_iucv_get_chars(uint32_t vtermno, char *buf, int count)
{ struct hvc_iucv_private *priv = hvc_iucv_get_private(vtermno); int written; int has_more_data; if (count <= 0) return 0; if (!priv) return -ENODEV; spin_lock(&priv->lock); has_more_data = 0; written = hvc_iucv_write(priv, buf, count, &has_more_data); spin_unlock(&priv->lock); if (has_more_data) hvc_kick(); return written; }
robutest/uclinux
C++
GPL-2.0
60
/* This file is part of the Simba project. */
static int test_aton(void)
/* This file is part of the Simba project. */ static int test_aton(void)
{ const char src[] = "1.2.3.4"; const char bad_src_1[] = "1.2.g.4"; const char bad_src_2[] = "1.2.3."; struct inet_ip_addr_t dst; BTASSERT(inet_aton(src, &dst) == 0); BTASSERT(dst.number == htonl(0x01020304)); BTASSERT(inet_aton(bad_src_1, &dst) == -EINVAL); BTASSERT(inet_aton(bad_src_2, &dst) == -EINVAL); return (0); }
eerimoq/simba
C++
Other
337
/* Returns: An unsigned int, representing the state of type registrations */
guint g_type_get_type_registration_serial(void)
/* Returns: An unsigned int, representing the state of type registrations */ guint g_type_get_type_registration_serial(void)
{ return (guint)g_atomic_int_get ((gint *)&type_registration_serial); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Get Max Option Rom size on specified bridge. */
UINT32 GetMaxOptionRomSize(IN PCI_IO_DEVICE *Bridge)
/* Get Max Option Rom size on specified bridge. */ UINT32 GetMaxOptionRomSize(IN PCI_IO_DEVICE *Bridge)
{ LIST_ENTRY *CurrentLink; PCI_IO_DEVICE *Temp; UINT32 MaxOptionRomSize; UINT32 TempOptionRomSize; MaxOptionRomSize = 0; CurrentLink = Bridge->ChildList.ForwardLink; while (CurrentLink != NULL && CurrentLink != &Bridge->ChildList) { Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink); if (!IsListEmpty (&Temp->ChildList)) { TempOptionRomSize = GetMaxOptionRomSize (Temp); if (Temp->RomSize > TempOptionRomSize) { TempOptionRomSize = Temp->RomSize; } } else { TempOptionRomSize = Temp->RomSize; } if (TempOptionRomSize > MaxOptionRomSize) { MaxOptionRomSize = TempOptionRomSize; } CurrentLink = CurrentLink->ForwardLink; } return MaxOptionRomSize; }
tianocore/edk2
C++
Other
4,240
/* Group delete callback function when polling the block. */
static int32_t __item_del_by_prefix_cb(kv_item_t *item, const char *prefix)
/* Group delete callback function when polling the block. */ static int32_t __item_del_by_prefix_cb(kv_item_t *item, const char *prefix)
{ char *key = NULL; if (prefix != NULL && item->hdr.key_len < strlen(prefix)) { return KV_LOOP_CONTINUE; } key = (char *)kv_malloc(item->hdr.key_len + 1); if (!key) { return KV_ERR_MALLOC_FAILED; } memset(key, 0, item->hdr.key_len + 1); kv_flash_read(item->pos + KV_ITEM_HDR_SIZE, key, item->hdr.key_len); if (prefix == NULL || strncmp(key, prefix, strlen(prefix)) == 0) { kv_item_del(item, KV_DELETE_FLAG); } kv_free(key); return KV_LOOP_CONTINUE; }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* Description: Remove all entries from the network address table. */
static void sel_netnode_flush(void)
/* Description: Remove all entries from the network address table. */ static void sel_netnode_flush(void)
{ unsigned int idx; struct sel_netnode *node, *node_tmp; spin_lock_bh(&sel_netnode_lock); for (idx = 0; idx < SEL_NETNODE_HASH_SIZE; idx++) { list_for_each_entry_safe(node, node_tmp, &sel_netnode_hash[idx].list, list) { list_del_rcu(&node->list); call_rcu(&node->rcu, sel_netnode_free); } sel_netnode_hash[idx].size = 0; } spin_unlock_bh(&sel_netnode_lock); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Get index of free list having blocks of size greater than or equal to requested size. */
static u32 get_index(u32 size)
/* Get index of free list having blocks of size greater than or equal to requested size. */ static u32 get_index(u32 size)
{ if (unlikely(size < XV_MIN_ALLOC_SIZE)) size = XV_MIN_ALLOC_SIZE; size = ALIGN(size, FL_DELTA); return (size - XV_MIN_ALLOC_SIZE) >> FL_DELTA_SHIFT; }
robutest/uclinux
C++
GPL-2.0
60
/* Deliver the received packet for the instances belonging to the MnpServiceData. */
VOID MnpDeliverPacket(IN MNP_SERVICE_DATA *MnpServiceData)
/* Deliver the received packet for the instances belonging to the MnpServiceData. */ VOID MnpDeliverPacket(IN MNP_SERVICE_DATA *MnpServiceData)
{ LIST_ENTRY *Entry; MNP_INSTANCE_DATA *Instance; NET_CHECK_SIGNATURE (MnpServiceData, MNP_SERVICE_DATA_SIGNATURE); NET_LIST_FOR_EACH (Entry, &MnpServiceData->ChildrenList) { Instance = NET_LIST_USER_STRUCT (Entry, MNP_INSTANCE_DATA, InstEntry); NET_CHECK_SIGNATURE (Instance, MNP_INSTANCE_DATA_SIGNATURE); MnpInstanceDeliverPacket (Instance); } }
tianocore/edk2
C++
Other
4,240
/* See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method. */
void _g_freedesktop_dbus_call_hello(_GFreedesktopDBus *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
/* See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method. */ void _g_freedesktop_dbus_call_hello(_GFreedesktopDBus *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
{ g_dbus_proxy_call (G_DBUS_PROXY (proxy), "Hello", g_variant_new ("()"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, callback, user_data); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Return the next object in the object_list. The function decrements the use_count of the previous object and increases that of the next one. */
static void* kmemleak_seq_next(struct seq_file *seq, void *v, loff_t *pos)
/* Return the next object in the object_list. The function decrements the use_count of the previous object and increases that of the next one. */ static void* kmemleak_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{ struct kmemleak_object *prev_obj = v; struct kmemleak_object *next_obj = NULL; struct list_head *n = &prev_obj->object_list; ++(*pos); list_for_each_continue_rcu(n, &object_list) { next_obj = list_entry(n, struct kmemleak_object, object_list); if (get_object(next_obj)) break; } put_object(prev_obj); return next_obj; }
robutest/uclinux
C++
GPL-2.0
60
/* Before rebooting, we must make sure that the expansion card is in a sensible state, so it can be re-detected. This means that the first page of the ROM must be visible. We call the expansion cards reset handler, if any. */
static void ecard_drv_shutdown(struct device *dev)
/* Before rebooting, we must make sure that the expansion card is in a sensible state, so it can be re-detected. This means that the first page of the ROM must be visible. We call the expansion cards reset handler, if any. */ static void ecard_drv_shutdown(struct device *dev)
{ struct expansion_card *ec = ECARD_DEV(dev); struct ecard_driver *drv = ECARD_DRV(dev->driver); struct ecard_request req; if (dev->driver) { if (drv->shutdown) drv->shutdown(ec); ec->claimed = 0; } if (ec->loader) { req.fn = ecard_task_reset; req.ec = ec; ecard_call(&req); } }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Rebooting also tells the Host we're finished, but the RESTART flag tells the Launcher to reboot us. */
static void lguest_restart(char *reason)
/* Rebooting also tells the Host we're finished, but the RESTART flag tells the Launcher to reboot us. */ static void lguest_restart(char *reason)
{ kvm_hypercall2(LHCALL_SHUTDOWN, __pa(reason), LGUEST_SHUTDOWN_RESTART); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Enables or disables the I2C nbytes reload mode. */
void I2C_ReloadCmd(I2C_TypeDef *I2Cx, FunctionalState NewState)
/* Enables or disables the I2C nbytes reload mode. */ void I2C_ReloadCmd(I2C_TypeDef *I2Cx, FunctionalState NewState)
{ assert_param(IS_I2C_ALL_PERIPH(I2Cx)); assert_param(IS_FUNCTIONAL_STATE(NewState)); if (NewState != DISABLE) { I2Cx->CR2 |= I2C_CR2_RELOAD; } else { I2Cx->CR2 &= (uint32_t)~((uint32_t)I2C_CR2_RELOAD); } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* RTT configuration function. Configures the RTT to generate a one second tick, which triggers the RTT alarms interrupt. */
static void gpbr_test_configure_rtt(void)
/* RTT configuration function. Configures the RTT to generate a one second tick, which triggers the RTT alarms interrupt. */ static void gpbr_test_configure_rtt(void)
{ uint32_t ul_previous_time; rtt_init(RTT, 32768); ul_previous_time = rtt_read_timer_value(RTT); while (ul_previous_time == rtt_read_timer_value(RTT)); NVIC_DisableIRQ(RTT_IRQn); NVIC_ClearPendingIRQ(RTT_IRQn); NVIC_SetPriority(RTT_IRQn, 0); NVIC_EnableIRQ(RTT_IRQn); rtt_enable_interrupt(RTT, RTT_MR_ALMIEN); }
remotemcu/remcu-chip-sdks
C++
null
436
/* Convert a string into an NT UNICODE string. Note that regardless of processor type this must be in intel (little-endian) format. */
static int _my_mbstowcs(__u16 *dst, const unsigned char *src, int len)
/* Convert a string into an NT UNICODE string. Note that regardless of processor type this must be in intel (little-endian) format. */ static int _my_mbstowcs(__u16 *dst, const unsigned char *src, int len)
{ int i; __u16 val; for (i = 0; i < len; i++) { val = *src; SSVAL(dst, 0, val); dst++; src++; if (val == 0) break; } return i; }
robutest/uclinux
C++
GPL-2.0
60
/* Push a formatted message referring to the currently-selected field onto the statusbar. */
void statusbar_push_field_msg(const gchar *msg_format,...)
/* Push a formatted message referring to the currently-selected field onto the statusbar. */ void statusbar_push_field_msg(const gchar *msg_format,...)
{ va_list ap; gchar *msg; if (higher_priority_status_level(STATUS_LEVEL_HELP)) return; status_levels[STATUS_LEVEL_HELP]++; va_start(ap, msg_format); msg = g_strdup_vprintf(msg_format, ap); va_end(ap); gtk_statusbar_push(GTK_STATUSBAR(info_bar), help_ctx, msg); g_free(msg); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. */
VOID* EFIAPI AllocatePages(IN UINTN Pages)
/* Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. */ VOID* EFIAPI AllocatePages(IN UINTN Pages)
{ VOID *Buffer; Buffer = InternalAllocatePages (EfiBootServicesData, Pages); if (Buffer != NULL) { MemoryProfileLibRecord ( (PHYSICAL_ADDRESS)(UINTN)RETURN_ADDRESS (0), MEMORY_PROFILE_ACTION_LIB_ALLOCATE_PAGES, EfiBootServicesData, Buffer, EFI_PAGES_TO_SIZE (Pages), NULL ); } return Buffer; }
tianocore/edk2
C++
Other
4,240
/* Enables the automatic hardware adjustement of HSI48TRM bits. */
void CRS_EnableAutomaticCalibration(void)
/* Enables the automatic hardware adjustement of HSI48TRM bits. */ void CRS_EnableAutomaticCalibration(void)
{ CRS->CTRL_B.AUTOTRMEN = SET; }
pikasTech/PikaPython
C++
MIT License
1,403
/* This function retrieves the user readable name of a driver in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the driver name is returned in DriverName, and EFI_SUCCESS is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned. */
EFI_STATUS EFIAPI UsbKeyboardComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
/* This function retrieves the user readable name of a driver in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the driver name is returned in DriverName, and EFI_SUCCESS is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned. */ EFI_STATUS EFIAPI UsbKeyboardComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
{ return LookupUnicodeString2 ( Language, This->SupportedLanguages, mUsbKeyboardDriverNameTable, DriverName, (BOOLEAN)(This == &gUsbKeyboardComponentName) ); }
tianocore/edk2
C++
Other
4,240
/* This function returns %0 on success and a negative error code on failure. */
static int make_pnode_dirty(struct ubifs_info *c, int node_num, int lnum, int offs)
/* This function returns %0 on success and a negative error code on failure. */ static int make_pnode_dirty(struct ubifs_info *c, int node_num, int lnum, int offs)
{ struct ubifs_pnode *pnode; struct ubifs_nbranch *branch; pnode = pnode_lookup(c, node_num); if (IS_ERR(pnode)) return PTR_ERR(pnode); branch = &pnode->parent->nbranch[pnode->iip]; if (branch->lnum != lnum || branch->offs != offs) return 0; do_make_pnode_dirty(c, pnode); return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Call to resume any I/O requests waiting for room in request queue. */
static void bfa_ioim_qresume(void *cbarg)
/* Call to resume any I/O requests waiting for room in request queue. */ static void bfa_ioim_qresume(void *cbarg)
{ struct bfa_ioim_s *ioim = cbarg; bfa_fcpim_stats(ioim->fcpim, qresumes); bfa_sm_send_event(ioim, BFA_IOIM_SM_QRESUME); }
robutest/uclinux
C++
GPL-2.0
60
/* Note: Division is quite slow on CRIS and do_gettimeofday is called rather often. Maybe we should do some kind of approximation here (a naive approximation would be to divide by 1024). */
void do_gettimeofday(struct timeval *tv)
/* Note: Division is quite slow on CRIS and do_gettimeofday is called rather often. Maybe we should do some kind of approximation here (a naive approximation would be to divide by 1024). */ void do_gettimeofday(struct timeval *tv)
{ unsigned long flags; signed long usec, sec; local_irq_save(flags); usec = do_gettimeoffset(); if (unlikely(time_adjust < 0) && usec > tickadj) usec = tickadj; sec = xtime.tv_sec; usec += xtime.tv_nsec / 1000; local_irq_restore(flags); while (usec >= 1000000) { usec -= 1000000; sec++; } tv->tv_sec = sec; tv->tv_usec = usec; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Published API functions. NOTE, "local" API functions only valid from the packet-opsi file. */
static void decode_string_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, int *hfValue, int offset, int length)
/* Published API functions. NOTE, "local" API functions only valid from the packet-opsi file. */ static void decode_string_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, int *hfValue, int offset, int length)
{ if (length < 4) { expert_add_info(pinfo, item, &ei_opsi_short_attribute); return; } proto_tree_add_item(tree, *hfValue, tvb, offset+4, length-4, ENC_ASCII|ENC_NA); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* cr_doc_handler_associate_a_parser: Associates a parser to the current document handler @a_this: the current instance of document handler. @a_parser: the parser to associate. */
void cr_doc_handler_associate_a_parser(CRDocHandler *a_this, gpointer a_parser)
/* cr_doc_handler_associate_a_parser: Associates a parser to the current document handler @a_this: the current instance of document handler. @a_parser: the parser to associate. */ void cr_doc_handler_associate_a_parser(CRDocHandler *a_this, gpointer a_parser)
{ g_return_if_fail (a_this && PRIVATE (a_this) && a_parser) ; PRIVATE (a_this)->parser = a_parser ; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Use an index to get a CRStatement from the rules in a given stylesheet. */
CRStatement* cr_stylesheet_statement_get_from_list(CRStyleSheet *a_this, int itemnr)
/* Use an index to get a CRStatement from the rules in a given stylesheet. */ CRStatement* cr_stylesheet_statement_get_from_list(CRStyleSheet *a_this, int itemnr)
{ g_return_val_if_fail (a_this, NULL); return cr_statement_get_from_list (a_this->statements, itemnr); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* simple_strtoul - convert a string to an unsigned long @cp: The start of the string @endp: A pointer to the end of the parsed string will be placed here @base: The number base to use */
unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base)
/* simple_strtoul - convert a string to an unsigned long @cp: The start of the string @endp: A pointer to the end of the parsed string will be placed here @base: The number base to use */ unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base)
{ return simple_strtoull(cp, endp, base); }
robutest/uclinux
C++
GPL-2.0
60
/* This implements the X/Open SMB password encryption It takes a password, a 8 byte "crypt key" and puts 24 bytes of encrypted password into p24 */
void SMBencrypt(unsigned char *passwd, const unsigned char *c8, unsigned char *p24)
/* This implements the X/Open SMB password encryption It takes a password, a 8 byte "crypt key" and puts 24 bytes of encrypted password into p24 */ void SMBencrypt(unsigned char *passwd, const unsigned char *c8, unsigned char *p24)
{ unsigned char p14[15], p21[21]; memset(p21, '\0', 21); memset(p14, '\0', 14); strncpy((char *) p14, (char *) passwd, 14); E_P16(p14, p21); SMBOWFencrypt(p21, c8, p24); memset(p14, 0, 15); memset(p21, 0, 21); }
robutest/uclinux
C++
GPL-2.0
60
/* This helper routine makes bar mask from the type of resource. */
int pci_select_bars(struct pci_dev *dev, unsigned long flags)
/* This helper routine makes bar mask from the type of resource. */ int pci_select_bars(struct pci_dev *dev, unsigned long flags)
{ int i, bars = 0; for (i = 0; i < PCI_NUM_RESOURCES; i++) if (pci_resource_flags(dev, i) & flags) bars |= (1 << i); return bars; }
robutest/uclinux
C++
GPL-2.0
60
/* Clean any CPU cache that is related to the display. */
void lv_disp_clean_dcache(lv_disp_t *disp)
/* Clean any CPU cache that is related to the display. */ void lv_disp_clean_dcache(lv_disp_t *disp)
{ if(!disp) disp = lv_disp_get_default(); if(!disp) { LV_LOG_WARN("lv_disp_clean_dcache: no display registered"); return; } if(disp->driver->clean_dcache_cb) disp->driver->clean_dcache_cb(disp->driver); }
pikasTech/PikaPython
C++
MIT License
1,403
/* This function is used to config io function. */
void tls_io_cfg_set(enum tls_io_name name, u8 option)
/* This function is used to config io function. */ void tls_io_cfg_set(enum tls_io_name name, u8 option)
{ if (WM_IO_OPTION1 == option) io_cfg_option1(name); else if (WM_IO_OPTION2 == option) io_cfg_option2(name); else if (WM_IO_OPTION3 == option) io_cfg_option3(name); else if (WM_IO_OPTION4 == option) io_cfg_option4(name); else if (WM_IO_OPTION5 == option) io_cfg_option5(name); else if (WM_IO_OPTION6 == option) io_cfg_option6(name); else if (WM_IO_OPTION7 == option) io_cfg_option7(name); else TLS_DBGPRT_IO_ERR("invalid io option.\r\n"); }
Nicholas3388/LuaNode
C++
Other
1,055
/* Sets the CORE DPLL3 M2 divider to the same value that it's at currently. This has the effect of setting the SDRC SDRAM AC timing registers to the values currently defined by the kernel. Currently only defined for OMAP3; will return 0 if called on OMAP2. Returns -EINVAL if the dpll3_m2_ck cannot be found, 0 if called on OMAP2, or passes along the return value of clk_set_rate(). */
static int __init _omap2_init_reprogram_sdrc(void)
/* Sets the CORE DPLL3 M2 divider to the same value that it's at currently. This has the effect of setting the SDRC SDRAM AC timing registers to the values currently defined by the kernel. Currently only defined for OMAP3; will return 0 if called on OMAP2. Returns -EINVAL if the dpll3_m2_ck cannot be found, 0 if called on OMAP2, or passes along the return value of clk_set_rate(). */ static int __init _omap2_init_reprogram_sdrc(void)
{ struct clk *dpll3_m2_ck; int v = -EINVAL; long rate; if (!cpu_is_omap34xx()) return 0; dpll3_m2_ck = clk_get(NULL, "dpll3_m2_ck"); if (!dpll3_m2_ck) return -EINVAL; rate = clk_get_rate(dpll3_m2_ck); pr_info("Reprogramming SDRC clock to %ld Hz\n", rate); v = clk_set_rate(dpll3_m2_ck, rate); if (v) pr_err("dpll3_m2_clk rate change failed: %d\n", v); clk_put(dpll3_m2_ck); return v; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* This is the generic lockd callback for async RPC calls */
static void nlmsvc_callback_exit(struct rpc_task *task, void *data)
/* This is the generic lockd callback for async RPC calls */ static void nlmsvc_callback_exit(struct rpc_task *task, void *data)
{ dprintk("lockd: %5u callback returned %d\n", task->tk_pid, -task->tk_status); }
robutest/uclinux
C++
GPL-2.0
60
/* Load the key in memory depending on compile-time and user options. @Parameters private_key Load the key @Parameters length Load the key length @Returns result true or false */
bool ICACHE_FLASH_ATTR ssl_set_default_private_key(const uint8 *private_key, uint16 length)
/* Load the key in memory depending on compile-time and user options. @Parameters private_key Load the key @Parameters length Load the key length @Returns result true or false */ bool ICACHE_FLASH_ATTR ssl_set_default_private_key(const uint8 *private_key, uint16 length)
{ if (private_key == NULL) return false; def_private_key = (uint8*) zalloc(length); if (def_private_key == NULL) return false; memcpy(def_private_key, private_key, length); def_private_key_len = length; return true; }
eerimoq/simba
C++
Other
337
/* Config DMA source offset number under non-sequence mode. */
int32_t DMA_SetNonSeqSrcOffset(CM_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Offset)
/* Config DMA source offset number under non-sequence mode. */ int32_t DMA_SetNonSeqSrcOffset(CM_DMA_TypeDef *DMAx, uint8_t u8Ch, uint32_t u32Offset)
{ __IO uint32_t *SNSEQCTLx; DDL_ASSERT(IS_DMA_UNIT(DMAx)); DDL_ASSERT(IS_DMA_CH(u8Ch)); DDL_ASSERT(IS_DMA_NON_SEQ_OFFSET(u32Offset)); SNSEQCTLx = &DMA_CH_REG(DMAx->SNSEQCTL0, u8Ch); MODIFY_REG32(*SNSEQCTLx, DMA_SNSEQCTL_SOFFSET, u32Offset); return LL_OK; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Requests the bootloader to erase the specified range of memory on the target. The bootloader aligns this range to hardware specified erase blocks. */
bool SessionClearMemory(uint32_t address, uint32_t len)
/* Requests the bootloader to erase the specified range of memory on the target. The bootloader aligns this range to hardware specified erase blocks. */ bool SessionClearMemory(uint32_t address, uint32_t len)
{ bool result = false; assert(len > 0); if (len > 0) { result = protocolPtr->ClearMemory(address, len); } return result; }
feaser/openblt
C++
GNU General Public License v3.0
601
/* Reads the management control register for the config done bit to be set. */
static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
/* Reads the management control register for the config done bit to be set. */ static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw)
{ s32 timeout = PHY_CFG_TIMEOUT; while (timeout) { if (er32(EEMNGCTL) & E1000_NVM_CFG_DONE_PORT_0) break; msleep(1); timeout--; } if (!timeout) { e_dbg("MNG configuration cycle has not completed.\n"); return -E1000_ERR_RESET; } return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* retrieves the default Ingress tagging behavior of a port */
IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBIngressVlanTaggingEnabledGet(IxEthDBPortId portID, IxEthDBTaggingAction *taggingAction)
/* retrieves the default Ingress tagging behavior of a port */ IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBIngressVlanTaggingEnabledGet(IxEthDBPortId portID, IxEthDBTaggingAction *taggingAction)
{ IX_ETH_DB_CHECK_PORT(portID); IX_ETH_DB_CHECK_SINGLE_NPE(portID); IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_VLAN_QOS); IX_ETH_DB_CHECK_REFERENCE(taggingAction); *taggingAction = ixEthDBPortInfo[portID].taggingAction; return IX_ETH_DB_SUCCESS; }
EmcraftSystems/u-boot
C++
Other
181
/* HBN clear RTC timer interrupt,this function must be called to clear delayed rtc IRQ. */
BL_Err_Type HBN_Clear_RTC_INT(void)
/* HBN clear RTC timer interrupt,this function must be called to clear delayed rtc IRQ. */ BL_Err_Type HBN_Clear_RTC_INT(void)
{ uint32_t tmpVal; tmpVal = BL_RD_REG(HBN_BASE, HBN_CTL); BL_WR_REG(HBN_BASE, HBN_CTL, tmpVal & 0xfffffff1); return SUCCESS; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* This function configures the hardware to allow audio playback operations. It is called by ALSA framework. */
static int snd_mx1_mx2_prepare(struct snd_pcm_substream *substream)
/* This function configures the hardware to allow audio playback operations. It is called by ALSA framework. */ static int snd_mx1_mx2_prepare(struct snd_pcm_substream *substream)
{ struct snd_pcm_runtime *runtime = substream->runtime; struct mx1_mx2_runtime_data *prtd = runtime->private_data; prtd->period = 0; prtd->periods = 0; return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Extract all the interesting selectors for the interface in consideration */
static struct if_mapping* mapping_extract(int skfd, const char *ifname)
/* Extract all the interesting selectors for the interface in consideration */ static struct if_mapping* mapping_extract(int skfd, const char *ifname)
{ struct if_mapping * target; int i; target = calloc(1, sizeof(if_mapping)); if(!target) { fprintf(stderr, "Error: Can't allocate interface mapping.\n"); return(NULL); } strcpy(target->ifname, ifname); for(i = 0; i < SELECT_NUM; i++) { if(selector_active[i] != 0) { selector_list[i].get_fn(skfd, ifname, target, selector_active[i]); } } return(target); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Call the callback at the end of scsi INQUIRY command. */
static void uhi_msc_scsi_inquiry_done(bool b_cbw_succes)
/* Call the callback at the end of scsi INQUIRY command. */ static void uhi_msc_scsi_inquiry_done(bool b_cbw_succes)
{ if ((!b_cbw_succes) || uhi_msc_csw.dCSWDataResidue) { uhi_msc_scsi_callback(false); return; } uhi_msc_scsi_callback(true); }
remotemcu/remcu-chip-sdks
C++
null
436
/* 8a. Process the results of a credential refresh */
static void call_refreshresult(struct rpc_task *task)
/* 8a. Process the results of a credential refresh */ static void call_refreshresult(struct rpc_task *task)
{ int status = task->tk_status; dprint_status(task); task->tk_status = 0; task->tk_action = call_reserve; if (status >= 0 && rpcauth_uptodatecred(task)) return; if (status == -EACCES) { rpc_exit(task, -EACCES); return; } task->tk_action = call_refresh; if (status != -ETIMEDOUT) rpc_delay(task, 3*HZ); return; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Check whether 'de' has enough room to hold an entry of 'new_rec_len' bytes. */
static int ocfs2_dirent_would_fit(struct ocfs2_dir_entry *de, unsigned int new_rec_len)
/* Check whether 'de' has enough room to hold an entry of 'new_rec_len' bytes. */ static int ocfs2_dirent_would_fit(struct ocfs2_dir_entry *de, unsigned int new_rec_len)
{ unsigned int de_really_used; if (le64_to_cpu(de->inode) == 0 && le16_to_cpu(de->rec_len) >= new_rec_len) return 1; de_really_used = OCFS2_DIR_REC_LEN(de->name_len); if (le16_to_cpu(de->rec_len) >= (de_really_used + new_rec_len)) return 1; return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* i5000_process_error_info Process the error info that is in the 'info' structure, previously retrieved from hardware */
static void i5000_process_error_info(struct mem_ctl_info *mci, struct i5000_error_info *info, int handle_errors)
/* i5000_process_error_info Process the error info that is in the 'info' structure, previously retrieved from hardware */ static void i5000_process_error_info(struct mem_ctl_info *mci, struct i5000_error_info *info, int handle_errors)
{ i5000_process_fatal_error_info(mci, info, handle_errors); i5000_process_nonfatal_error_info(mci, info, handle_errors); }
robutest/uclinux
C++
GPL-2.0
60
/* Perform HMAC-SHA1 NOTE: does not handle keys larger than the block size. */
void ICACHE_FLASH_ATTR ssl_hmac_sha1(const uint8_t *msg, int length, const uint8_t *key, int key_len, uint8_t *digest)
/* Perform HMAC-SHA1 NOTE: does not handle keys larger than the block size. */ void ICACHE_FLASH_ATTR ssl_hmac_sha1(const uint8_t *msg, int length, const uint8_t *key, int key_len, uint8_t *digest)
{ SHA1_CTX context; uint8_t k_ipad[64]; uint8_t k_opad[64]; int i; memset(k_ipad, 0, sizeof k_ipad); memset(k_opad, 0, sizeof k_opad); memcpy(k_ipad, key, key_len); memcpy(k_opad, key, key_len); for (i = 0; i < 64; i++) { k_ipad[i] ^= 0x36; k_opad[i] ^= 0x5c; } SHA1_Init(&context); SHA1_Update(&context, k_ipad, 64); SHA1_Update(&context, msg, length); SHA1_Final(digest, &context); SHA1_Init(&context); SHA1_Update(&context, k_opad, 64); SHA1_Update(&context, digest, SHA1_SIZE); SHA1_Final(digest, &context); }
eerimoq/simba
C++
Other
337
/* System reset should not return, if it returns, it means the system does not support warm reset. */
VOID EFIAPI ResetWarm(VOID)
/* System reset should not return, if it returns, it means the system does not support warm reset. */ VOID EFIAPI ResetWarm(VOID)
{ IoWrite8 ((UINTN)mAcpiBoardInfo.ResetRegAddress, mAcpiBoardInfo.ResetValue); CpuDeadLoop (); }
tianocore/edk2
C++
Other
4,240
/* If this interface is not supported, then return FALSE. */
BOOLEAN EFIAPI Sha256HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
/* If this interface is not supported, then return FALSE. */ BOOLEAN EFIAPI Sha256HashAll(IN CONST VOID *Data, IN UINTN DataSize, OUT UINT8 *HashValue)
{ CALL_CRYPTO_SERVICE (Sha256HashAll, (Data, DataSize, HashValue), FALSE); }
tianocore/edk2
C++
Other
4,240
/* Sets a new id name to an ID additional selector. */
void cr_additional_sel_set_id_name(CRAdditionalSel *a_this, CRString *a_id)
/* Sets a new id name to an ID additional selector. */ void cr_additional_sel_set_id_name(CRAdditionalSel *a_this, CRString *a_id)
{ g_return_if_fail (a_this && a_this->type == ID_ADD_SELECTOR); if (a_this->content.id_name) { cr_string_destroy (a_this->content.id_name); } a_this->content.id_name = a_id; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Return a pointer to the interrogate tcw associated with the specified tcw or NULL if there is no associated interrogate tcw. */
struct tcw* tcw_get_intrg(struct tcw *tcw)
/* Return a pointer to the interrogate tcw associated with the specified tcw or NULL if there is no associated interrogate tcw. */ struct tcw* tcw_get_intrg(struct tcw *tcw)
{ return (struct tcw *) ((addr_t) tcw->intrg); }
robutest/uclinux
C++
GPL-2.0
60
/* These are described as signed 12 bit on the data sheet, which appears to be a conventional 2's complement 13 bit. */
static ssize_t sca3000_read_13bit_signed(struct device *dev, struct device_attribute *attr, char *buf)
/* These are described as signed 12 bit on the data sheet, which appears to be a conventional 2's complement 13 bit. */ static ssize_t sca3000_read_13bit_signed(struct device *dev, struct device_attribute *attr, char *buf)
{ int len = 0, ret; int val; struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); u8 *rx; struct iio_dev *indio_dev = dev_get_drvdata(dev); struct sca3000_state *st = indio_dev->dev_data; mutex_lock(&st->lock); ret = sca3000_read_data(st, this_attr->address, &rx, 2); if (ret < 0) goto error_ret; val = sca3000_13bit_convert(rx[1], rx[2]); len += sprintf(buf + len, "%d\n", val); kfree(rx); error_ret: mutex_unlock(&st->lock); return ret ? ret : len; }
robutest/uclinux
C++
GPL-2.0
60
/* Convert CMAP buffer (stored in extradata) to lavc palette format */
int ff_cmap_read_palette(AVCodecContext *avctx, uint32_t *pal)
/* Convert CMAP buffer (stored in extradata) to lavc palette format */ int ff_cmap_read_palette(AVCodecContext *avctx, uint32_t *pal)
{ int count, i; if (avctx->bits_per_coded_sample > 8) { av_log(avctx, AV_LOG_ERROR, "bit_per_coded_sample > 8 not supported\n"); return AVERROR_INVALIDDATA; } count = 1 << avctx->bits_per_coded_sample; if (avctx->extradata_size < count * 3) { av_log(avctx, AV_LOG_ERROR, "palette data underflow\n"); return AVERROR_INVALIDDATA; } for (i=0; i < count; i++) { pal[i] = 0xFF000000 | AV_RB24( avctx->extradata + i*3 ); } return 0; }
DC-SWAT/DreamShell
C++
null
404
/* Reset the Tx and Rx FIFO of smartcard module. */
void SC_ClearFIFO(SC_T *sc)
/* Reset the Tx and Rx FIFO of smartcard module. */ void SC_ClearFIFO(SC_T *sc)
{ while((sc->ALTCTL & SC_ALTCTL_SYNC_Msk) == SC_ALTCTL_SYNC_Msk) {} sc->ALTCTL |= (SC_ALTCTL_TXRST_Msk | SC_ALTCTL_RXRST_Msk); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Make a lv_task ready. It will not wait its period. */
void lv_task_ready(lv_task_t *lv_task_p)
/* Make a lv_task ready. It will not wait its period. */ void lv_task_ready(lv_task_t *lv_task_p)
{ lv_task_p->last_run = lv_tick_get() - lv_task_p->period - 1; }
RavenSystem/esp-homekit-devices
C++
Other
2,577
/* History: 07-Aug-2000 Created. 19-Oct-2000 Reworked for usbvideo module. */
static void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs)
/* History: 07-Aug-2000 Created. 19-Oct-2000 Reworked for usbvideo module. */ static void usbvideo_VideosizeToString(char *buf, int bufLen, videosize_t vs)
{ char tmp[40]; int n; n = 1 + sprintf(tmp, "%ldx%ld", VIDEOSIZE_X(vs), VIDEOSIZE_Y(vs)); assert(n < sizeof(tmp)); if ((buf == NULL) || (bufLen < n)) err("usbvideo_VideosizeToString: buffer is too small."); else memmove(buf, tmp, n); }
robutest/uclinux
C++
GPL-2.0
60
/* userData handle LPUART handle pointer. return Length of received data in RX ring buffer. */
size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle)
/* userData handle LPUART handle pointer. return Length of received data in RX ring buffer. */ size_t LPUART_TransferGetRxRingBufferLength(LPUART_Type *base, lpuart_handle_t *handle)
{ (void)base; assert(handle); size_t size; if (handle->rxRingBufferTail > handle->rxRingBufferHead) { size = (size_t)(handle->rxRingBufferHead + handle->rxRingBufferSize - handle->rxRingBufferTail); } else { size = (size_t)(handle->rxRingBufferHead - handle->rxRingBufferTail); } return size; }
nanoframework/nf-interpreter
C++
MIT License
293
/* This routine put the completed mailbox command into the mailbox command complete list. This is the unlocked version of the routine. The mailbox complete list is used by the driver worker thread to process mailbox complete callback functions outside the driver interrupt handler. */
void __lpfc_mbox_cmpl_put(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbq)
/* This routine put the completed mailbox command into the mailbox command complete list. This is the unlocked version of the routine. The mailbox complete list is used by the driver worker thread to process mailbox complete callback functions outside the driver interrupt handler. */ void __lpfc_mbox_cmpl_put(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbq)
{ list_add_tail(&mbq->list, &phba->sli.mboxq_cmpl); }
robutest/uclinux
C++
GPL-2.0
60
/* Get the MMIO base of the UFS host controller. */
EFI_STATUS EFIAPI UfsHcGetMmioBar(IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This, OUT UINTN *MmioBar)
/* Get the MMIO base of the UFS host controller. */ EFI_STATUS EFIAPI UfsHcGetMmioBar(IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This, OUT UINTN *MmioBar)
{ UFS_HOST_CONTROLLER_PRIVATE_DATA *Private; EFI_PCI_IO_PROTOCOL *PciIo; EFI_STATUS Status; UINT8 BarIndex; EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *BarDesc; if ((This == NULL) || (MmioBar == NULL)) { return EFI_INVALID_PARAMETER; } BarDesc = NULL; Private = UFS_HOST_CONTROLLER_PRIVATE_DATA_FROM_UFSHC (This); PciIo = Private->PciIo; BarIndex = Private->BarIndex; Status = PciIo->GetBarAttributes ( PciIo, BarIndex, NULL, (VOID **)&BarDesc ); if (EFI_ERROR (Status)) { return Status; } *MmioBar = (UINTN)BarDesc->AddrRangeMin; FreePool (BarDesc); return Status; }
tianocore/edk2
C++
Other
4,240
/* Routine: pinmux_init Description: Do individual peripheral pinmux configs */
void pinmux_init(void)
/* Routine: pinmux_init Description: Do individual peripheral pinmux configs */ void pinmux_init(void)
{ pinmux_clear_tristate_input_clamping(); gpio_config_table(p2571_gpio_inits, ARRAY_SIZE(p2571_gpio_inits)); pinmux_config_pingrp_table(p2571_pingrps, ARRAY_SIZE(p2571_pingrps)); pinmux_config_drvgrp_table(p2571_drvgrps, ARRAY_SIZE(p2571_drvgrps)); }
4ms/stm32mp1-baremetal
C++
Other
137
/* PC300 TTY trigger poll routine This routine is called by pc300driver to treats Tx interrupt. */
void cpc_tty_trigger_poll(pc300dev_t *pc300dev)
/* PC300 TTY trigger poll routine This routine is called by pc300driver to treats Tx interrupt. */ void cpc_tty_trigger_poll(pc300dev_t *pc300dev)
{ st_cpc_tty_area *cpc_tty = (st_cpc_tty_area *)pc300dev->cpc_tty; if (!cpc_tty) { return; } schedule_work(&(cpc_tty->tty_tx_work)); }
robutest/uclinux
C++
GPL-2.0
60