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
/* If Address > 0x0FFFFFFF, then ASSERT(). If Address is not aligned on a 32-bit boundary, then ASSERT(). If the register specified by Address >= 0x100, then ASSERT(). */
UINT32 EFIAPI PciCf8AndThenOr32(IN UINTN Address, IN UINT32 AndData, IN UINT32 OrData)
/* If Address > 0x0FFFFFFF, then ASSERT(). If Address is not aligned on a 32-bit boundary, then ASSERT(). If the register specified by Address >= 0x100, then ASSERT(). */ UINT32 EFIAPI PciCf8AndThenOr32(IN UINTN Address, IN UINT32 AndData, IN UINT32 OrData)
{ BOOLEAN InterruptState; UINT32 AddressPort; UINT32 Result; ASSERT_INVALID_PCI_ADDRESS (Address, 3); InterruptState = SaveAndDisableInterrupts (); AddressPort = IoRead32 (PCI_CONFIGURATION_ADDRESS_PORT); IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address)); Result = IoAndThenOr32 ( PCI_CONFIGURATION_DATA_PORT, AndData, OrData ); IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, AddressPort); SetInterruptState (InterruptState); return Result; }
tianocore/edk2
C++
Other
4,240
/* This function will compare two strings with specified maximum length. */
rt_int32_t rt_strncmp(const char *cs, const char *ct, rt_size_t count)
/* This function will compare two strings with specified maximum length. */ rt_int32_t rt_strncmp(const char *cs, const char *ct, rt_size_t count)
{ signed char __res = 0; while (count) { if ((__res = *cs - *ct++) != 0 || !*cs++) { break; } count --; } return __res; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Destroy the Dhcp6 instance and recycle the resources. */
VOID Dhcp6DestroyInstance(IN OUT DHCP6_INSTANCE *Instance)
/* Destroy the Dhcp6 instance and recycle the resources. */ VOID Dhcp6DestroyInstance(IN OUT DHCP6_INSTANCE *Instance)
{ Dhcp6CleanupRetry (Instance, DHCP6_PACKET_ALL); gBS->CloseEvent (Instance->Timer); if (Instance->Config != NULL) { Dhcp6CleanupConfigData (Instance->Config); FreePool (Instance->Config); } if (Instance->IaCb.Ia != NULL) { if (Instance->IaCb.Ia->ReplyPacket != NULL) { FreePool (Instance->IaCb.Ia->ReplyPacket); } FreePool (Instance->IaCb.Ia); } if (Instance->Unicast != NULL) { FreePool (Instance->Unicast); } if (Instance->AdSelect != NULL) { FreePool (Instance->AdSelect); } FreePool (Instance); }
tianocore/edk2
C++
Other
4,240
/* Add @mode to @connector's mode list for later use. */
void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode)
/* Add @mode to @connector's mode list for later use. */ void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode)
{ list_add(&mode->head, &connector->probed_modes); }
robutest/uclinux
C++
GPL-2.0
60
/* Initialize any struct clk fields needed before normal clk initialization can run. No return value. */
void clk_preinit(struct clk *clk)
/* Initialize any struct clk fields needed before normal clk initialization can run. No return value. */ void clk_preinit(struct clk *clk)
{ INIT_LIST_HEAD(&clk->children); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* The software interrupt instruction (SWI) is used for entering Supervisor mode, usually to request a particular supervisor function. */
void rt_hw_trap_swi(struct rt_hw_register *regs)
/* The software interrupt instruction (SWI) is used for entering Supervisor mode, usually to request a particular supervisor function. */ void rt_hw_trap_swi(struct rt_hw_register *regs)
{ rt_kprintf("software interrupt\n"); rt_hw_show_register(regs); if (rt_thread_self() != RT_NULL) rt_kprintf("Current Thread: %s\n", rt_thread_self()->parent.name); rt_hw_cpu_shutdown(); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* cr_prop_list_append2: Appends a pair of prop/declaration to the current prop list. @a_this: the current instance of #CRPropList @a_prop: the property to consider @a_decl: the declaration to consider Returns the resulting property list, or NULL in case of an error. */
CRPropList* cr_prop_list_append2(CRPropList *a_this, CRString *a_prop, CRDeclaration *a_decl)
/* cr_prop_list_append2: Appends a pair of prop/declaration to the current prop list. @a_this: the current instance of #CRPropList @a_prop: the property to consider @a_decl: the declaration to consider Returns the resulting property list, or NULL in case of an error. */ CRPropList* cr_prop_list_append2(CRPropList *a_this, CRString *a_prop, CRDeclaration *a_decl)
{ CRPropList *list = NULL, *result = NULL; g_return_val_if_fail (a_prop && a_decl, NULL); list = cr_prop_list_allocate (); g_return_val_if_fail (list && PRIVATE (list), NULL); PRIVATE (list)->prop = a_prop; PRIVATE (list)->decl = a_decl; result = cr_prop_list_append (a_this, list); return result; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Setup the microcontroller system. Initialize the System and update the SystemCoreClock variable. */
void SystemInit(void)
/* Setup the microcontroller system. Initialize the System and update the SystemCoreClock variable. */ void SystemInit(void)
{ M0P_SYSCTRL->RCL_CR_f.TRIM = (*((volatile uint16_t*) (0x00100C22ul))); M0P_SYSCTRL->RCH_CR_f.TRIM = (*((volatile uint16_t*) (0x00100C08ul))); SystemCoreClockUpdate(); _InitHidePin(); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* XXX - Should we simply return NULL for zero-length fragments? */
static fragment_head* fragment_add_seq_check_work(reassembly_table *table, tvbuff_t *tvb, const int offset, const packet_info *pinfo, const guint32 id, const void *data, const guint32 frag_number, const guint32 frag_data_len, const gboolean more_frags, const guint32 flags)
/* XXX - Should we simply return NULL for zero-length fragments? */ static fragment_head* fragment_add_seq_check_work(reassembly_table *table, tvbuff_t *tvb, const int offset, const packet_info *pinfo, const guint32 id, const void *data, const guint32 frag_number, const guint32 frag_data_len, const gboolean more_frags, const guint32 flags)
{ reassembled_key reass_key; fragment_head *fd_head; gpointer orig_key; if (pinfo->fd->flags.visited) { reass_key.frame = pinfo->num; reass_key.id = id; return (fragment_head *)g_hash_table_lookup(table->reassembled_table, &reass_key); } fd_head = fragment_add_seq_common(table, tvb, offset, pinfo, id, data, frag_number, frag_data_len, more_frags, flags, &orig_key); if (fd_head) { if (orig_key != NULL) fragment_unhash(table, orig_key); fragment_reassembled(table, fd_head, pinfo, id); return fd_head; } else { return NULL; } }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Send a signal to a given thread. Send a signal to a thread. */
__attribute__((weak))
/* Send a signal to a given thread. Send a signal to a thread. */ __attribute__((weak))
{ (void) pid; (void) sig; r->_errno = ESRCH; return -1; }
labapart/polymcu
C++
null
201
/* param handle ENET handler pointer. Should be provided by application. param callback The ENET callback function. param userData The callback function parameter. */
void ENET_SetCallback(enet_handle_t *handle, enet_callback_t callback, void *userData)
/* param handle ENET handler pointer. Should be provided by application. param callback The ENET callback function. param userData The callback function parameter. */ void ENET_SetCallback(enet_handle_t *handle, enet_callback_t callback, void *userData)
{ assert(handle != NULL); handle->callback = callback; handle->userData = userData; }
eclipse-threadx/getting-started
C++
Other
310
/* waits until rx ep is ready. Returns 1 when ep is ready and 0 on error. */
static int wait_until_rxep_ready(struct usb_device *dev, u8 ep)
/* waits until rx ep is ready. Returns 1 when ep is ready and 0 on error. */ static int wait_until_rxep_ready(struct usb_device *dev, u8 ep)
{ u16 csr; int timeout = CONFIG_USB_MUSB_TIMEOUT; do { if (check_stall(ep, 0)) { dev->status = USB_ST_STALLED; return 0; } csr = readw(&musbr->rxcsr); if (csr & MUSB_RXCSR_H_ERROR) { dev->status = USB_ST_CRC_ERR; return 0; } if (--timeout) udelay(1); else { dev->status = USB_ST_CRC_ERR; return -1; } } while (!(csr & MUSB_RXCSR_RXPKTRDY)); return 1; }
4ms/stm32mp1-baremetal
C++
Other
137
/* param base Pointer to the FLEXIO_CAMERA_Type. param handle Pointer to the flexio_camera_edma_handle_t structure. */
void FLEXIO_CAMERA_TransferAbortReceiveEDMA(FLEXIO_CAMERA_Type *base, flexio_camera_edma_handle_t *handle)
/* param base Pointer to the FLEXIO_CAMERA_Type. param handle Pointer to the flexio_camera_edma_handle_t structure. */ void FLEXIO_CAMERA_TransferAbortReceiveEDMA(FLEXIO_CAMERA_Type *base, flexio_camera_edma_handle_t *handle)
{ assert(handle->rxEdmaHandle != NULL); FLEXIO_CAMERA_EnableRxDMA(base, false); EDMA_StopTransfer(handle->rxEdmaHandle); handle->rxState = (uint8_t)kFLEXIO_CAMERA_RxIdle; }
eclipse-threadx/getting-started
C++
Other
310
/* Writes a word to the LPC channel pool. */
void LPCWordWrite(unsigned long ulBase, unsigned long ulOffset, unsigned long ulData)
/* Writes a word to the LPC channel pool. */ void LPCWordWrite(unsigned long ulBase, unsigned long ulOffset, unsigned long ulData)
{ ASSERT(ulBase == LPC0_BASE); ASSERT((ulOffset & 1) == 0); ASSERT(ulOffset < (((HWREG(ulBase + LPC_O_STS) & LPC_STS_POOLSZ_M) >> 16) * 256)); HWREG(ulBase + LPC_O_POOL + ulOffset) = ulData; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Map the ring buffer so that it can be accessed equally by both guest and hypervisor. */
EFI_STATUS EFIAPI VirtioRingMap(IN VIRTIO_DEVICE_PROTOCOL *VirtIo, IN VRING *Ring, OUT UINT64 *RingBaseShift, OUT VOID **Mapping)
/* Map the ring buffer so that it can be accessed equally by both guest and hypervisor. */ EFI_STATUS EFIAPI VirtioRingMap(IN VIRTIO_DEVICE_PROTOCOL *VirtIo, IN VRING *Ring, OUT UINT64 *RingBaseShift, OUT VOID **Mapping)
{ EFI_STATUS Status; EFI_PHYSICAL_ADDRESS DeviceAddress; Status = VirtioMapAllBytesInSharedBuffer ( VirtIo, VirtioOperationBusMasterCommonBuffer, Ring->Base, EFI_PAGES_TO_SIZE (Ring->NumPages), &DeviceAddress, Mapping ); if (EFI_ERROR (Status)) { return Status; } *RingBaseShift = DeviceAddress - (UINT64)(UINTN)Ring->Base; return EFI_SUCCESS; }
tianocore/edk2
C++
Other
4,240
/* If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). */
UINT32 EFIAPI AsmMsrBitFieldOr32(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 OrData)
/* If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). */ UINT32 EFIAPI AsmMsrBitFieldOr32(IN UINT32 Index, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 OrData)
{ ASSERT (EndBit < sizeof (OrData) * 8); ASSERT (StartBit <= EndBit); return (UINT32)AsmMsrBitFieldOr64 (Index, StartBit, EndBit, OrData); }
tianocore/edk2
C++
Other
4,240
/* Print out file handle and file name. Return pointer to 32-bit word past file name. If packet was truncated (or there was some other error), return 0. */
static const uint32_t* parsefhn(netdissect_options *ndo, register const uint32_t *dp, int v3)
/* Print out file handle and file name. Return pointer to 32-bit word past file name. If packet was truncated (or there was some other error), return 0. */ static const uint32_t* parsefhn(netdissect_options *ndo, register const uint32_t *dp, int v3)
{ dp = parsefh(ndo, dp, v3); if (dp == NULL) return (NULL); ND_PRINT((ndo, " ")); return (parsefn(ndo, dp)); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Initialize sysfs. This sets up the bonding_masters file in /sys/class/net. */
int bond_create_sysfs(void)
/* Initialize sysfs. This sets up the bonding_masters file in /sys/class/net. */ int bond_create_sysfs(void)
{ int ret; ret = netdev_class_create_file(&class_attr_bonding_masters); if (ret == -EEXIST) { if (__dev_get_by_name(&init_net, class_attr_bonding_masters.attr.name)) pr_err("network device named %s already exists in sysfs", class_attr_bonding_masters.attr.name); ret = 0; } return ret; }
robutest/uclinux
C++
GPL-2.0
60
/* Searches the FFS file and counts the number of sections found. The sections are NOT recursed. */
EFI_STATUS FvBufCountSections(IN VOID *FfsFile, IN UINTN *Count)
/* Searches the FFS file and counts the number of sections found. The sections are NOT recursed. */ EFI_STATUS FvBufCountSections(IN VOID *FfsFile, IN UINTN *Count)
{ EFI_STATUS Status; UINTN Key; VOID* SectionStart; UINTN TotalSectionsSize; EFI_COMMON_SECTION_HEADER* NextSection; SectionStart = (VOID*)((UINTN)FfsFile + FvBufGetFfsHeaderSize(FfsFile)); TotalSectionsSize = FvBufGetFfsFileSize ((EFI_FFS_FILE_HEADER*)FfsFile) - FvBufGetFfsHeaderSize(FfsFile); Key = 0; *Count = 0; while (TRUE) { Status = FvBufFindNextSection ( SectionStart, TotalSectionsSize, &Key, (VOID **)&NextSection ); if (Status == EFI_NOT_FOUND) { return EFI_SUCCESS; } else if (EFI_ERROR (Status)) { return Status; } *Count += 1; } return EFI_NOT_FOUND; }
tianocore/edk2
C++
Other
4,240
/* Enables or disables SPIx TDMA and RDMA . */
void SSI_SetDmaEnable(SPI_TypeDef *spi_dev, u32 newState, u32 Mask)
/* Enables or disables SPIx TDMA and RDMA . */ void SSI_SetDmaEnable(SPI_TypeDef *spi_dev, u32 newState, u32 Mask)
{ if (newState == DISABLE) spi_dev->DMACR &= ~Mask; else spi_dev->DMACR |= Mask; }
alibaba/AliOS-Things
C++
Apache License 2.0
4,536
/* Helper method for drivers which have SATA cables */
int ata_cable_sata(struct ata_port *ap)
/* Helper method for drivers which have SATA cables */ int ata_cable_sata(struct ata_port *ap)
{ return ATA_CBL_SATA; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* The storage addressed by Strings is free'd prior to Split returning. */
STATIC CONST CHAR8** Split(IN CHAR8 *Strings, IN UINTN Len, OUT UINT32 *NumPtr)
/* The storage addressed by Strings is free'd prior to Split returning. */ STATIC CONST CHAR8** Split(IN CHAR8 *Strings, IN UINTN Len, OUT UINT32 *NumPtr)
{ CONST CHAR8 **Dst; ASSERT (NumPtr != NULL); ASSERT (Strings != NULL); if (Len > 0) { Strings[Len - 1] = '\0'; } *NumPtr = ExtractStrings (Strings, Len, NULL); Dst = AllocatePool (*NumPtr * sizeof (CHAR8 *) + Len); CopyMem ((VOID *)&Dst[*NumPtr], Strings, Len); FreePool (Strings); Strings = (CHAR8 *)&Dst[*NumPtr]; ExtractStrings (Strings, Len, Dst); return (Dst); }
tianocore/edk2
C++
Other
4,240
/* returns length of a file (if filept points to a file) reads the last 128 bytes information into buffer ... that is not totally safe... */
static off_t get_fileinfo(mpg123_handle *)
/* returns length of a file (if filept points to a file) reads the last 128 bytes information into buffer ... that is not totally safe... */ static off_t get_fileinfo(mpg123_handle *)
{ off_t len; if((len=io_seek(&fr->rdat,0,SEEK_END)) < 0) return -1; if(io_seek(&fr->rdat,-128,SEEK_END) < 0) return -1; if(fr->rd->fullread(fr,(unsigned char *)fr->id3buf,128) != 128) return -1; if(!strncmp((char*)fr->id3buf,"TAG",3)) len -= 128; if(io_seek(&fr->rdat,0,SEEK_SET) < 0) return -1; if(len <= 0) return -1; return len; }
DC-SWAT/DreamShell
C++
null
404
/* Programs the FLASH brownout reset threshold level Option Byte. */
FLASH_Status FLASH_OB_BORConfig(uint8_t OB_BOR)
/* Programs the FLASH brownout reset threshold level Option Byte. */ FLASH_Status FLASH_OB_BORConfig(uint8_t OB_BOR)
{ FLASH_Status status = FLASH_COMPLETE; uint32_t tmp = 0, tmp1 = 0; assert_param(IS_OB_BOR_LEVEL(OB_BOR)); tmp1 = (FLASH->OBR & 0x00F00000) >> 16; tmp = (uint32_t)~(OB_BOR | tmp1)<<16; tmp |= (OB_BOR | tmp1); status = FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT); if(status == FLASH_COMPLETE) { OB->USER = tmp; } status = FLASH_WaitForLastOperation(FLASH_ER_PRG_TIMEOUT); return status; }
avem-labs/Avem
C++
MIT License
1,752
/* m o v e I n a c t i v e T o A c t i v e */
returnValue Constraints_moveInactiveToActive(Constraints *_THIS, int number, SubjectToStatus _status)
/* m o v e I n a c t i v e T o A c t i v e */ returnValue Constraints_moveInactiveToActive(Constraints *_THIS, int number, SubjectToStatus _status)
{ if ( ( number < 0 ) || ( number >= _THIS->n ) ) return THROWERROR( RET_INDEX_OUT_OF_BOUNDS ); if ( Constraints_removeIndex( _THIS,Constraints_getInactive( _THIS ),number ) != SUCCESSFUL_RETURN ) return THROWERROR( RET_MOVING_BOUND_FAILED ); if ( Constraints_addIndex( _THIS,Constraints_getActive( _THIS ),number,_status ) != SUCCESSFUL_RETURN ) return THROWERROR( RET_MOVING_BOUND_FAILED ); return SUCCESSFUL_RETURN; }
DanielMartensson/EmbeddedLapack
C++
MIT License
129
/* The TD line is driven with the default value during the Transmit Frame Sync signal. */
void ssc_disable_tx_frame_sync_data(Ssc *p_ssc)
/* The TD line is driven with the default value during the Transmit Frame Sync signal. */ void ssc_disable_tx_frame_sync_data(Ssc *p_ssc)
{ p_ssc->SSC_TFMR &= ~SSC_TFMR_FSDEN; }
remotemcu/remcu-chip-sdks
C++
null
436
/* brief Configure DMIC channel param base : The base address of DMIC interface param channel : DMIC channel param dc_cut_level : dc_removal_t, Cut off Frequency param post_dc_gain_reduce : Fine g!y!9 param saturate16bit : If selects 16-bit saturation. */
void DMIC_CfgChannelDc(DMIC_Type *base, dmic_channel_t channel, dc_removal_t dc_cut_level, uint32_t post_dc_gain_reduce, bool saturate16bit)
/* brief Configure DMIC channel param base : The base address of DMIC interface param channel : DMIC channel param dc_cut_level : dc_removal_t, Cut off Frequency param post_dc_gain_reduce : Fine g!y!9 param saturate16bit : If selects 16-bit saturation. */ void DMIC_CfgChannelDc(DMIC_Type *base, dmic_channel_t channel, dc_removal_t dc_cut_level, uint32_t post_dc_gain_reduce, bool saturate16bit)
{ base->CHANNEL[channel].DC_CTRL = DMIC_CHANNEL_DC_CTRL_DCPOLE(dc_cut_level) | DMIC_CHANNEL_DC_CTRL_DCGAIN(post_dc_gain_reduce) | DMIC_CHANNEL_DC_CTRL_SATURATEAT16BIT(saturate16bit); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* param base Pointer to FLEXIO_I2C_Type structure. param count Number of bytes need to be transferred from a start signal to a re-start/stop signal retval kStatus_Success Successfully configured the count. retval kStatus_InvalidArgument Input argument is invalid. */
status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint8_t count)
/* param base Pointer to FLEXIO_I2C_Type structure. param count Number of bytes need to be transferred from a start signal to a re-start/stop signal retval kStatus_Success Successfully configured the count. retval kStatus_InvalidArgument Input argument is invalid. */ status_t FLEXIO_I2C_MasterSetTransferCount(FLEXIO_I2C_Type *base, uint8_t count)
{ if (count > 14U) { return kStatus_InvalidArgument; } uint16_t timerCmp = 0; uint32_t timerConfig = 0; FLEXIO_Type *flexioBase = base->flexioBase; timerCmp = flexioBase->TIMCMP[base->timerIndex[0]]; timerCmp &= 0x00FFU; timerCmp |= (count * 18 + 1U) << 8U; flexioBase->TIMCMP[base->timerIndex[0]] = timerCmp; timerConfig = flexioBase->TIMCFG[base->timerIndex[0]]; timerConfig &= ~FLEXIO_TIMCFG_TIMDIS_MASK; timerConfig |= FLEXIO_TIMCFG_TIMDIS(kFLEXIO_TimerDisableOnTimerCompare); flexioBase->TIMCFG[base->timerIndex[0]] = timerConfig; return kStatus_Success; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* param base SMC peripheral base address. return SMC configuration error code. */
status_t SMC_SetPowerModeVlps(SMC_Type *base)
/* param base SMC peripheral base address. return SMC configuration error code. */ status_t SMC_SetPowerModeVlps(SMC_Type *base)
{ uint8_t reg; reg = base->PMCTRL; reg &= ~SMC_PMCTRL_STOPM_MASK; reg |= (kSMC_StopVlps << SMC_PMCTRL_STOPM_SHIFT); base->PMCTRL = reg; SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; (void)base->PMCTRL; SMC_EnterStopRamFunc(); if (base->PMCTRL & SMC_PMCTRL_STOPA_MASK) { return kStatus_SMC_StopAbort; } else { return kStatus_Success; } }
ARMmbed/DAPLink
C++
Apache License 2.0
2,140
/* \method counter() Get or set the timer counter. */
STATIC mp_obj_t pyb_timer_counter(size_t n_args, const mp_obj_t *args)
/* \method counter() Get or set the timer counter. */ STATIC mp_obj_t pyb_timer_counter(size_t n_args, const mp_obj_t *args)
{ return mp_obj_new_int(self->tim.Instance->CNT); } else { __HAL_TIM_SET_COUNTER(&self->tim, mp_obj_get_int(args[1])); return mp_const_none; } }
micropython/micropython
C++
Other
18,334
/* Clear the bits given by 'bitval' in PHY register 'reg'. */
static void mdio_clear_bit(struct cphy *cphy, int reg, u32 bitval)
/* Clear the bits given by 'bitval' in PHY register 'reg'. */ static void mdio_clear_bit(struct cphy *cphy, int reg, u32 bitval)
{ u32 val; (void) simple_mdio_read(cphy, reg, &val); (void) simple_mdio_write(cphy, reg, val & ~bitval); }
robutest/uclinux
C++
GPL-2.0
60
/* This function searches all devices owned by @cdrv for a device with a bus id matching @bus_id. Returns: If a match is found, its reference count of the found device is increased and it is returned; else NULL is returned. */
struct ccw_device* get_ccwdev_by_busid(struct ccw_driver *cdrv, const char *bus_id)
/* This function searches all devices owned by @cdrv for a device with a bus id matching @bus_id. Returns: If a match is found, its reference count of the found device is increased and it is returned; else NULL is returned. */ struct ccw_device* get_ccwdev_by_busid(struct ccw_driver *cdrv, const char *bus_id)
{ struct device *dev; struct device_driver *drv; drv = get_driver(&cdrv->driver); if (!drv) return NULL; dev = driver_find_device(drv, NULL, (void *)bus_id, __ccwdev_check_busid); put_driver(drv); return dev ? to_ccwdev(dev) : NULL; }
robutest/uclinux
C++
GPL-2.0
60
/* if frame tail not needed (incorrect number or received twice), it won't store, but CRC will be calculated */
static int skip_tail(unsigned int, unsigned int, u32)
/* if frame tail not needed (incorrect number or received twice), it won't store, but CRC will be calculated */ static int skip_tail(unsigned int, unsigned int, u32)
{ while( tail_len-- ) crc = CRC32( inb( ioaddr + DAT ), crc ); return crc == CRC32_REMAINDER; }
robutest/uclinux
C++
GPL-2.0
60
/* param base PWM peripheral base address param subModule PWM submodule to configure param mask The interrupts to enable. This is a logical OR of members of the enumeration ::pwm_interrupt_enable_t */
void PWM_DisableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask)
/* param base PWM peripheral base address param subModule PWM submodule to configure param mask The interrupts to enable. This is a logical OR of members of the enumeration ::pwm_interrupt_enable_t */ void PWM_DisableInterrupts(PWM_Type *base, pwm_submodule_t subModule, uint32_t mask)
{ base->SM[subModule].INTEN &= ~(mask & 0xFFFF); base->FCTRL &= ~((mask >> 16U) & PWM_FCTRL_FIE_MASK); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Adjusts the display blinking frequency. Blinking frequency = Frame Frequency / LCDBLKFREQ. */
void SLCDC_SetBlinkFreq(unsigned int frequency)
/* Adjusts the display blinking frequency. Blinking frequency = Frame Frequency / LCDBLKFREQ. */ void SLCDC_SetBlinkFreq(unsigned int frequency)
{ unsigned int value; SANITY_CHECK((frequency & ~(0xFF << 8)) == 0); value = AT91C_BASE_SLCDC->SLCDC_DR; value &= ~AT91C_SLCDC_BLKFREQ; value |= frequency; AT91C_BASE_SLCDC->SLCDC_DR = frequency; }
apopple/Pandaboard-FreeRTOS
C++
null
25
/* Cid is the connection id (socket fd) and state can be: 0 - Closed by remote server or error 1 - Connected to remote server 2 - Listening */
MODEM_CMD_DEFINE(on_urc_castate)
/* Cid is the connection id (socket fd) and state can be: 0 - Closed by remote server or error 1 - Connected to remote server 2 - Listening */ MODEM_CMD_DEFINE(on_urc_castate)
{ struct modem_socket *sock; int sockfd, state; sockfd = atoi(argv[0]); state = atoi(argv[1]); sock = modem_socket_from_fd(&mdata.socket_config, sockfd); if (!sock) { return 0; } if (state != 0) { return 0; } LOG_INF("Socket close indication for socket: %d", sockfd); sock->is_connected = false; LOG_INF("Socket closed: %d", sockfd); return 0; }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* Registers a callback for custom device requests. This can be used for example in HID devices, where a REQ_GET_DESCRIPTOR request is sent to an interface, which is not covered by the 'chapter 9' specification. */
static void usb_register_custom_req_handler(usb_request_handler handler)
/* Registers a callback for custom device requests. This can be used for example in HID devices, where a REQ_GET_DESCRIPTOR request is sent to an interface, which is not covered by the 'chapter 9' specification. */ static void usb_register_custom_req_handler(usb_request_handler handler)
{ usb_dev.custom_req_handler = handler; }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* show_docked - read method for "docked" file in sysfs */
static ssize_t show_docked(struct device *dev, struct device_attribute *attr, char *buf)
/* show_docked - read method for "docked" file in sysfs */ static ssize_t show_docked(struct device *dev, struct device_attribute *attr, char *buf)
{ struct acpi_device *tmp; struct dock_station *dock_station = dev->platform_data; if (ACPI_SUCCESS(acpi_bus_get_device(dock_station->handle, &tmp))) return snprintf(buf, PAGE_SIZE, "1\n"); return snprintf(buf, PAGE_SIZE, "0\n"); }
robutest/uclinux
C++
GPL-2.0
60
/* This function disables the retention of the GPIO pin state during hibernation and allows the GPIO pins to be controlled by the system. If the */
void HibernateGPIORetentionDisable(void)
/* This function disables the retention of the GPIO pin state during hibernation and allows the GPIO pins to be controlled by the system. If the */ void HibernateGPIORetentionDisable(void)
{ HWREG(HIB_CTL) &= ~HIB_CTL_VDD3ON; _HibernateWriteComplete(); }
feaser/openblt
C++
GNU General Public License v3.0
601
/* Get configuration of the I3C hardware. This can return cached config or probed hardware parameters, but it has to be up to date with current configuration. */
static int cdns_i3c_config_get(const struct device *dev, enum i3c_config_type type, void *config)
/* Get configuration of the I3C hardware. This can return cached config or probed hardware parameters, but it has to be up to date with current configuration. */ static int cdns_i3c_config_get(const struct device *dev, enum i3c_config_type type, void *config)
{ struct cdns_i3c_data *data = dev->data; int ret = 0; if (config == NULL) { ret = -EINVAL; goto out_configure; } (void)memcpy(config, &data->common.ctrl_config, sizeof(data->common.ctrl_config)); out_configure: return ret; }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* SPI parity check error self diagnosis function enable or disable. */
void SPI_ParityCheckCmd(CM_SPI_TypeDef *SPIx, en_functional_state_t enNewState)
/* SPI parity check error self diagnosis function enable or disable. */ void SPI_ParityCheckCmd(CM_SPI_TypeDef *SPIx, en_functional_state_t enNewState)
{ DDL_ASSERT(IS_VALID_SPI_UNIT(SPIx)); DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState)); if (ENABLE == enNewState) { SET_REG32_BIT(SPIx->CR1, SPI_CR1_PATE); } else { CLR_REG32_BIT(SPIx->CR1, SPI_CR1_PATE); } }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Enables or disables the TIMx peripheral Preload register on CCDAT5. */
void TIM_ConfigOc5Preload(TIM_Module *TIMx, uint16_t TIM_OCPreload)
/* Enables or disables the TIMx peripheral Preload register on CCDAT5. */ void TIM_ConfigOc5Preload(TIM_Module *TIMx, uint16_t TIM_OCPreload)
{ uint16_t tmpccmr3 = 0; assert_param(IsTimList1Module(TIMx)); assert_param(IsTimOcPreLoadState(TIM_OCPreload)); tmpccmr3 = TIMx->CCMOD3; tmpccmr3 &= (uint16_t) ~((uint16_t)TIM_CCMOD3_OC5PEN); tmpccmr3 |= (uint16_t)(TIM_OCPreload); TIMx->CCMOD3 = tmpccmr3; }
pikasTech/PikaPython
C++
MIT License
1,403
/* Select The Timer counter capture detect edge. The */
void xTimerCaptureEdgeSelect(unsigned long ulBase, unsigned long ulChannel, unsigned long ulEdge)
/* Select The Timer counter capture detect edge. The */ void xTimerCaptureEdgeSelect(unsigned long ulBase, unsigned long ulChannel, unsigned long ulEdge)
{ xASSERT((ulBase == TIMER3_BASE) || (ulBase == TIMER2_BASE) || (ulBase == TIMER1_BASE) || (ulBase == TIMER0_BASE)); xASSERT((ulEdge == TIMER_CAP_RISING) || (ulEdge == TIMER_CAP_BOTH) || (ulEdge == TIMER_CAP_FALLING)); xHWREG(ulBase + TIMER_TEXCON) &= ~TIMER_TEXCON_TEX_EDGE_M; xHWREG(ulBase + TIMER_TEXCON) |= ulEdge; }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* Mark the buffer as being one which contains newly allocated inodes. We need to make sure that even if this buffer is relogged as an 'inode buf' we still recover all of the inode images in the face of a crash. This works in coordination with xfs_buf_item_committed() to ensure that the buffer remains in the AIL at its original location even after it has been relogged. */
void xfs_trans_inode_alloc_buf(xfs_trans_t *tp, xfs_buf_t *bp)
/* Mark the buffer as being one which contains newly allocated inodes. We need to make sure that even if this buffer is relogged as an 'inode buf' we still recover all of the inode images in the face of a crash. This works in coordination with xfs_buf_item_committed() to ensure that the buffer remains in the AIL at its original location even after it has been relogged. */ void xfs_trans_inode_alloc_buf(xfs_trans_t *tp, xfs_buf_t *bp)
{ xfs_buf_log_item_t *bip; ASSERT(XFS_BUF_ISBUSY(bp)); ASSERT(XFS_BUF_FSPRIVATE2(bp, xfs_trans_t *) == tp); ASSERT(XFS_BUF_FSPRIVATE(bp, void *) != NULL); bip = XFS_BUF_FSPRIVATE(bp, xfs_buf_log_item_t *); ASSERT(atomic_read(&bip->bli_refcount) > 0); bip->bli_flags |= XFS_BLI_INODE_ALLOC_BUF; }
robutest/uclinux
C++
GPL-2.0
60
/* Typically this will simply return the active device. In the case where the most recent active device was unset, this will attempt to return the first device. If that device doesn't exist or fails to probe, this function will return NULL. */
struct udevice* eth_get_dev(void)
/* Typically this will simply return the active device. In the case where the most recent active device was unset, this will attempt to return the first device. If that device doesn't exist or fails to probe, this function will return NULL. */ struct udevice* eth_get_dev(void)
{ struct eth_uclass_priv *uc_priv; uc_priv = eth_get_uclass_priv(); if (!uc_priv->current) eth_errno = uclass_first_device(UCLASS_ETH, &uc_priv->current); return uc_priv->current; }
4ms/stm32mp1-baremetal
C++
Other
137
/* Prepare all non-sysdev devices for system PM transition and execute "suspend" callbacks for them. */
int dpm_suspend_start(pm_message_t state)
/* Prepare all non-sysdev devices for system PM transition and execute "suspend" callbacks for them. */ int dpm_suspend_start(pm_message_t state)
{ int error; might_sleep(); error = dpm_prepare(state); if (!error) error = dpm_suspend(state); return error; }
robutest/uclinux
C++
GPL-2.0
60
/* Origin: maps a linear range of a device, with hooks for snapshotting. Construct an origin mapping: <dev_path> The context for an origin is merely a 'struct dm_dev *' pointing to the real device. */
static int origin_ctr(struct dm_target *ti, unsigned int argc, char **argv)
/* Origin: maps a linear range of a device, with hooks for snapshotting. Construct an origin mapping: <dev_path> The context for an origin is merely a 'struct dm_dev *' pointing to the real device. */ static int origin_ctr(struct dm_target *ti, unsigned int argc, char **argv)
{ int r; struct dm_dev *dev; if (argc != 1) { ti->error = "origin: incorrect number of arguments"; return -EINVAL; } r = dm_get_device(ti, argv[0], 0, ti->len, dm_table_get_mode(ti->table), &dev); if (r) { ti->error = "Cannot get target device"; return r; } ti->private = dev; ti->num_flush_requests = 1; return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Unregister TPS driver as an i2c client device driver */
static int __devexit tps_6507x_remove(struct i2c_client *client)
/* Unregister TPS driver as an i2c client device driver */ static int __devexit tps_6507x_remove(struct i2c_client *client)
{ struct tps_pmic *tps = i2c_get_clientdata(client); int i; for (i = 0; i < TPS6507X_NUM_REGULATOR; i++) regulator_unregister(tps->rdev[i]); tps->client = NULL; i2c_set_clientdata(client, NULL); kfree(tps); return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* The function is used to wait JPEG engine, until JPEG engine not busy. */
static INT _jpegWait(void)
/* The function is used to wait JPEG engine, until JPEG engine not busy. */ static INT _jpegWait(void)
{ while (1) { if (g_bWait == FALSE) break; } if (g_jpegError) return E_FAIL; return E_SUCCESS; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Returns the xmlChar * for the first occurrence or NULL. */
const xmlChar* xmlStrcasestr(const xmlChar *str, const xmlChar *val)
/* Returns the xmlChar * for the first occurrence or NULL. */ const xmlChar* xmlStrcasestr(const xmlChar *str, const xmlChar *val)
{ if (casemap[*str] == casemap[*val]) if (!xmlStrncasecmp(str, val, n)) return(str); str++; } return(NULL); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Returns -EINVAL if sec/nsec are not normalized. Otherwise 0. */
int poll_select_set_timeout(struct timespec *to, long sec, long nsec)
/* Returns -EINVAL if sec/nsec are not normalized. Otherwise 0. */ int poll_select_set_timeout(struct timespec *to, long sec, long nsec)
{ struct timespec ts = {.tv_sec = sec, .tv_nsec = nsec}; if (!timespec_valid(&ts)) return -EINVAL; if (!sec && !nsec) { to->tv_sec = to->tv_nsec = 0; } else { ktime_get_ts(to); *to = timespec_add_safe(*to, ts); } return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Get the peripheral clock speed for the USART at base specified. */
uint32_t rcc_get_usart_clk_freq(uint32_t usart)
/* Get the peripheral clock speed for the USART at base specified. */ uint32_t rcc_get_usart_clk_freq(uint32_t usart)
{ if (usart == LPUART1_BASE) { return rcc_uart_i2c_clksel_freq_hz(rcc_apb1_frequency, RCC_CCIPR_LPUART1SEL_SHIFT); } else if (usart == USART1_BASE) { return rcc_uart_i2c_clksel_freq_hz(rcc_apb2_frequency, RCC_CCIPR_USART1SEL_SHIFT); } else { return rcc_uart_i2c_clksel_freq_hz(rcc_apb1_frequency, RCC_CCIPR_USART2SEL_SHIFT); } }
libopencm3/libopencm3
C++
GNU General Public License v3.0
2,931
/* port_dispatcher(): Dispatcher for messages destinated to the tipc_port interface. Called with port locked. */
static u32 port_dispatcher(struct tipc_port *dummy, struct sk_buff *buf)
/* port_dispatcher(): Dispatcher for messages destinated to the tipc_port interface. Called with port locked. */ static u32 port_dispatcher(struct tipc_port *dummy, struct sk_buff *buf)
{ buf->next = NULL; spin_lock_bh(&queue_lock); if (msg_queue_head) { msg_queue_tail->next = buf; msg_queue_tail = buf; } else { msg_queue_tail = msg_queue_head = buf; tipc_k_signal((Handler)port_dispatcher_sigh, 0); } spin_unlock_bh(&queue_lock); return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* RETURNS: 0 on success, AC_ERR_* mask on failure. */
static unsigned int sata_pmp_write(struct ata_link *link, int reg, u32 val)
/* RETURNS: 0 on success, AC_ERR_* mask on failure. */ static unsigned int sata_pmp_write(struct ata_link *link, int reg, u32 val)
{ struct ata_port *ap = link->ap; struct ata_device *pmp_dev = ap->link.device; struct ata_taskfile tf; ata_tf_init(pmp_dev, &tf); tf.command = ATA_CMD_PMP_WRITE; tf.protocol = ATA_PROT_NODATA; tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48; tf.feature = reg; tf.device = link->pmp; tf.nsect = val & 0xff; tf.lbal = (val >> 8) & 0xff; tf.lbam = (val >> 16) & 0xff; tf.lbah = (val >> 24) & 0xff; return ata_exec_internal(pmp_dev, &tf, NULL, DMA_NONE, NULL, 0, SATA_PMP_RW_TIMEOUT); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Airpcap wrapper, used to get the link type of an airpcap adapter */
gboolean airpcap_if_get_link_type(PAirpcapHandle ah, PAirpcapLinkType lt)
/* Airpcap wrapper, used to get the link type of an airpcap adapter */ gboolean airpcap_if_get_link_type(PAirpcapHandle ah, PAirpcapLinkType lt)
{ if (!AirpcapLoaded) return FALSE; return g_PAirpcapGetLinkType(ah,lt); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* mark all values stored in marked open upvalues. (See comment in 'lstate.h'.) */
static void remarkupvals(global_State *g)
/* mark all values stored in marked open upvalues. (See comment in 'lstate.h'.) */ static void remarkupvals(global_State *g)
{ if (isgray(obj2gco(uv))) markvalue(g, uv->v); } }
opentx/opentx
C++
GNU General Public License v2.0
2,025
/* This function checks for proper alignment of input addr and len parameters. */
int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
/* This function checks for proper alignment of input addr and len parameters. */ int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
{ if (len & ~HPAGE_MASK) return -EINVAL; if (addr & ~HPAGE_MASK) return -EINVAL; return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Reads and returns the current value of MM0. This function is only available on IA-32 and X64. */
UINT64 EFIAPI AsmReadMm0(VOID)
/* Reads and returns the current value of MM0. This function is only available on IA-32 and X64. */ UINT64 EFIAPI AsmReadMm0(VOID)
{ UINT64 Data; __asm__ __volatile__ ( "movd %%mm0, %0 \n\t" : "=r" (Data) ); return Data; }
tianocore/edk2
C++
Other
4,240
/* Slave receive a byte to I2C bus. This function is to receive a byte on specified I2C BUS. */
unsigned long xI2CSlaveDataGet(unsigned long ulBase)
/* Slave receive a byte to I2C bus. This function is to receive a byte on specified I2C BUS. */ unsigned long xI2CSlaveDataGet(unsigned long ulBase)
{ return xI2CMasterDataGet(ulBase); }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* WritePropertyMultiple-Error ::= SEQUENCE { errorType Error, firstFailedWriteAttempt Unsigned } } */
static guint fWritePropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
/* WritePropertyMultiple-Error ::= SEQUENCE { errorType Error, firstFailedWriteAttempt Unsigned } } */ static guint fWritePropertyMultipleError(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset)
{ guint lastoffset = 0; guint8 tag_no = 0, tag_info = 0; guint32 lvt = 0; col_set_writable(pinfo->cinfo, COL_INFO, FALSE); while (tvb_reported_length_remaining(tvb, offset) > 0) { lastoffset = offset; switch (fTagNo(tvb, offset)) { case 0: offset = fContextTaggedError(tvb, pinfo, tree, offset); break; case 1: offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); offset = fBACnetObjectPropertyReference(tvb, pinfo, tree, offset); offset += fTagHeaderTree(tvb, pinfo, tree, offset, &tag_no, &tag_info, &lvt); break; default: return offset; } if (offset == lastoffset) break; } return offset; }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* hmac_sha1 - HMAC-SHA1 over data buffer (RFC 2104) @key: Key for HMAC operations @key_len: Length of the key in bytes @data: Pointers to the data area @data_len: Length of the data area @mac: Buffer for the hash (20 bytes) Returns: 0 on success, -1 of failure */
int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len, u8 *mac)
/* hmac_sha1 - HMAC-SHA1 over data buffer (RFC 2104) @key: Key for HMAC operations @key_len: Length of the key in bytes @data: Pointers to the data area @data_len: Length of the data area @mac: Buffer for the hash (20 bytes) Returns: 0 on success, -1 of failure */ int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len, u8 *mac)
{ return hmac_sha1_vector(key, key_len, 1, &data, &data_len, mac); }
retro-esp32/RetroESP32
C++
Creative Commons Attribution Share Alike 4.0 International
581
/* @dev: Device to access @buffer: Data buffer @buflen: Length of the buffer. @rw: True to write. */
static unsigned int octeon_cf_data_xfer8(struct ata_device *dev, unsigned char *buffer, unsigned int buflen, int rw)
/* @dev: Device to access @buffer: Data buffer @buflen: Length of the buffer. @rw: True to write. */ static unsigned int octeon_cf_data_xfer8(struct ata_device *dev, unsigned char *buffer, unsigned int buflen, int rw)
{ struct ata_port *ap = dev->link->ap; void __iomem *data_addr = ap->ioaddr.data_addr; unsigned long words; int count; words = buflen; if (rw) { count = 16; while (words--) { iowrite8(*buffer, data_addr); buffer++; if (--count == 0) { ioread8(ap->ioaddr.altstatus_addr); count = 16; } } } else { ioread8_rep(data_addr, buffer, words); } return buflen; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Function for setting payload for ANT message and sending it. */
static void ant_message_send(ant_bsc_profile_t *p_profile)
/* Function for setting payload for ANT message and sending it. */ static void ant_message_send(ant_bsc_profile_t *p_profile)
{ uint8_t p_message_payload[ANT_STANDARD_DATA_PAYLOAD_SIZE]; uint32_t err_code; sens_message_encode(p_profile, p_message_payload); err_code = sd_ant_broadcast_message_tx(p_profile->channel_number, sizeof(p_message_payload), p_message_payload); APP_ERROR_CHECK(err_code); }
labapart/polymcu
C++
null
201
/* Enable polarity inversion of the selected IO pin(s). */
void stmpe1600_IO_PolarityInv_Enable(uint16_t DeviceAddr, uint32_t IO_Pin)
/* Enable polarity inversion of the selected IO pin(s). */ void stmpe1600_IO_PolarityInv_Enable(uint16_t DeviceAddr, uint32_t IO_Pin)
{ uint8_t tmpData[2] = {0 , 0}; IOE_ReadMultiple(DeviceAddr, STMPE1600_REG_GPPIR, tmpData, 2); tmp = ((uint16_t)tmpData[0] | (((uint16_t)tmpData[1]) << 8)); tmp |= (uint16_t)IO_Pin; IOE_WriteMultiple(DeviceAddr, STMPE1600_REG_GPPIR, (uint8_t *)&tmp, 2); }
eclipse-threadx/getting-started
C++
Other
310
/* USB Device Request - Status In Stage Parameters: None Return Value: None */
void USBD_StatusInStage(void)
/* USB Device Request - Status In Stage Parameters: None Return Value: None */ void USBD_StatusInStage(void)
{ USBD_WriteEP(0x80, NULL, 0); }
ARMmbed/DAPLink
C++
Apache License 2.0
2,140
/* Checks whether the Tamper Pin Interrupt has occurred or not. */
INTStatus BKP_GetTINTFlag(void)
/* Checks whether the Tamper Pin Interrupt has occurred or not. */ INTStatus BKP_GetTINTFlag(void)
{ return (INTStatus)(*(__IO uint32_t*)CTRLSTS_TINTF_BB); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* this function is called by ZCL foundation dissector in order to decode specific cluster attributes data. */
static void dissect_zcl_gp_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id _U_, guint data_type)
/* this function is called by ZCL foundation dissector in order to decode specific cluster attributes data. */ static void dissect_zcl_gp_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, guint16 attr_id _U_, guint data_type)
{ dissect_zcl_attr_data(tvb, tree, offset, data_type); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* Return the value of the Timer Configuration Register. This reads and returns the value of the Timer Configuration Register of Timer #0. */
static uint32_t hpet_timer_conf_get(void)
/* Return the value of the Timer Configuration Register. This reads and returns the value of the Timer Configuration Register of Timer #0. */ static uint32_t hpet_timer_conf_get(void)
{ return sys_read32(TIMER0_CONF_REG); }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* sets the port maximum Tx and Rx frame sizes This function is fully documented in the main header file, IxEthDB.h. */
IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFilteringPortMaximumFrameSizeSet(IxEthDBPortId portID, UINT32 maximumFrameSize)
/* sets the port maximum Tx and Rx frame sizes This function is fully documented in the main header file, IxEthDB.h. */ IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFilteringPortMaximumFrameSizeSet(IxEthDBPortId portID, UINT32 maximumFrameSize)
{ IX_ETH_DB_CHECK_PORT_EXISTS(portID); IX_ETH_DB_CHECK_SINGLE_NPE(portID); if (!ixEthDBPortInfo[portID].initialized) { return IX_ETH_DB_PORT_UNINITIALIZED; } if (ixEthDBPortDefinitions[portID].type == IX_ETH_NPE) { if ((maximumFrameSize < IX_ETHDB_MIN_NPE_FRAME_SIZE) || (maximumFrameSize > IX_ETHDB_MAX_NPE_FRAME_SIZE)) { return IX_ETH_DB_INVALID_ARG; } } else { return IX_ETH_DB_NO_PERMISSION; } ixEthDBPortInfo[portID].maxRxFrameSize = maximumFrameSize; ixEthDBPortInfo[portID].maxTxFrameSize = maximumFrameSize; return ixEthDBPortFrameLengthsUpdate(portID); }
EmcraftSystems/u-boot
C++
Other
181
/* Enable the Capture of the PWM module. The */
void PWMCAPEnable(unsigned long ulBase, unsigned long ulChannel)
/* Enable the Capture of the PWM module. The */ void PWMCAPEnable(unsigned long ulBase, unsigned long ulChannel)
{ unsigned long ulChannelTemp; ulChannelTemp = ulChannel; xASSERT((ulBase == PWMA_BASE) || (ulBase == PWMB_BASE)); xASSERT(((ulChannelTemp >= 0) || (ulChannelTemp <= 5))); xHWREG(ulBase + PWM_CAPCTL) |=(1 << ulChannelTemp); }
coocox/cox
C++
Berkeley Software Distribution (BSD)
104
/* Displays the code value as a character, not its ASCII value, as would be done by BASE_DEC and friends. */
static void format_reject_reason(char *buf, guint32 value)
/* Displays the code value as a character, not its ASCII value, as would be done by BASE_DEC and friends. */ static void format_reject_reason(char *buf, guint32 value)
{ g_snprintf(buf, ITEM_LABEL_LENGTH, "%s (%c)", val_to_str_const(value, ouch_reject_reason_val, "Unknown"), value); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* This is called to remove the extended CEX2A driver information if an AP device is removed. */
static void zcrypt_cex2a_remove(struct ap_device *ap_dev)
/* This is called to remove the extended CEX2A driver information if an AP device is removed. */ static void zcrypt_cex2a_remove(struct ap_device *ap_dev)
{ struct zcrypt_device *zdev = ap_dev->private; zcrypt_device_unregister(zdev); }
robutest/uclinux
C++
GPL-2.0
60
/* Gets current timer count. This function returns the current timer value */
uint32_t tmrHw_GetCurrentCount(tmrHw_ID_t timerId)
/* Gets current timer count. This function returns the current timer value */ uint32_t tmrHw_GetCurrentCount(tmrHw_ID_t timerId)
{ switch (pTmrHw[timerId].Control & tmrHw_CONTROL_MODE_MASK) { case tmrHw_CONTROL_FREE_RUNNING: if (pTmrHw[timerId].CurrentValue) { return tmrHw_MAX_COUNT - pTmrHw[timerId].CurrentValue; } break; case tmrHw_CONTROL_PERIODIC: case tmrHw_CONTROL_ONESHOT: return pTmrHw[timerId].BackgroundLoad - pTmrHw[timerId].CurrentValue; } return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* Determines if there are any characters in the receive FIFO. */
bool UARTCharsAvail(uint32_t ui32Base)
/* Determines if there are any characters in the receive FIFO. */ bool UARTCharsAvail(uint32_t ui32Base)
{ ASSERT(_UARTBaseValid(ui32Base)); return((HWREG(ui32Base + UART_O_FR) & UART_FR_RXFE) ? false : true); }
feaser/openblt
C++
GNU General Public License v3.0
601
/* Compare function used by qsort(). Compare function used by qsort(). */
INT32 CompareFuncUint64(CONST VOID *Left, CONST VOID *Right)
/* Compare function used by qsort(). Compare function used by qsort(). */ INT32 CompareFuncUint64(CONST VOID *Left, CONST VOID *Right)
{ INT64 Delta; Delta = (*(UINT64 *)Left - *(UINT64 *)Right); if (Delta > 0) { return 1; } else if (Delta == 0) { return 0; } else { return -1; } }
tianocore/edk2
C++
Other
4,240
/* TBD - . get rid of unnecessary memsets */
u16 fc_logo_rsp_parse(struct fchs_s *fchs, int len)
/* TBD - . get rid of unnecessary memsets */ u16 fc_logo_rsp_parse(struct fchs_s *fchs, int len)
{ struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1); len = len; if (els_cmd->els_code != FC_ELS_ACC) return FC_PARSE_FAILURE; return FC_PARSE_OK; }
robutest/uclinux
C++
GPL-2.0
60
/* EDMA callback function for FLEXIO SPI receive transfer. */
static void FLEXIO_SPI_RxEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds)
/* EDMA callback function for FLEXIO SPI receive transfer. */ static void FLEXIO_SPI_RxEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds)
{ tcds = tcds; flexio_spi_master_edma_private_handle_t *spiPrivateHandle = (flexio_spi_master_edma_private_handle_t *)param; if (transferDone) { FLEXIO_SPI_EnableDMA(spiPrivateHandle->base, (uint32_t)kFLEXIO_SPI_RxDmaEnable, false); spiPrivateHandle->handle->rxInProgress = false; if ((spiPrivateHandle->handle->txInProgress == false) && (spiPrivateHandle->handle->rxInProgress == false)) { if (spiPrivateHandle->handle->callback != NULL) { (spiPrivateHandle->handle->callback)(spiPrivateHandle->base, spiPrivateHandle->handle, kStatus_Success, spiPrivateHandle->handle->userData); } } } }
eclipse-threadx/getting-started
C++
Other
310
/* downloads the firewall address table to an NPE Note that this function is documented in the main component header file, IxEthDB.h. */
IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFirewallTableDownload(IxEthDBPortId portID)
/* downloads the firewall address table to an NPE Note that this function is documented in the main component header file, IxEthDB.h. */ IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBFirewallTableDownload(IxEthDBPortId portID)
{ IxEthDBPortMap query; IxEthDBStatus result; IX_ETH_DB_CHECK_PORT(portID); IX_ETH_DB_CHECK_SINGLE_NPE(portID); IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_FIREWALL); SET_DEPENDENCY_MAP(query, portID); ixEthDBUpdateLock(); ixEthDBPortInfo[portID].updateMethod.searchTree = ixEthDBQuery(NULL, query, IX_ETH_DB_FIREWALL_RECORD, MAX_FW_SIZE); result = ixEthDBNPEUpdateHandler(portID, IX_ETH_DB_FIREWALL_RECORD); ixEthDBUpdateUnlock(); return result; }
EmcraftSystems/u-boot
C++
Other
181
/* Increment the link count on an inode & log the change. */
int xfs_bumplink(xfs_trans_t *tp, xfs_inode_t *ip)
/* Increment the link count on an inode & log the change. */ int xfs_bumplink(xfs_trans_t *tp, xfs_inode_t *ip)
{ if (ip->i_d.di_nlink >= XFS_MAXLINK) return XFS_ERROR(EMLINK); xfs_ichgtime(ip, XFS_ICHGTIME_CHG); ASSERT(ip->i_d.di_nlink > 0); ip->i_d.di_nlink++; inc_nlink(VFS_I(ip)); if ((ip->i_d.di_version == 1) && (ip->i_d.di_nlink > XFS_MAXLINK_1)) { xfs_bump_ino_vers2(tp, ip); } xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); return 0; }
robutest/uclinux
C++
GPL-2.0
60
/* Attribute write call back for the Descriptor V8D2 attribute. */
static ssize_t write_des_v8d2(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags)
/* Attribute write call back for the Descriptor V8D2 attribute. */ static ssize_t write_des_v8d2(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags)
{ uint8_t *value = attr->user_data; if (offset >= sizeof(des_v8d2_value)) return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET); if (offset + len > sizeof(des_v8d2_value)) return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN); if (!bAuthorized) return BT_GATT_ERR(BT_ATT_ERR_AUTHORIZATION); memcpy(value + offset, buf, len); return len; }
zephyrproject-rtos/zephyr
C++
Apache License 2.0
9,573
/* Change Logs: Date Author Notes Kyle First version Raman Gopalan Move UART specific code sections into the drv_uart files Raman Gopalan Initialize GPIO sub-system Raman Gopalan Initialize software I2C sub-system System tick interrupt handler. */
static void rt_hw_timer_handler(void)
/* Change Logs: Date Author Notes Kyle First version Raman Gopalan Move UART specific code sections into the drv_uart files Raman Gopalan Initialize GPIO sub-system Raman Gopalan Initialize software I2C sub-system System tick interrupt handler. */ static void rt_hw_timer_handler(void)
{ Set_system_register(AVR32_COMPARE, FCPU / RT_TICK_PER_SECOND); rt_tick_increase(); }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* brief Return Frequency of 32kHz osc return Frequency of 32kHz osc */
static uint32_t CLOCK_GetOsc32KFreq(uint32_t id)
/* brief Return Frequency of 32kHz osc return Frequency of 32kHz osc */ static uint32_t CLOCK_GetOsc32KFreq(uint32_t id)
{ return ((SCG0->ROSCCSR & SCG_ROSCCSR_ROSCVLD_MASK) != 0UL) ? (((VBAT0->OSCCLKE & VBAT_OSCCLKE_CLKE(id)) != 0UL) ? s_Xtal32_Freq : 0U) : 0U; }
RT-Thread/rt-thread
C++
Apache License 2.0
9,535
/* Returns: The page allocated, or NULL on error. */
void* ring_buffer_alloc_read_page(struct ring_buffer *buffer)
/* Returns: The page allocated, or NULL on error. */ void* ring_buffer_alloc_read_page(struct ring_buffer *buffer)
{ struct buffer_data_page *bpage; unsigned long addr; addr = __get_free_page(GFP_KERNEL); if (!addr) return NULL; bpage = (void *)addr; rb_init_page(bpage); return bpage; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* brcmf_btcoex_params_read() - read btc_params firmware variable @ifp: interface @addr: btc_params register number @data: read data */
static s32 brcmf_btcoex_params_read(struct brcmf_if *ifp, u32 addr, u32 *data)
/* brcmf_btcoex_params_read() - read btc_params firmware variable @ifp: interface @addr: btc_params register number @data: read data */ static s32 brcmf_btcoex_params_read(struct brcmf_if *ifp, u32 addr, u32 *data)
{ *data = addr; return brcmf_fil_iovar_int_get(ifp, "btc_params", data); }
seemoo-lab/nexmon
C++
GNU General Public License v3.0
2,330
/* USBD_CtlReceiveStatus receive zero lzngth packet on the ctl pipe. */
USBD_StatusTypeDef USBD_CtlReceiveStatus(USBD_HandleTypeDef *pdev)
/* USBD_CtlReceiveStatus receive zero lzngth packet on the ctl pipe. */ USBD_StatusTypeDef USBD_CtlReceiveStatus(USBD_HandleTypeDef *pdev)
{ pdev->ep0_state = USBD_EP0_STATUS_OUT; USBD_LL_PrepareReceive ( pdev, 0, NULL, 0); return USBD_OK; }
micropython/micropython
C++
Other
18,334
/* Routine: wait_for_command_complete Description: Wait for posting to finish on watchdog */
void wait_for_command_complete(struct watchdog *wd_base)
/* Routine: wait_for_command_complete Description: Wait for posting to finish on watchdog */ void wait_for_command_complete(struct watchdog *wd_base)
{ int pending = 1; do { pending = readl(&wd_base->wwps); } while (pending); }
4ms/stm32mp1-baremetal
C++
Other
137
/* Scrolling stop. This function stop the text scrolling. */
void xpro_lcd_text_scrolling_stop(void)
/* Scrolling stop. This function stop the text scrolling. */ void xpro_lcd_text_scrolling_stop(void)
{ xpro_lcd_automated_char_stop(); }
memfault/zero-to-main
C++
null
200
/* TIM MSP De-Initialization This function frees the hardware resources used in this example: */
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim)
/* TIM MSP De-Initialization This function frees the hardware resources used in this example: */ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim)
{ __HAL_RCC_TIM6_FORCE_RESET(); __HAL_RCC_TIM6_RELEASE_RESET(); }
STMicroelectronics/STM32CubeF4
C++
Other
789
/* Retrieves the total capacity of the ACL fragment pool (always 1). */
int ble_hs_hci_frag_num_mbufs(void)
/* Retrieves the total capacity of the ACL fragment pool (always 1). */ int ble_hs_hci_frag_num_mbufs(void)
{ return ble_hs_hci_frag_mempool.mp_num_blocks; }
Nicholas3388/LuaNode
C++
Other
1,055
/* Return the battery temperature in Celsius degrees Or < 0 if something fails. */
static int bq27x00_battery_temperature(struct bq27x00_device_info *di)
/* Return the battery temperature in Celsius degrees Or < 0 if something fails. */ static int bq27x00_battery_temperature(struct bq27x00_device_info *di)
{ int ret; int temp = 0; ret = bq27x00_read(BQ27x00_REG_TEMP, &temp, 0, di); if (ret) { dev_err(di->dev, "error reading temperature\n"); return ret; } return (temp >> 2) - 273; }
robutest/uclinux
C++
GPL-2.0
60
/* check that the auxilliary data indicates that the entry is still valid */
static enum fscache_checkaux afs_cell_cache_check_aux(void *cookie_netfs_data, const void *buffer, uint16_t buflen)
/* check that the auxilliary data indicates that the entry is still valid */ static enum fscache_checkaux afs_cell_cache_check_aux(void *cookie_netfs_data, const void *buffer, uint16_t buflen)
{ _leave(" = OKAY"); return FSCACHE_CHECKAUX_OKAY; }
robutest/uclinux
C++
GPL-2.0
60
/* If 32-bit operations are not supported, then ASSERT(). If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). */
UINT32 EFIAPI BitFieldOr32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 OrData)
/* If 32-bit operations are not supported, then ASSERT(). If StartBit is greater than 31, then ASSERT(). If EndBit is greater than 31, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). */ UINT32 EFIAPI BitFieldOr32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 OrData)
{ ASSERT (EndBit < 32); ASSERT (StartBit <= EndBit); return (UINT32)InternalBaseLibBitFieldOrUint (Operand, StartBit, EndBit, OrData); }
tianocore/edk2
C++
Other
4,240
/* set_ep0state - Set ep0 automata state @dev: udc device @state: state */
static void set_ep0state(struct pxa_udc *udc, int state)
/* set_ep0state - Set ep0 automata state @dev: udc device @state: state */ static void set_ep0state(struct pxa_udc *udc, int state)
{ struct pxa_ep *ep = &udc->pxa_ep[0]; char *old_stname = EP0_STNAME(udc); udc->ep0state = state; ep_dbg(ep, "state=%s->%s, udccsr0=0x%03x, udcbcr=%d\n", old_stname, EP0_STNAME(udc), udc_ep_readl(ep, UDCCSR), udc_ep_readl(ep, UDCBCR)); }
robutest/uclinux
C++
GPL-2.0
60
/* RETURNS: New target map allocation length if extension is necessary, 0 otherwise. */
static int pcpu_need_to_extend(struct pcpu_chunk *chunk)
/* RETURNS: New target map allocation length if extension is necessary, 0 otherwise. */ static int pcpu_need_to_extend(struct pcpu_chunk *chunk)
{ int new_alloc; if (chunk->map_alloc >= chunk->map_used + 2) return 0; new_alloc = PCPU_DFL_MAP_ALLOC; while (new_alloc < chunk->map_used + 2) new_alloc *= 2; return new_alloc; }
robutest/uclinux
C++
GPL-2.0
60
/* If 8-bit MMIO register operations are not supported, then ASSERT(). If StartBit is greater than 7, then ASSERT(). If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). */
UINT8 EFIAPI MmioBitFieldWrite8(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 Value)
/* If 8-bit MMIO register operations are not supported, then ASSERT(). If StartBit is greater than 7, then ASSERT(). If EndBit is greater than 7, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). */ UINT8 EFIAPI MmioBitFieldWrite8(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 Value)
{ return MmioWrite8 ( Address, BitFieldWrite8 (MmioRead8 (Address), StartBit, EndBit, Value) ); }
tianocore/edk2
C++
Other
4,240
/* HID class driver callback function for the creation of HID reports to the host. */
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo, uint8_t *const ReportID, const uint8_t ReportType, void *ReportData, uint16_t *const ReportSize)
/* HID class driver callback function for the creation of HID reports to the host. */ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t *const HIDInterfaceInfo, uint8_t *const ReportID, const uint8_t ReportType, void *ReportData, uint16_t *const ReportSize)
{ uint8_t* Data = (uint8_t*)ReportData; Data[0] = (uint8_t)XMC_GPIO_GetInput(LED1); Data[1] = (uint8_t)XMC_GPIO_GetInput(LED2); *ReportSize = GENERIC_REPORT_SIZE; return false; }
remotemcu/remcu-chip-sdks
C++
null
436
/* Flush the range of kernel virtual adddress space from the I-cache. The corresponding range must be purged from the D-cache also because the SH-5 doesn't have cache snooping between the caches. The addresses will be visible through the superpage mapping, therefore it's guaranteed that there no cache entries for the range in cache sets of the wrong colour. */
static void sh5_flush_icache_range(void *args)
/* Flush the range of kernel virtual adddress space from the I-cache. The corresponding range must be purged from the D-cache also because the SH-5 doesn't have cache snooping between the caches. The addresses will be visible through the superpage mapping, therefore it's guaranteed that there no cache entries for the range in cache sets of the wrong colour. */ static void sh5_flush_icache_range(void *args)
{ struct flusher_data *data = args; unsigned long start, end; start = data->addr1; end = data->addr2; __flush_purge_region((void *)start, end); wmb(); sh64_icache_inv_kernel_range(start, end); }
EmcraftSystems/linux-emcraft
C++
Other
266
/* This kind of situation is recoverable, but it is easier to just pretend we had a FIFO underrun, since there is a good chance it will happen anyway. This is */
static int ni_ao_fifo_half_empty(struct comedi_device *dev, struct comedi_subdevice *s)
/* This kind of situation is recoverable, but it is easier to just pretend we had a FIFO underrun, since there is a good chance it will happen anyway. This is */ static int ni_ao_fifo_half_empty(struct comedi_device *dev, struct comedi_subdevice *s)
{ int n; n = comedi_buf_read_n_available(s->async); if (n == 0) { s->async->events |= COMEDI_CB_OVERFLOW; return 0; } n /= sizeof(short); if (n > boardtype.ao_fifo_depth / 2) n = boardtype.ao_fifo_depth / 2; ni_ao_fifo_load(dev, s, n); s->async->events |= COMEDI_CB_BLOCK; return 1; }
robutest/uclinux
C++
GPL-2.0
60
/* Negotiate additional BOF characters. This is a type 1 parameter and will be negotiated independently for each station. */
static int irlap_param_additional_bofs(void *instance, irda_param_t *parm, int get)
/* Negotiate additional BOF characters. This is a type 1 parameter and will be negotiated independently for each station. */ static int irlap_param_additional_bofs(void *instance, irda_param_t *parm, int get)
{ struct irlap_cb *self = (struct irlap_cb *) instance; IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == LAP_MAGIC, return -1;); if (get) param->pv.i = self->qos_rx.additional_bofs.bits; else self->qos_tx.additional_bofs.bits = (__u8) param->pv.i; return 0; }
EmcraftSystems/linux-emcraft
C++
Other
266
/* If Address > 0x0FFFFFFF, then ASSERT(). If Address is not aligned on a 16-bit boundary, then ASSERT(). */
UINT16 EFIAPI PciAnd16(IN UINTN Address, IN UINT16 AndData)
/* If Address > 0x0FFFFFFF, then ASSERT(). If Address is not aligned on a 16-bit boundary, then ASSERT(). */ UINT16 EFIAPI PciAnd16(IN UINTN Address, IN UINT16 AndData)
{ return mRunningOnQ35 ? PciExpressAnd16 (Address, AndData) : PciCf8And16 (Address, AndData); }
tianocore/edk2
C++
Other
4,240