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 |
|---|---|---|---|---|---|---|---|
/* Registers an interrupt handler for an individual pin of a GPIO port. */ | void GPIOIntRegisterPin(uint32_t ui32Port, uint32_t ui32Pin, void(*pfnIntHandler)(void)) | /* Registers an interrupt handler for an individual pin of a GPIO port. */
void GPIOIntRegisterPin(uint32_t ui32Port, uint32_t ui32Pin, void(*pfnIntHandler)(void)) | {
uint32_t ui32Int;
ASSERT((ui32Port == GPIO_PORTP_BASE) || (ui32Port == GPIO_PORTQ_BASE));
ASSERT((ui32Pin > 0) && (ui32Pin < 8));
ASSERT(pfnIntHandler != 0);
ui32Int = _GPIOIntNumberGet(ui32Port);
IntRegister((ui32Int + ui32Pin), pfnIntHandler);
IntEnable(ui32Int + ui32Pin);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Note, this function does not add the @node object to LNC directly, but allocates a copy of the object and adds the copy to LNC. The reason for this is that @node has been allocated outside of the TNC subsystem and will be used with */ | static int lnc_add(struct ubifs_info *c, struct ubifs_zbranch *zbr, const void *node) | /* Note, this function does not add the @node object to LNC directly, but allocates a copy of the object and adds the copy to LNC. The reason for this is that @node has been allocated outside of the TNC subsystem and will be used with */
static int lnc_add(struct ubifs_info *c, struct ubifs_zbranch *zbr, const void *n... | {
int err;
void *lnc_node;
const struct ubifs_dent_node *dent = node;
ubifs_assert(!zbr->leaf);
ubifs_assert(zbr->len != 0);
ubifs_assert(is_hash_key(c, &zbr->key));
err = ubifs_validate_entry(c, dent);
if (err) {
dbg_dump_stack();
dbg_dump_node(c, dent);
return err;
}
lnc_node = kmalloc(zbr->len, GFP_N... | EmcraftSystems/u-boot | C++ | Other | 181 |
/* If AesContext is NULL, then return FALSE. If Key is NULL, then return FALSE. If KeyLength is not valid, then return FALSE. */ | BOOLEAN EFIAPI AesInit(OUT VOID *AesContext, IN CONST UINT8 *Key, IN UINTN KeyLength) | /* If AesContext is NULL, then return FALSE. If Key is NULL, then return FALSE. If KeyLength is not valid, then return FALSE. */
BOOLEAN EFIAPI AesInit(OUT VOID *AesContext, IN CONST UINT8 *Key, IN UINTN KeyLength) | {
AES_KEY *AesKey;
if ((AesContext == NULL) || (Key == NULL) || ((KeyLength != 128) && (KeyLength != 192) && (KeyLength != 256))) {
return FALSE;
}
AesKey = (AES_KEY *)AesContext;
if (AES_set_encrypt_key (Key, (UINT32)KeyLength, AesKey) != 0) {
return FALSE;
}
if (AES_set_decrypt_key (Key, (UINT3... | tianocore/edk2 | C++ | Other | 4,240 |
/* After a card is removed, orinoco_cs_release() will unregister the device, and release the PCMCIA configuration. If the device is still open, this will be postponed until it is closed. */ | static void orinoco_cs_release(struct pcmcia_device *link) | /* After a card is removed, orinoco_cs_release() will unregister the device, and release the PCMCIA configuration. If the device is still open, this will be postponed until it is closed. */
static void orinoco_cs_release(struct pcmcia_device *link) | {
struct orinoco_private *priv = link->priv;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
priv->hw_unavailable++;
spin_unlock_irqrestore(&priv->lock, flags);
pcmcia_disable_device(link);
if (priv->hw.iobase)
ioport_unmap(priv->hw.iobase);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* search for 'objidx' in table at index -1. return 1 + string at top if find a good name. */ | static int findfield(lua_State *L, int objidx, int level) | /* search for 'objidx' in table at index -1. return 1 + string at top if find a good name. */
static int findfield(lua_State *L, int objidx, int level) | {
if (lua_type(L, -2) == LUA_TSTRING) {
if (lua_rawequal(L, objidx, -1)) {
lua_pop(L, 1);
return 1;
}
else if (findfield(L, objidx, level - 1)) {
lua_remove(L, -2);
lua_pushliteral(L, ".");
lua_insert(L, -2);
lua_concat(L, 3);
return 1;
... | opentx/opentx | C++ | GNU General Public License v2.0 | 2,025 |
/* De-select the given device on the SPI bus. */ | void usart_spi_deselect_device(Usart *p_usart, struct usart_spi_device *device) | /* De-select the given device on the SPI bus. */
void usart_spi_deselect_device(Usart *p_usart, struct usart_spi_device *device) | {
UNUSED(device);
usart_spi_release_chip_select(p_usart);
} | memfault/zero-to-main | C++ | null | 200 |
/* Enable the Low Speed APB (APB1) peripheral clock. */ | void RCM_EnableAPB1PeriphClock(uint32_t APB1Periph) | /* Enable the Low Speed APB (APB1) peripheral clock. */
void RCM_EnableAPB1PeriphClock(uint32_t APB1Periph) | {
RCM->APB1CLKEN |= APB1Periph;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Configures the voltage threshold detected by the Power Voltage Detector(PVD). */ | void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel) | /* Configures the voltage threshold detected by the Power Voltage Detector(PVD). */
void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel) | {
uint32_t tmpreg = 0;
assert_param(IS_PWR_PVD_LEVEL(PWR_PVDLevel));
tmpreg = PWR->CR;
tmpreg &= CR_PLS_Mask;
tmpreg |= PWR_PVDLevel;
PWR->CR = tmpreg;
} | ajhc/demo-cortex-m3 | C++ | null | 38 |
/* Determine if a file name represents a unicode file. */ | EFI_STATUS IsUnicodeFile(IN CONST CHAR16 *FileName) | /* Determine if a file name represents a unicode file. */
EFI_STATUS IsUnicodeFile(IN CONST CHAR16 *FileName) | {
SHELL_FILE_HANDLE Handle;
EFI_STATUS Status;
UINT64 OriginalFilePosition;
UINTN CharSize;
CHAR16 CharBuffer;
Status = gEfiShellProtocol->OpenFileByName (FileName, &Handle, EFI_FILE_MODE_READ);
if (EFI_ERROR (Status)) {
return (Status);
}
gEfiShellPro... | tianocore/edk2 | C++ | Other | 4,240 |
/* The PWMA default IRQ, declared in StartUp code. */ | void PWM0CH1_IRQHandler(void) | /* The PWMA default IRQ, declared in StartUp code. */
void PWM0CH1_IRQHandler(void) | {
unsigned long ulPWMStastus;
unsigned long ulBase = PWMA_BASE;
ulPWMStastus = xHWREG(ulBase + PWM_INTSTS) & 0x02020202;
xHWREG(ulBase + PWM_INTSTS) = ulPWMStastus;
if (g_pfnPWMHandlerCallbacks[0] != 0)
{
if(ulPWMStastus & 0x0202)
{
g_pfnPWMHandlerCallbacks[0](0, PWM_... | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Completes the Map() operation and releases any corresponding resources. */ | EFI_STATUS EFIAPI PciIoUnmap(IN EFI_PCI_IO_PROTOCOL *This, IN VOID *Mapping) | /* Completes the Map() operation and releases any corresponding resources. */
EFI_STATUS EFIAPI PciIoUnmap(IN EFI_PCI_IO_PROTOCOL *This, IN VOID *Mapping) | {
EFI_STATUS Status;
PCI_IO_DEVICE *PciIoDevice;
PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);
if (mIoMmuProtocol != NULL) {
mIoMmuProtocol->SetAttribute (
mIoMmuProtocol,
PciIoDevice->Handle,
Mapping,
0
... | tianocore/edk2 | C++ | Other | 4,240 |
/* UART MSP Initialization This function configures the hardware resources used in this example. */ | void HAL_UART_MspInit(UART_HandleTypeDef *huart) | /* UART MSP Initialization This function configures the hardware resources used in this example. */
void HAL_UART_MspInit(UART_HandleTypeDef *huart) | {
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(huart->Instance==USART1)
{
__HAL_RCC_USART1_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_14|GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* ZigBee Device Profile dissector for the binding table */ | void dissect_zbee_zdp_req_mgmt_bind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) | /* ZigBee Device Profile dissector for the binding table */
void dissect_zbee_zdp_req_mgmt_bind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) | {
guint offset = 0; zbee_parse_uint(tree, hf_zbee_zdp_index, tvb, &offset, 1, NULL);
zdp_dump_excess(tvb, offset, pinfo, tree);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* USBH_CtlSendData Sends a data Packet to the Device. */ | USBH_StatusTypeDef USBH_CtlSendData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t pipe_num, uint8_t do_ping) | /* USBH_CtlSendData Sends a data Packet to the Device. */
USBH_StatusTypeDef USBH_CtlSendData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t pipe_num, uint8_t do_ping) | {
if(phost->device.speed != USBH_SPEED_HIGH)
{
do_ping = 0;
}
USBH_LL_SubmitURB (phost,
pipe_num,
0,
USBH_EP_CONTROL,
USBH_PID_DATA,
buff,
... | micropython/micropython | C++ | Other | 18,334 |
/* Given a wmem scope, a tvbuff, an offset, and a length, treat the string of bytes referred to by the tvbuff, offset, and length as a string encoded in EBCDIC using one octet per character, and return a pointer to a UTF-8 string, allocated using the wmem scope. */ | static guint8* tvb_get_ebcdic_string(wmem_allocator_t *scope, tvbuff_t *tvb, gint offset, gint length) | /* Given a wmem scope, a tvbuff, an offset, and a length, treat the string of bytes referred to by the tvbuff, offset, and length as a string encoded in EBCDIC using one octet per character, and return a pointer to a UTF-8 string, allocated using the wmem scope. */
static guint8* tvb_get_ebcdic_string(wmem_allocator_t... | {
const guint8 *ptr;
ptr = ensure_contiguous(tvb, offset, length);
return get_ebcdic_string(scope, ptr, length);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Called by the PCI code when it finds an ITE821x controller. We then use the IDE PCI generic helper to do most of the work. */ | static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | /* Called by the PCI code when it finds an ITE821x controller. We then use the IDE PCI generic helper to do most of the work. */
static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | {
struct it821x_dev *itdevs;
int rc;
itdevs = kzalloc(2 * sizeof(*itdevs), GFP_KERNEL);
if (itdevs == NULL) {
printk(KERN_ERR DRV_NAME " %s: out of memory\n", pci_name(dev));
return -ENOMEM;
}
itdevs->quirks = id->driver_data;
rc = ide_pci_init_one(dev, &it821x_chipset, itdevs);
if (rc)
kfree(itdevs);
re... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Called when a scan on a wiphy finds a beacon on new channel */ | static void wiphy_update_new_beacon(struct wiphy *wiphy, struct reg_beacon *reg_beacon) | /* Called when a scan on a wiphy finds a beacon on new channel */
static void wiphy_update_new_beacon(struct wiphy *wiphy, struct reg_beacon *reg_beacon) | {
unsigned int i;
struct ieee80211_supported_band *sband;
assert_cfg80211_lock();
if (!wiphy->bands[reg_beacon->chan.band])
return;
sband = wiphy->bands[reg_beacon->chan.band];
for (i = 0; i < sband->n_channels; i++)
handle_reg_beacon(wiphy, i, reg_beacon);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* ADC MSP De-Initialization This function freeze the hardware resources used in this example. */ | void HAL_ADC_MspDeInit(ADC_HandleTypeDef *hadc) | /* ADC MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_ADC_MspDeInit(ADC_HandleTypeDef *hadc) | {
if(hadc->Instance==ADC1)
{
__HAL_RCC_ADC1_CLK_DISABLE();
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Enable/Disable the interrupt of a User Reset (USRTS bit in RSTC_RST). */ | void RSTC_SetUserResetInterruptEnable(unsigned char enable) | /* Enable/Disable the interrupt of a User Reset (USRTS bit in RSTC_RST). */
void RSTC_SetUserResetInterruptEnable(unsigned char enable) | {
unsigned int rmr = AT91C_BASE_RSTC->RSTC_RMR & (~AT91C_RSTC_KEY);
if (enable) {
rmr |= AT91C_RSTC_URSTIEN;
}
else {
rmr &= ~AT91C_RSTC_URSTIEN;
}
AT91C_BASE_RSTC->RSTC_RMR = rmr | RSTC_KEY_PASSWORD;
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* For setting up all the kmem_list3s for cache whose buffer_size is same as size of */ | static void __init set_up_list3s(struct kmem_cache *cachep, int index) | /* For setting up all the kmem_list3s for cache whose buffer_size is same as size of */
static void __init set_up_list3s(struct kmem_cache *cachep, int index) | {
int node;
for_each_online_node(node) {
cachep->nodelists[node] = &initkmem_list3[index + node];
cachep->nodelists[node]->next_reap = jiffies +
REAPTIMEOUT_LIST3 +
((unsigned long)cachep) % REAPTIMEOUT_LIST3;
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Setup a USART in SPI mode device.
The returned device descriptor structure must be passed to the driver whenever that device should be used as current slave device. */ | void usart_spi_setup_device(USART_t *usart, struct usart_spi_device *device, spi_flags_t flags, unsigned long baud_rate, board_spi_select_id_t sel_id) | /* Setup a USART in SPI mode device.
The returned device descriptor structure must be passed to the driver whenever that device should be used as current slave device. */
void usart_spi_setup_device(USART_t *usart, struct usart_spi_device *device, spi_flags_t flags, unsigned long baud_rate, board_spi_select_id_t sel_i... | {
usart_spi_options_t opt;
opt.baudrate = baud_rate;
opt.spimode = flags;
opt.data_order = false;
usart_init_spi(usart, &opt);
} | memfault/zero-to-main | C++ | null | 200 |
/* Globally enable interrupts.
This function globally enables interrupts. This is performed by setting the 'I' bit in the CPU's Processor Status Word (PSW) register. */ | void R_BSP_InterruptsEnable(void) | /* Globally enable interrupts.
This function globally enables interrupts. This is performed by setting the 'I' bit in the CPU's Processor Status Word (PSW) register. */
void R_BSP_InterruptsEnable(void) | {
uint32_t pmode;
pmode = (R_BSP_GET_PSW() & 0x00100000);
if (0 == pmode)
{
R_BSP_SETPSW_I();
}
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* This waits to be signaled for completion of a specific task. It can be interrupted by a kill signal. */ | int __sched wait_for_completion_killable(struct completion *x) | /* This waits to be signaled for completion of a specific task. It can be interrupted by a kill signal. */
int __sched wait_for_completion_killable(struct completion *x) | {
long t = wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_KILLABLE);
if (t == -ERESTARTSYS)
return t;
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Obtains the total number of segments in the linked list with firmware data. */ | uint32_t FirmwareGetSegmentCount(void) | /* Obtains the total number of segments in the linked list with firmware data. */
uint32_t FirmwareGetSegmentCount(void) | {
tFirmwareSegment * currentSegment;
uint32_t segmentCount = 0;
if (segmentList != NULL)
{
currentSegment = segmentList;
do
{
segmentCount++;
currentSegment = currentSegment->next;
}
while (currentSegment != NULL);
}
return segmentCount;
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* param base CASPER base address param signature first addend (in little endian format) param pubN modulus (in little endian format) param wordLen Size of pubN in bytes param pubE exponent param plaintext Output array to store result of operation (in little endian format) */ | void CASPER_ModExp(CASPER_Type *base, const uint8_t *signature, const uint8_t *pubN, size_t wordLen, uint32_t pubE, uint8_t *plaintext) | /* param base CASPER base address param signature first addend (in little endian format) param pubN modulus (in little endian format) param wordLen Size of pubN in bytes param pubE exponent param plaintext Output array to store result of operation (in little endian format) */
void CASPER_ModExp(CASPER_Type *base, cons... | {
#define PK_LOC &msg_ret[kCASPER_RamOffset_Modulus]
#define SIG_LOC &msg_ret[(unsigned)kCASPER_RamOffset_Modulus + N_wordlen_max]
N_wordlen = wordLen;
CASPER_MEMCPY_N2I(PK_LOC, (const uint32_t *)(uintptr_t)pubN, N_bytelen);
CASPER_MEMCPY_N2I(SIG_LOC, (const uint32_t *)(uintptr_t)signature, N_bytelen);
... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This function will clear feature for the endpoint of the usb device. */ | rt_err_t rt_usb_clear_feature(uinst_t uinst, int endpoint, int feature) | /* This function will clear feature for the endpoint of the usb device. */
rt_err_t rt_usb_clear_feature(uinst_t uinst, int endpoint, int feature) | {
struct ureqest setup;
int timeout = 100;
RT_ASSERT(uinst != RT_NULL);
setup.request_type = USB_REQ_TYPE_DIR_OUT | USB_REQ_TYPE_STANDARD |
USB_REQ_TYPE_ENDPOINT;
setup.request = USB_REQ_CLEAR_FEATURE;
setup.index = endpoint;
setup.length = 0;
setup.value = feature;
if(rt_us... | armink/FreeModbus_Slave-Master-RTT-STM32 | C++ | Other | 1,477 |
/* Release a dquot. Flush it if dirty, then dqput() it. dquot must not be locked. */ | void xfs_qm_dqrele(xfs_dquot_t *dqp) | /* Release a dquot. Flush it if dirty, then dqput() it. dquot must not be locked. */
void xfs_qm_dqrele(xfs_dquot_t *dqp) | {
if (!dqp)
return;
trace_xfs_dqrele(dqp);
xfs_dqlock(dqp);
xfs_qm_dqput(dqp);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Check if Target argument to EXT_SCSI_PASS_THRU.GetNextTarget() and EXT_SCSI_PASS_THRU.GetNextTargetLun() is initialized */ | STATIC BOOLEAN IsTargetInitialized(IN UINT8 *Target) | /* Check if Target argument to EXT_SCSI_PASS_THRU.GetNextTarget() and EXT_SCSI_PASS_THRU.GetNextTargetLun() is initialized */
STATIC BOOLEAN IsTargetInitialized(IN UINT8 *Target) | {
UINTN Idx;
for (Idx = 0; Idx < TARGET_MAX_BYTES; ++Idx) {
if (Target[Idx] != 0xFF) {
return TRUE;
}
}
return FALSE;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Deinitializes the DAC peripheral registers to their default reset values. */ | void DAC_DeInit(void) | /* Deinitializes the DAC peripheral registers to their default reset values. */
void DAC_DeInit(void) | {
exRCC_APB1PeriphReset(RCC_APB1ENR_DAC);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* param base DCDC peripheral base address. param config Pointer to configuration structure. See to "dcdc_min_power_config_t". */ | void DCDC_SetMinPowerConfig(DCDC_Type *base, const dcdc_min_power_config_t *config) | /* param base DCDC peripheral base address. param config Pointer to configuration structure. See to "dcdc_min_power_config_t". */
void DCDC_SetMinPowerConfig(DCDC_Type *base, const dcdc_min_power_config_t *config) | {
assert(NULL != config);
uint32_t tmp32;
tmp32 = base->REG3 & ~DCDC_REG3_MINPWR_DC_HALFCLK_MASK;
if (config->enableUseHalfFreqForContinuous)
{
tmp32 |= DCDC_REG3_MINPWR_DC_HALFCLK_MASK;
}
base->REG3 = tmp32;
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Parse the FFS and find the GUID address. There may be multiple Guids matching the searched Guid. */ | EFI_STATUS GetAddressByGuid(IN VOID *Ffs, IN EFI_GUID *Guid, IN UINTN Length, OUT UINTN **Offset, OUT UINT8 *NumOfMatchingGuid) | /* Parse the FFS and find the GUID address. There may be multiple Guids matching the searched Guid. */
EFI_STATUS GetAddressByGuid(IN VOID *Ffs, IN EFI_GUID *Guid, IN UINTN Length, OUT UINTN **Offset, OUT UINT8 *NumOfMatchingGuid) | {
UINTN LoopControl;
BOOLEAN Found;
if ((Ffs == NULL) || (Guid == NULL) || (Length == 0)) {
return EFI_NOT_FOUND;
}
if (NumOfMatchingGuid != NULL) {
*NumOfMatchingGuid = 0;
}
Found = FALSE;
for (LoopControl = 0; LoopControl < Length; LoopControl++) {
if (CompareGuid (Guid, (EFI_GUID *)((... | tianocore/edk2 | C++ | Other | 4,240 |
/* Gets the direction and mode of a pin. */ | unsigned long GPIODirModeGet(unsigned long ulPort, unsigned long ulBit) | /* Gets the direction and mode of a pin. */
unsigned long GPIODirModeGet(unsigned long ulPort, unsigned long ulBit) | {
xASSERT(GPIOBaseValid(ulPort));
xASSERT(ulBit < 16);
return ((xHWREG(ulPort + GPIO_PDDR) >> ulBit) & 0x00000001);
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Configure the timer to generate an interrupt in the specified amount of ticks */ | static int clockevent_tmr_set_next_event(unsigned long delta, struct clock_event_device *c) | /* Configure the timer to generate an interrupt in the specified amount of ticks */
static int clockevent_tmr_set_next_event(unsigned long delta, struct clock_event_device *c) | {
unsigned long flags;
raw_local_irq_save(flags);
kinetis_pit_init(KINETIS_CLOCKEVENT_PIT, delta);
kinetis_pit_enable(KINETIS_CLOCKEVENT_PIT, 1);
raw_local_irq_restore(flags);
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Loads user key to INDATA register.
This function writes user key stored in handle into HashCrypt INDATA register. */ | static void hashcrypt_aes_load_userKey(HASHCRYPT_Type *base, hashcrypt_handle_t *handle) | /* Loads user key to INDATA register.
This function writes user key stored in handle into HashCrypt INDATA register. */
static void hashcrypt_aes_load_userKey(HASHCRYPT_Type *base, hashcrypt_handle_t *handle) | {
size_t keySize = 0;
switch (handle->keySize)
{
case kHASHCRYPT_Aes128:
keySize = 16;
break;
case kHASHCRYPT_Aes192:
keySize = 24;
break;
case kHASHCRYPT_Aes256:
keySize = 32;
break;
default:
... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Convert an mbuf address, a CPU local virtual address, to a physical address as seen from a PCI device. Store the result at paddr. */ | void MM_MapRxDma(PLM_DEVICE_BLOCK pDevice, struct _LM_PACKET *pPacket, T3_64BIT_HOST_ADDR *paddr) | /* Convert an mbuf address, a CPU local virtual address, to a physical address as seen from a PCI device. Store the result at paddr. */
void MM_MapRxDma(PLM_DEVICE_BLOCK pDevice, struct _LM_PACKET *pPacket, T3_64BIT_HOST_ADDR *paddr) | {
PUM_PACKET pUmPacket = (PUM_PACKET) pPacket;
MM_SetT3Addr (paddr, (dma_addr_t) pUmPacket->skbuff);
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* If Length is not aligned on a 32-bit boundary, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). */ | UINT32* EFIAPI S3MmioReadBuffer32(IN UINTN StartAddress, IN UINTN Length, OUT UINT32 *Buffer) | /* If Length is not aligned on a 32-bit boundary, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). */
UINT32* EFIAPI S3MmioReadBuffer32(IN UINTN StartAddress, IN UINTN Length, OUT UINT32 *Buffer) | {
UINT32 *ReturnBuffer;
RETURN_STATUS Status;
ReturnBuffer = MmioReadBuffer32 (StartAddress, Length, Buffer);
Status = S3BootScriptSaveMemWrite (
S3BootScriptWidthUint32,
StartAddress,
Length / sizeof (UINT32),
ReturnBuffer
);
ASSERT (S... | tianocore/edk2 | C++ | Other | 4,240 |
/* Check if program or erase operation is completed in current operation. */ | static uint32_t check_status(const struct nand_flash_raw *raw) | /* Check if program or erase operation is completed in current operation. */
static uint32_t check_status(const struct nand_flash_raw *raw) | {
uint32_t status;
smc_nfc_send_command(SMC,
NFCADDR_CMD_NFCCMD |
NFCADDR_CMD_NFC_READ |
0 |
NFCADDR_CMD_CSID(BOARD_NAND_CS) |
NFCADDR_CMD_ACYCLE_NONE |
(NAND_COMMAND_STATUS << 2),
0,
0
);
status = READ_DATA8(raw);
if (((status & NAND... | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Get timebase clock frequency (like cpu_clk in Hz) */ | unsigned long get_tbclk(void) | /* Get timebase clock frequency (like cpu_clk in Hz) */
unsigned long get_tbclk(void) | {
return (gd->bus_clk + 3L) / 4L;
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* ep - endpoint number length - number of bytes to read from FIFO fifo_data - pointer to data buffer into which data is read */ | __attribute__((weak)) | /* ep - endpoint number length - number of bytes to read from FIFO fifo_data - pointer to data buffer into which data is read */
__attribute__((weak)) | {
u8 *data = (u8 *)fifo_data;
writeb(ep, &musbr->index);
while (length--)
writeb(*data++, &musbr->fifox[ep]);
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* If the pointer to the HOB list is NULL, then ASSERT(). */ | VOID* EFIAPI GetFirstHob(IN UINT16 Type) | /* If the pointer to the HOB list is NULL, then ASSERT(). */
VOID* EFIAPI GetFirstHob(IN UINT16 Type) | {
VOID *HobList;
HobList = GetHobList ();
return GetNextHob (Type, HobList);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Set the flow control scheme.
Set the flow control scheme by enabling or disabling RTS and CTS lines. This will only have effect if the given UART supports the RTS and CTS lines. */ | void uart_set_flow_control(uint32_t uart, enum uart_flowctl flow) | /* Set the flow control scheme.
Set the flow control scheme by enabling or disabling RTS and CTS lines. This will only have effect if the given UART supports the RTS and CTS lines. */
void uart_set_flow_control(uint32_t uart, enum uart_flowctl flow) | {
uint32_t reg32 = UART_CTL(uart);
reg32 &= ~(UART_CTL_RTSEN | UART_CTL_CTSEN);
if (flow == UART_FLOWCTL_RTS) {
reg32 |= UART_CTL_RTSEN;
} else if (flow == UART_FLOWCTL_CTS) {
reg32 |= UART_CTL_CTSEN;
} else if (flow == UART_FLOWCTL_RTS_CTS) {
reg32 |= (UART_CTL_RTSEN | UART_CTL_CTSEN);
}
UART_CTL(uart) = ... | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* param base ASRC base pointer. param handle ASRC eDMA handle pointer. */ | void ASRC_TransferInAbortEDMA(ASRC_Type *base, asrc_edma_handle_t *handle) | /* param base ASRC base pointer. param handle ASRC eDMA handle pointer. */
void ASRC_TransferInAbortEDMA(ASRC_Type *base, asrc_edma_handle_t *handle) | {
assert(handle != NULL);
EDMA_AbortTransfer(handle->in.inDmaHandle);
handle->in.asrcQueue[handle->in.queueDriver] = NULL;
handle->in.queueDriver = (handle->in.queueDriver + 1U) % ASRC_XFER_QUEUE_SIZE;
handle->in.state = kStatus_ASRCIdle;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Information regarding the number of caches and their sizes, frequency of operation, slot numbers is all considered platform-related information and is not provided by this service. */ | STATIC EFI_STATUS EFIAPI GetProcessorInfo(IN EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorIndex, OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer) | /* Information regarding the number of caches and their sizes, frequency of operation, slot numbers is all considered platform-related information and is not provided by this service. */
STATIC EFI_STATUS EFIAPI GetProcessorInfo(IN EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorIndex, OUT EFI_PROCESSOR_INFORMATION *... | {
if (ProcessorInfoBuffer == NULL) {
return EFI_INVALID_PARAMETER;
}
if (!IsCurrentProcessorBSP ()) {
return EFI_DEVICE_ERROR;
}
ProcessorIndex &= ~CPU_V2_EXTENDED_TOPOLOGY;
if (ProcessorIndex >= mCpuMpData.NumberOfProcessors) {
return EFI_NOT_FOUND;
}
CopyMem (
ProcessorInfoBuffer,
... | tianocore/edk2 | C++ | Other | 4,240 |
/* A platform can also define platform specific Class values as a properly generated EFI_GUID would never conflict with this specification. */ | EFI_STATUS EFIAPI BootManagerPolicyConnectDeviceClass(IN EFI_BOOT_MANAGER_POLICY_PROTOCOL *This, IN EFI_GUID *Class) | /* A platform can also define platform specific Class values as a properly generated EFI_GUID would never conflict with this specification. */
EFI_STATUS EFIAPI BootManagerPolicyConnectDeviceClass(IN EFI_BOOT_MANAGER_POLICY_PROTOCOL *This, IN EFI_GUID *Class) | {
if (EfiGetCurrentTpl () != TPL_APPLICATION) {
return EFI_UNSUPPORTED;
}
if (CompareGuid (Class, &gEfiBootManagerPolicyConnectAllGuid)) {
ConnectAllAndCreateNetworkDeviceList ();
return EFI_SUCCESS;
}
if (CompareGuid (Class, &gEfiBootManagerPolicyConsoleGuid)) {
return EfiBootManagerConnectAl... | tianocore/edk2 | C++ | Other | 4,240 |
/* Pauses and resumes playing on the audio codec. */ | static uint32_t Codec_PauseResume(uint32_t Cmd) | /* Pauses and resumes playing on the audio codec. */
static uint32_t Codec_PauseResume(uint32_t Cmd) | {
uint32_t counter = 0;
if (Cmd == AUDIO_PAUSE)
{
counter += Codec_Mute(AUDIO_MUTE_ON);
counter += Codec_WriteRegister(0x02, 0x01);
}
else
{
counter += Codec_Mute(AUDIO_MUTE_OFF);
counter += Codec_WriteRegister(0x04, OutputDev);
counter += Codec_WriteRegister(0x02, 0x9E);
}
... | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Return if this CapsuleGuid is a FMP capsule GUID or not. */ | BOOLEAN IsFmpCapsuleGuid(IN EFI_GUID *CapsuleGuid) | /* Return if this CapsuleGuid is a FMP capsule GUID or not. */
BOOLEAN IsFmpCapsuleGuid(IN EFI_GUID *CapsuleGuid) | {
if (CompareGuid (&gEfiFmpCapsuleGuid, CapsuleGuid)) {
return TRUE;
}
return FALSE;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Usb interrupt enable/disable Parameters: ena: enable/disable 0: disable interrupt 1: enable interrupt */ | static void reset_state(void) | /* Usb interrupt enable/disable Parameters: ena: enable/disable 0: disable interrupt 1: enable interrupt */
static void reset_state(void) | {
unsigned int ep;
suspended = 0;
setup_waiting = 0;
ep0_expect_zlp = 0;
memset(ep_info, 0, sizeof(ep_info));
MXC_USB->ep[0] |= (MXC_S_USB_EP_DIR_CONTROL | MXC_F_USB_EP_INT_EN | MXC_F_USB_EP_DT);
for (ep = 1; ep < MXC_USB_NUM_EP; ep++) {
MXC_USB->ep[ep] = MXC_F_USB_EP_DT;
}
} | ARMmbed/DAPLink | C++ | Apache License 2.0 | 2,140 |
/* SPI3 interrupt handler. Clear the SPI interrupt flag and execute the callback function.
The */ | void xSPISSSet(unsigned long ulBase, unsigned long ulSSMode, unsigned long ulSlaveSel) | /* SPI3 interrupt handler. Clear the SPI interrupt flag and execute the callback function.
The */
void xSPISSSet(unsigned long ulBase, unsigned long ulSSMode, unsigned long ulSlaveSel) | {
xASSERT((ulBase == SPI0_BASE) || (ulBase == SPI1_BASE)||
(ulBase == SPI2_BASE)||(ulBase == SPI3_BASE) );
xASSERT((ulSlaveSel == SPI_SS_NONE) || (ulSlaveSel == SPI_SS0) ||
(ulSlaveSel == SPI_SS1) || (ulSlaveSel == SPI_SS0_SS1));
xHWREG(ulBase + SPI_SSR) |= ulSSMode;
xHWREG(ulBas... | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* this makes the board clean up everything that it can and not talk to the outside world. Caused by an 'ifconfig ethX down' */ | static int smc_close(struct net_device *dev) | /* this makes the board clean up everything that it can and not talk to the outside world. Caused by an 'ifconfig ethX down' */
static int smc_close(struct net_device *dev) | {
struct smc_local *lp = netdev_priv(dev);
DBG(2, "%s: %s\n", dev->name, __func__);
netif_stop_queue(dev);
netif_carrier_off(dev);
smc_shutdown(dev);
tasklet_kill(&lp->tx_task);
smc_phy_powerdown(dev);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Returns 1 if media name is valid, otherwise 0. */ | static int media_name_valid(const char *name) | /* Returns 1 if media name is valid, otherwise 0. */
static int media_name_valid(const char *name) | {
u32 len;
len = strlen(name);
if ((len + 1) > TIPC_MAX_MEDIA_NAME)
return 0;
return (strspn(name, tipc_alphabet) == len);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Here the chapter D FD-field of the system-journal is decoded. */ | static int decode_sj_chapter_d_fd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset) | /* Here the chapter D FD-field of the system-journal is decoded. */
static int decode_sj_chapter_d_fd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned int offset) | {
proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_count, tvb, offset, 1, ENC_BIG_ENDIAN );
offset++;
fdlength--;
}
if ( fdflags & RTP_MIDI_SJ_CHAPTER_D_SYSREAL_FLAG_L ) {
proto_tree_add_item( rtp_midi_field_tree, hf_rtp_midi_sj_chapter_d_sysreal_legal, tvb, offset, fdlength, ENC_NA ... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* this will take the oldest urb from an anchor, unanchor and return it */ | struct urb* usb_get_from_anchor(struct usb_anchor *anchor) | /* this will take the oldest urb from an anchor, unanchor and return it */
struct urb* usb_get_from_anchor(struct usb_anchor *anchor) | {
struct urb *victim;
unsigned long flags;
spin_lock_irqsave(&anchor->lock, flags);
if (!list_empty(&anchor->urb_list)) {
victim = list_entry(anchor->urb_list.next, struct urb,
anchor_list);
usb_get_urb(victim);
spin_unlock_irqrestore(&anchor->lock, flags);
usb_unanchor_urb(victim);
} else {
spin... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* create a mute-switch and a volume for normal stereo/mono controls */ | static int snd_ac97_cmix_new_stereo(struct snd_card *card, const char *pfx, int reg, int check_stereo, int check_amix, struct snd_ac97 *ac97) | /* create a mute-switch and a volume for normal stereo/mono controls */
static int snd_ac97_cmix_new_stereo(struct snd_card *card, const char *pfx, int reg, int check_stereo, int check_amix, struct snd_ac97 *ac97) | {
int err;
char name[44];
unsigned char lo_max, hi_max;
if (! snd_ac97_valid_reg(ac97, reg))
return 0;
if (snd_ac97_try_bit(ac97, reg, 15)) {
sprintf(name, "%s Switch", pfx);
if ((err = snd_ac97_cmute_new_stereo(card, name, reg,
check_stereo, check_amix,
ac97)) < 0)
return err;
}
c... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Description: This function implements combined transactions. Combined transactions consist of combinations of reading and writing blocks of data. FROM THE SAME ADDRESS Each transfer (i.e. a read or a write) is separated by a repeated start condition. */ | static int iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg *pmsg) | /* Description: This function implements combined transactions. Combined transactions consist of combinations of reading and writing blocks of data. FROM THE SAME ADDRESS Each transfer (i.e. a read or a write) is separated by a repeated start condition. */
static int iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap,... | {
struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data;
int rc;
rc = iop3xx_i2c_send_target_addr(iop3xx_adap, pmsg);
if (rc < 0) {
return rc;
}
if ((pmsg->flags&I2C_M_RD)) {
return iop3xx_i2c_readbytes(i2c_adap, pmsg->buf, pmsg->len);
} else {
return iop3xx_i2c_writebytes(i2c_adap, pmsg->buf, pms... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This routine notifies the tty driver that it resume sending characters to the tty device. */ | void ircomm_tty_start(struct tty_struct *tty) | /* This routine notifies the tty driver that it resume sending characters to the tty device. */
void ircomm_tty_start(struct tty_struct *tty) | {
struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
ircomm_flow_request(self->ircomm, FLOW_START);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Returns the encryption state of the specified virtual address range. */ | MEM_ENCRYPT_SEV_ADDRESS_RANGE_STATE EFIAPI MemEncryptSevGetAddressRangeState(IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, IN UINTN Length) | /* Returns the encryption state of the specified virtual address range. */
MEM_ENCRYPT_SEV_ADDRESS_RANGE_STATE EFIAPI MemEncryptSevGetAddressRangeState(IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, IN UINTN Length) | {
return InternalMemEncryptSevGetAddressRangeState (
Cr3BaseAddress,
BaseAddress,
Length
);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* To avoid duplicating clock code, allow machine driver to get the clockrate from here. */ | u32 s3c24xx_i2s_get_clockrate(void) | /* To avoid duplicating clock code, allow machine driver to get the clockrate from here. */
u32 s3c24xx_i2s_get_clockrate(void) | {
return clk_get_rate(s3c24xx_i2s.iis_clk);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Return the current position of the pointer (on the screen). */ | u16 POINTER_GetPos(void) | /* Return the current position of the pointer (on the screen). */
u16 POINTER_GetPos(void) | {
return ( POINTER_Info.xPos | ( POINTER_Info.yPos << 8 ) );
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Used to remove interrupts statically setup by the early boot process. */ | void remove_irq(unsigned int irq, struct irqaction *act) | /* Used to remove interrupts statically setup by the early boot process. */
void remove_irq(unsigned int irq, struct irqaction *act) | {
__free_irq(irq, act->dev_id);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Returns CR_OK, upon successful completion, an error code otherwise. */ | enum CRStatus cr_sel_eng_register_pseudo_class_sel_handler(CRSelEng *a_this, guchar *a_name, enum CRPseudoType a_type, CRPseudoClassSelectorHandler a_handler) | /* Returns CR_OK, upon successful completion, an error code otherwise. */
enum CRStatus cr_sel_eng_register_pseudo_class_sel_handler(CRSelEng *a_this, guchar *a_name, enum CRPseudoType a_type, CRPseudoClassSelectorHandler a_handler) | {
struct CRPseudoClassSelHandlerEntry *handler_entry = NULL;
GList *list = NULL;
g_return_val_if_fail (a_this && PRIVATE (a_this)
&& a_handler && a_name, CR_BAD_PARAM_ERROR);
handler_entry = g_try_malloc
(sizeof (struct CRPseudoClassSelHandle... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* This function calculates the checksum for the Packet, utilizing the pre-calculated pseudo HeadSum to reduce some overhead. */ | UINT16 Udp6Checksum(IN NET_BUF *Packet, IN UINT16 HeadSum) | /* This function calculates the checksum for the Packet, utilizing the pre-calculated pseudo HeadSum to reduce some overhead. */
UINT16 Udp6Checksum(IN NET_BUF *Packet, IN UINT16 HeadSum) | {
UINT16 Checksum;
Checksum = NetbufChecksum (Packet);
Checksum = NetAddChecksum (Checksum, HeadSum);
Checksum = NetAddChecksum (Checksum, HTONS ((UINT16)Packet->TotalSize));
Checksum = (UINT16)(~Checksum);
return Checksum;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Enables or disables the mute feature on the audio codec. */ | int32_t CS42L51_SetMute(CS42L51_Object_t *pObj, uint32_t Cmd) | /* Enables or disables the mute feature on the audio codec. */
int32_t CS42L51_SetMute(CS42L51_Object_t *pObj, uint32_t Cmd) | {
int32_t ret;
uint8_t tmp;
ret = cs42l51_read_reg(&pObj->Ctx, CS42L51_DAC_OUTPUT_CTRL, &tmp, 1);
if (Cmd == CS42L51_MUTE_ON)
{
tmp |= 0x03U;
}
else
{
tmp &= 0xFCU;
}
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_OUTPUT_CTRL, &tmp, 1);
if (ret != CS42L51_OK)
{
ret = CS42L51_ERROR;... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Returns CR_OK upon successfull completion, an error code otherwise. */ | enum CRStatus cr_doc_handler_get_ctxt(CRDocHandler *a_this, gpointer *a_ctxt) | /* Returns CR_OK upon successfull completion, an error code otherwise. */
enum CRStatus cr_doc_handler_get_ctxt(CRDocHandler *a_this, gpointer *a_ctxt) | {
g_return_val_if_fail (a_this && a_this->priv, CR_BAD_PARAM_ERROR);
*a_ctxt = a_this->priv->context;
return CR_OK;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Change the direction of a GPIO pin to output and set the level on this pin. */ | static int a2f_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int level) | /* Change the direction of a GPIO pin to output and set the level on this pin. */
static int a2f_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int level) | {
struct a2f_gpio_chip *a2f_chip
= container_of(chip, struct a2f_gpio_chip, chip);
u32 gpio_cfg;
unsigned long f;
spin_lock_irqsave(&a2f_chip->lock, f);
gpio_cfg = readl(A2F_GPIO_CFG(a2f_chip->gpio_cfg, gpio));
gpio_cfg |= GPIO_OUT_REG_EN | GPIO_OUT_BUF_EN;
gpio_cfg &= ~(GPIO_IN_REG_EN);
writel(0, A2F_GPIO_CF... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Call xfs_mru_cache_flush() to flush out all cached entries, calling their free functions as they're deleted. When this function returns, the caller is guaranteed that all the free functions for all the elements have finished executing and the reaper is not running. */ | void xfs_mru_cache_flush(xfs_mru_cache_t *mru) | /* Call xfs_mru_cache_flush() to flush out all cached entries, calling their free functions as they're deleted. When this function returns, the caller is guaranteed that all the free functions for all the elements have finished executing and the reaper is not running. */
void xfs_mru_cache_flush(xfs_mru_cache_t *mru) | {
if (!mru || !mru->lists)
return;
spin_lock(&mru->lock);
if (mru->queued) {
spin_unlock(&mru->lock);
cancel_rearming_delayed_workqueue(xfs_mru_reap_wq, &mru->work);
spin_lock(&mru->lock);
}
_xfs_mru_cache_migrate(mru, jiffies + mru->grp_count * mru->grp_time);
_xfs_mru_cache_clear_reap_list(mru);
spin_u... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Returns the resulting prop list, or NULL if an error occured */ | CRPropList* cr_prop_list_append(CRPropList *a_this, CRPropList *a_to_append) | /* Returns the resulting prop list, or NULL if an error occured */
CRPropList* cr_prop_list_append(CRPropList *a_this, CRPropList *a_to_append) | {
CRPropList *cur = NULL;
g_return_val_if_fail (a_to_append, NULL);
if (!a_this)
return a_to_append;
for (cur = a_this;
cur && PRIVATE (cur) && PRIVATE (cur)->next;
cur = PRIVATE (cur)->next) ;
g_return_val_if_fail (cur, NULL);
PR... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* If the pointer given is not NULL, VariablePolicyVariableNameBufferSize must be non-NULL. */ | STATIC EFI_STATUS EFIAPI ProtocolGetVariablePolicyInfo(IN CONST CHAR16 *VariableName, IN CONST EFI_GUID *VendorGuid, IN OUT UINTN *VariablePolicyVariableNameBufferSize, OPTIONAL OUT VARIABLE_POLICY_ENTRY *VariablePolicy, OUT CHAR16 *VariablePolicyVariableName OPTIONAL) | /* If the pointer given is not NULL, VariablePolicyVariableNameBufferSize must be non-NULL. */
STATIC EFI_STATUS EFIAPI ProtocolGetVariablePolicyInfo(IN CONST CHAR16 *VariableName, IN CONST EFI_GUID *VendorGuid, IN OUT UINTN *VariablePolicyVariableNameBufferSize, OPTIONAL OUT VARIABLE_POLICY_ENTRY *VariablePolicy, OUT ... | {
return InternalProtocolGetVariablePolicyInfo (
VAR_CHECK_POLICY_COMMAND_GET_INFO,
VariableName,
VendorGuid,
VariablePolicyVariableNameBufferSize,
VariablePolicy,
VariablePolicyVariableName
);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Check to see if there is a request that has data to send, and if so make an attempt to write data into the FIFO. */ | static int s3c_hsotg_trytx(struct s3c_hsotg *hsotg, struct s3c_hsotg_ep *hs_ep) | /* Check to see if there is a request that has data to send, and if so make an attempt to write data into the FIFO. */
static int s3c_hsotg_trytx(struct s3c_hsotg *hsotg, struct s3c_hsotg_ep *hs_ep) | {
struct s3c_hsotg_req *hs_req = hs_ep->req;
if (!hs_ep->dir_in || !hs_req) {
if (hs_ep->index != 0)
s3c_hsotg_ctrl_epint(hsotg, hs_ep->index,
hs_ep->dir_in, 0);
return 0;
}
if (hs_req->req.actual < hs_req->req.length) {
dev_dbg(hsotg->dev, "trying to write more for ep%d\n",
hs_ep->index);
r... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Called when the PCI registration layer (or the IDE initialization) finds a device matching our IDE device tables. */ | static int __devinit svwks_init_one(struct pci_dev *dev, const struct pci_device_id *id) | /* Called when the PCI registration layer (or the IDE initialization) finds a device matching our IDE device tables. */
static int __devinit svwks_init_one(struct pci_dev *dev, const struct pci_device_id *id) | {
struct ide_port_info d;
u8 idx = id->driver_data;
d = serverworks_chipsets[idx];
if (idx == 1)
d.host_flags |= IDE_HFLAG_CLEAR_SIMPLEX;
else if (idx == 2 || idx == 3) {
if ((PCI_FUNC(dev->devfn) & 1) == 0) {
if (pci_resource_start(dev, 0) != 0x01f1)
d.host_flags |= IDE_HFLAG_NON_BOOTABLE;
d.host_fl... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* SATA interface between low level driver and command layer */ | static int sata_read(fsl_sata_t *sata, ulong blknr, lbaint_t blkcnt, void *buffer) | /* SATA interface between low level driver and command layer */
static int sata_read(fsl_sata_t *sata, ulong blknr, lbaint_t blkcnt, void *buffer) | {
u32 rc;
if (sata->lba48)
rc = ata_low_level_rw_lba48(sata, blknr, blkcnt, buffer,
READ_CMD);
else
rc = ata_low_level_rw_lba28(sata, blknr, blkcnt, buffer,
READ_CMD);
return rc;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* This function replaces the original HibernateEnable() API and performs the same actions. A macro is provided in */ | void HibernateEnableExpClk(unsigned long ulHibClk) | /* This function replaces the original HibernateEnable() API and performs the same actions. A macro is provided in */
void HibernateEnableExpClk(unsigned long ulHibClk) | {
HWREG(HIB_CTL) |= HIB_CTL_CLK32EN;
if(CLASS_IS_FURY)
{
g_ulWriteDelay = (((ulHibClk / 1000) * DELAY_USECS) /
(1000L * LOOP_CYCLES));
g_ulWriteDelay++;
}
else
{
HibernateWriteComplete();
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* If Address > 0x0FFFFFFF, then ASSERT(). If Address is not aligned on a 32-bit boundary, then ASSERT(). */ | UINT32 EFIAPI PciWrite32(IN UINTN Address, IN UINT32 Value) | /* If Address > 0x0FFFFFFF, then ASSERT(). If Address is not aligned on a 32-bit boundary, then ASSERT(). */
UINT32 EFIAPI PciWrite32(IN UINTN Address, IN UINT32 Value) | {
return mRunningOnQ35 ?
PciExpressWrite32 (Address, Value) :
PciCf8Write32 (Address, Value);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Description: Reads the status register and returns 0 either if auto-negotiation is incomplete, or if there was an error. Returns BMSR_ANEGCOMPLETE if auto-negotiation is done. */ | static int phy_aneg_done(struct phy_device *phydev) | /* Description: Reads the status register and returns 0 either if auto-negotiation is incomplete, or if there was an error. Returns BMSR_ANEGCOMPLETE if auto-negotiation is done. */
static int phy_aneg_done(struct phy_device *phydev) | {
int retval;
retval = phy_read(phydev, MII_BMSR);
return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Returns the number of contiguous clusters that can be used for an allocating write, but require COW to be performed (this includes yet unallocated space, which must copy from the backing file) */ | static int count_cow_clusters(BDRVQcowState *s, int nb_clusters, uint64_t *l2_table, int l2_index) | /* Returns the number of contiguous clusters that can be used for an allocating write, but require COW to be performed (this includes yet unallocated space, which must copy from the backing file) */
static int count_cow_clusters(BDRVQcowState *s, int nb_clusters, uint64_t *l2_table, int l2_index) | {
int i;
for (i = 0; i < nb_clusters; i++) {
uint64_t l2_entry = be64_to_cpu(l2_table[l2_index + i]);
int cluster_type = qcow2_get_cluster_type(l2_entry);
switch(cluster_type) {
case QCOW2_CLUSTER_NORMAL:
if (l2_entry & QCOW_OFLAG_COPIED) {
goto out;
... | ve3wwg/teensy3_qemu | C++ | Other | 15 |
/* Internal Function. Allocate n pages from given free page node. */ | UINTN InternalAllocPagesOnOneNode(IN OUT FREE_PAGE_LIST *Pages, IN UINTN NumberOfPages, IN UINTN MaxAddress) | /* Internal Function. Allocate n pages from given free page node. */
UINTN InternalAllocPagesOnOneNode(IN OUT FREE_PAGE_LIST *Pages, IN UINTN NumberOfPages, IN UINTN MaxAddress) | {
UINTN Top;
UINTN Bottom;
FREE_PAGE_LIST *Node;
Top = TRUNCATE_TO_PAGES (MaxAddress + 1 - (UINTN)Pages);
if (Top > Pages->NumberOfPages) {
Top = Pages->NumberOfPages;
}
Bottom = Top - NumberOfPages;
if (Top < Pages->NumberOfPages) {
Node = (FREE_PAGE_LIST *)(... | tianocore/edk2 | C++ | Other | 4,240 |
/* If Address > 0x0FFFFFFF, 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 AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). If OrData is larger than the bitmask val... | UINT8 EFIAPI PciExpressBitFieldAndThenOr8(IN UINTN Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData, IN UINT8 OrData) | /* If Address > 0x0FFFFFFF, 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 AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). If OrData is larger than the bitmask val... | {
ASSERT_INVALID_PCI_ADDRESS (Address);
if (Address >= PcdPciExpressBaseSize ()) {
return (UINT8)-1;
}
return MmioBitFieldAndThenOr8 (
(UINTN)GetPciExpressBaseAddress () + Address,
StartBit,
EndBit,
AndData,
OrData
);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Enables or disables the selected DAC channel wave generation. */ | void DAC_WaveGenerationCmd(emDACCH_TypeDef channel, emDACWAVE_TypeDef wave, FunctionalState state) | /* Enables or disables the selected DAC channel wave generation. */
void DAC_WaveGenerationCmd(emDACCH_TypeDef channel, emDACWAVE_TypeDef wave, FunctionalState state) | {
(state) ? (DAC->CR |= wave << channel) : (DAC->CR &= ~(wave << channel));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Fills each init_struct member with its default value. */ | void GPIO_StructInit(GPIO_InitTypeDef *init_struct) | /* Fills each init_struct member with its default value. */
void GPIO_StructInit(GPIO_InitTypeDef *init_struct) | {
init_struct->GPIO_Pin = GPIO_Pin_All;
init_struct->GPIO_Speed = GPIO_Speed_2MHz;
init_struct->GPIO_Mode = GPIO_Mode_FLOATING;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This function converts ATA device model name from ATA identify data to a string in ATA device structure. It needs to change the character order in the original model name string. */ | VOID PrintAtaModelName(IN OUT ATA_DEVICE *AtaDevice) | /* This function converts ATA device model name from ATA identify data to a string in ATA device structure. It needs to change the character order in the original model name string. */
VOID PrintAtaModelName(IN OUT ATA_DEVICE *AtaDevice) | {
UINTN Index;
CHAR8 *Source;
CHAR16 *Destination;
Source = AtaDevice->IdentifyData->ModelName;
Destination = AtaDevice->ModelName;
for (Index = 0; Index < MAX_MODEL_NAME_LEN; Index += 2) {
Destination[Index] = Source[Index + 1];
Destination[Index + 1] = Source[Index];
}
AtaDevice-... | tianocore/edk2 | C++ | Other | 4,240 |
/* pdcs_autosearch_read - Stable Storage autoboot flag output. @buf: The output buffer to write to. */ | static ssize_t pdcs_autosearch_read(struct kobject *kobj, struct kobj_attribute *attr, char *buf) | /* pdcs_autosearch_read - Stable Storage autoboot flag output. @buf: The output buffer to write to. */
static ssize_t pdcs_autosearch_read(struct kobject *kobj, struct kobj_attribute *attr, char *buf) | {
return pdcs_auto_read(kobj, attr, buf, PF_AUTOSEARCH);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* PCI functions for Integrator This routine handles multiple bridges. */ | static u8 __init integrator_swizzle(struct pci_dev *dev, u8 *pinp) | /* PCI functions for Integrator This routine handles multiple bridges. */
static u8 __init integrator_swizzle(struct pci_dev *dev, u8 *pinp) | {
int pin = *pinp;
if (pin == 0)
pin = 1;
while (dev->bus->self) {
pin = pci_swizzle_interrupt_pin(dev, pin);
dev = dev->bus->self;
}
*pinp = pin;
return PCI_SLOT(dev->devfn);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* this function is quite liberal in what it accepts, as 'luaO_str2num' will reject ill-formed numerals. */ | static int read_numeral(LexState *ls, SemInfo *seminfo) | /* this function is quite liberal in what it accepts, as 'luaO_str2num' will reject ill-formed numerals. */
static int read_numeral(LexState *ls, SemInfo *seminfo) | {
if (check_next2(ls, expo))
check_next2(ls, "-+");
if (lisxdigit(ls->current))
save_and_next(ls);
else if (ls->current == '.')
save_and_next(ls);
else break;
}
save(ls, '\0');
if (luaO_str2num(luaZ_buffer(ls->buff), &obj) == 0)
lexerror(ls, "malformed number", TK_FLT);
if ... | nodemcu/nodemcu-firmware | C++ | MIT License | 7,566 |
/* configure the max cycle number of a charge-transfer sequence */ | void tsi_max_number_config(uint32_t max_number) | /* configure the max cycle number of a charge-transfer sequence */
void tsi_max_number_config(uint32_t max_number) | {
if(RESET == (TSI_CTL & TSI_CTL_TSIS)){
uint32_t maxnum;
maxnum = TSI_CTL;
maxnum &= ~TSI_CTL_MCN;
maxnum |= max_number;
TSI_CTL = maxnum;
}
} | liuxuming/trochili | C++ | Apache License 2.0 | 132 |
/* Sets the value of the real time clock (RTC) counter. */ | void HibernateRTCSet(unsigned long ulRTCValue) | /* Sets the value of the real time clock (RTC) counter. */
void HibernateRTCSet(unsigned long ulRTCValue) | {
HWREG(HIB_RTCLD) = ulRTCValue;
HibernateWriteComplete();
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* fc_exch_recv_resp() - Handler for a sequence where other end is responding to our sequence @mp: */ | static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) | /* fc_exch_recv_resp() - Handler for a sequence where other end is responding to our sequence @mp: */
static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) | {
struct fc_seq *sp;
sp = fc_seq_lookup_orig(mp, fp);
if (!sp)
atomic_inc(&mp->stats.xid_not_found);
else
atomic_inc(&mp->stats.non_bls_resp);
fc_frame_free(fp);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Writes a Port pin group configuration to the hardware module.
Writes out a given configuration of a Port pin group configuration to the hardware module. */ | void system_pinmux_group_set_config(PortGroup *const port, const uint32_t mask, const struct system_pinmux_config *const config) | /* Writes a Port pin group configuration to the hardware module.
Writes out a given configuration of a Port pin group configuration to the hardware module. */
void system_pinmux_group_set_config(PortGroup *const port, const uint32_t mask, const struct system_pinmux_config *const config) | {
Assert(port);
for (int i = 0; i < 32; i++) {
if (mask & (1UL << i)) {
_system_pinmux_config(port, (1UL << i), config);
}
}
} | memfault/zero-to-main | C++ | null | 200 |
/* FSM long counter timeout register (r/w). The long counter timeout value is an unsigned integer value (16-bit format). When the long counter value reached this value, the FSM generates an interrupt.. */ | int32_t lsm6dso_long_cnt_int_value_set(lsm6dso_ctx_t *ctx, uint8_t *buff) | /* FSM long counter timeout register (r/w). The long counter timeout value is an unsigned integer value (16-bit format). When the long counter value reached this value, the FSM generates an interrupt.. */
int32_t lsm6dso_long_cnt_int_value_set(lsm6dso_ctx_t *ctx, uint8_t *buff) | {
int32_t ret;
uint8_t index;
index = 0x00U;
ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_FSM_LC_TIMEOUT_L, &buff[index]);
if (ret == 0) {
index++;
ret = lsm6dso_ln_pg_write_byte(ctx, LSM6DSO_FSM_LC_TIMEOUT_H,
&buff[index]);
}
return ret;
} | alexander-g-dean/ESF | C++ | null | 41 |
/* Purpose: Let user call ioctl() to get info when the UART physically is emptied. On bus types like RS485, the transmitter must release the bus after transmitting. This must be done when the transmit shift register is empty, not be done when the transmit holding register is empty. This functionality allows an RS485 dr... | static int get_lsr_info(struct async_struct *info, unsigned int __user *value) | /* Purpose: Let user call ioctl() to get info when the UART physically is emptied. On bus types like RS485, the transmitter must release the bus after transmitting. This must be done when the transmit shift register is empty, not be done when the transmit holding register is empty. This functionality allows an RS485 dr... | {
unsigned char status;
unsigned int result;
unsigned long flags;
local_irq_save(flags);
status = custom.serdatr;
mb();
local_irq_restore(flags);
result = ((status & SDR_TSRE) ? TIOCSER_TEMT : 0);
if (copy_to_user(value, &result, sizeof(int)))
return -EFAULT;
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Gets the remaining bytes of the current DMA descriptor transfer. */ | uint32_t DMA_GetRemainingBytes(DMA_Type *base, uint32_t channel) | /* Gets the remaining bytes of the current DMA descriptor transfer. */
uint32_t DMA_GetRemainingBytes(DMA_Type *base, uint32_t channel) | {
assert(channel < FSL_FEATURE_DMA_NUMBER_OF_CHANNELS);
if (
(!(base->COMMON[DMA_CHANNEL_GROUP(channel)].ACTIVE & (1U << (DMA_CHANNEL_INDEX(channel))))) &&
(0x3FF == ((base->CHANNEL[channel].XFERCFG & DMA_CHANNEL_XFERCFG_XFERCOUNT_MASK) >> DMA_CHANNEL_XFERCFG_XFERCOUNT_SHIFT))
)
{
... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Function for the GAP initialization.
This function will setup all the necessary GAP (Generic Access Profile) parameters of the device. It also sets the permissions and appearance. */ | static uint32_t gap_params_init(void) | /* Function for the GAP initialization.
This function will setup all the necessary GAP (Generic Access Profile) parameters of the device. It also sets the permissions and appearance. */
static uint32_t gap_params_init(void) | {
uint32_t err_code;
ble_gap_conn_params_t gap_conn_params = {0};
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
err_code = gap_address_change();
VERIFY_SUCCESS(err_code);
err_code = sd_ble_gap_device_name_set(&sec_mode,
... | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* This function resets the statistical data for the vport. This function is called with the host_lock held */ | void lpfc_vport_reset_stat_data(struct lpfc_vport *vport) | /* This function resets the statistical data for the vport. This function is called with the host_lock held */
void lpfc_vport_reset_stat_data(struct lpfc_vport *vport) | {
struct lpfc_nodelist *ndlp = NULL, *next_ndlp = NULL;
list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
if (!NLP_CHK_NODE_ACT(ndlp))
continue;
if (ndlp->lat_data)
memset(ndlp->lat_data, 0, LPFC_MAX_BUCKET_COUNT *
sizeof(struct lpfc_scsicmd_bkt));
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* param base eDMA peripheral base address. param channel eDMA channel number. return The mask of channel status flags. Users need to use the _edma_channel_status_flags type to decode the return variables. */ | uint32_t EDMA_GetChannelStatusFlags(DMA_Type *base, uint32_t channel) | /* param base eDMA peripheral base address. param channel eDMA channel number. return The mask of channel status flags. Users need to use the _edma_channel_status_flags type to decode the return variables. */
uint32_t EDMA_GetChannelStatusFlags(DMA_Type *base, uint32_t channel) | {
assert(channel < (uint32_t)FSL_FEATURE_EDMA_MODULE_CHANNEL);
uint32_t retval = 0;
retval |= (((uint32_t)base->TCD[channel].CSR & DMA_CSR_DONE_MASK) >> DMA_CSR_DONE_SHIFT);
retval |= ((((uint32_t)base->ERR >> channel) & 0x1U) << 1U);
retval |= ((((uint32_t)base->INT >> channel) & 0x1U) << 2U);
... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* pm_request_resume - Submit a resume request for given device. @dev: Device to resume. */ | int pm_request_resume(struct device *dev) | /* pm_request_resume - Submit a resume request for given device. @dev: Device to resume. */
int pm_request_resume(struct device *dev) | {
unsigned long flags;
int retval;
spin_lock_irqsave(&dev->power.lock, flags);
retval = __pm_request_resume(dev);
spin_unlock_irqrestore(&dev->power.lock, flags);
return retval;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The entry point for Nvm Express driver, used to install Nvm Express driver on the ImageHandle. */ | EFI_STATUS EFIAPI NvmExpressDriverEntry(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) | /* The entry point for Nvm Express driver, used to install Nvm Express driver on the ImageHandle. */
EFI_STATUS EFIAPI NvmExpressDriverEntry(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) | {
EFI_STATUS Status;
Status = EfiLibInstallDriverBindingComponentName2 (
ImageHandle,
SystemTable,
&gNvmExpressDriverBinding,
ImageHandle,
&gNvmExpressComponentName,
&gNvmExpressComponentName2
);
ASSERT_EFI_ERROR (Status);... | tianocore/edk2 | C++ | Other | 4,240 |
/* Retrieve the active interface setting descriptor for this USB IO instance. */ | EFI_STATUS EFIAPI UsbIoGetInterfaceDescriptor(IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_INTERFACE_DESCRIPTOR *Descriptor) | /* Retrieve the active interface setting descriptor for this USB IO instance. */
EFI_STATUS EFIAPI UsbIoGetInterfaceDescriptor(IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_INTERFACE_DESCRIPTOR *Descriptor) | {
USB_INTERFACE *UsbIf;
EFI_TPL OldTpl;
if (Descriptor == NULL) {
return EFI_INVALID_PARAMETER;
}
OldTpl = gBS->RaiseTPL (USB_BUS_TPL);
UsbIf = USB_INTERFACE_FROM_USBIO (This);
CopyMem (Descriptor, &(UsbIf->IfSetting->Desc), sizeof (EFI_USB_INTERFACE_DESCRIPTOR));
gBS->RestoreTPL (OldTpl);
... | tianocore/edk2 | C++ | Other | 4,240 |
/* The MSI interrupt handler for the NAPI case (i.e., response queues serviced by NAPI polling). Handles data events from SGE response queues as well as error and other async events as they all use the same MSI vector. We use one SGE response queue per port in this mode and protect all response queues with queue 0's lo... | static irqreturn_t t3_intr_msi_napi(int irq, void *cookie) | /* The MSI interrupt handler for the NAPI case (i.e., response queues serviced by NAPI polling). Handles data events from SGE response queues as well as error and other async events as they all use the same MSI vector. We use one SGE response queue per port in this mode and protect all response queues with queue 0's lo... | {
int new_packets;
struct adapter *adap = cookie;
struct sge_rspq *q = &adap->sge.qs[0].rspq;
spin_lock(&q->lock);
new_packets = rspq_check_napi(&adap->sge.qs[0]);
if (adap->params.nports == 2)
new_packets += rspq_check_napi(&adap->sge.qs[1]);
if (!new_packets && t3_slow_intr_handler(adap) == 0)
q->unhandled... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function is used to get the total number of regions that are supported by the MPU, including regions that are already programmed. */ | uint32_t MPURegionCountGet(void) | /* This function is used to get the total number of regions that are supported by the MPU, including regions that are already programmed. */
uint32_t MPURegionCountGet(void) | {
return((HWREG(NVIC_MPU_TYPE) & NVIC_MPU_TYPE_DREGION_M) >>
NVIC_MPU_TYPE_DREGION_S);
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Reads the firmware semaphore register and returns true (>0) if manageability is enabled, else false (0). */ | bool e1000e_check_mng_mode_generic(struct e1000_hw *hw) | /* Reads the firmware semaphore register and returns true (>0) if manageability is enabled, else false (0). */
bool e1000e_check_mng_mode_generic(struct e1000_hw *hw) | {
u32 fwsm = er32(FWSM);
return (fwsm & E1000_FWSM_MODE_MASK) ==
(E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* More details for reference count strategy can refer to the API description for */ | EDKII_JSON_VALUE EFIAPI JsonValueInitObject(VOID) | /* More details for reference count strategy can refer to the API description for */
EDKII_JSON_VALUE EFIAPI JsonValueInitObject(VOID) | {
return (EDKII_JSON_VALUE)json_object ();
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Function for toggling a LED and starting a timer. */ | static void led_and_timer_control(uint32_t led_id, app_simple_timer_mode_t timer_mode) | /* Function for toggling a LED and starting a timer. */
static void led_and_timer_control(uint32_t led_id, app_simple_timer_mode_t timer_mode) | {
uint32_t err_code;
bsp_board_led_invert(led_id);
m_state_transit_counter = STATE_TRANSIT_COUNTER_INIT_VALUE;
m_toggle_led_counter = TOGGLE_LED_COUNTER;
err_code = app_simple_timer_start(timer_mode, timeout_handler, TIMEOUT_VALUE, NULL);
APP_ERROR_CHECK(err_code);
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.