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 the interface is not supported, then ASSERT(). */ | VOID EFIAPI CryptoServiceX509StackFree(IN VOID *X509Stack) | /* If the interface is not supported, then ASSERT(). */
VOID EFIAPI CryptoServiceX509StackFree(IN VOID *X509Stack) | {
CALL_VOID_BASECRYPTLIB (X509.Services.StackFree, X509StackFree, (X509Stack));
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Internal function to add memory read/write opcode to the table. */ | EFI_STATUS BootScriptWriteMemReadWrite(IN VA_LIST Marker) | /* Internal function to add memory read/write opcode to the table. */
EFI_STATUS BootScriptWriteMemReadWrite(IN VA_LIST Marker) | {
S3_BOOT_SCRIPT_LIB_WIDTH Width;
UINT64 Address;
UINT8 *Data;
UINT8 *DataMask;
Width = VA_ARG (Marker, S3_BOOT_SCRIPT_LIB_WIDTH);
Address = VA_ARG (Marker, UINT64);
Data = VA_ARG (Marker, UINT8 *);
DataMask = VA_ARG (Marker, UINT8 *);
... | tianocore/edk2 | C++ | Other | 4,240 |
/* snd_hda_ctls_clear - Clear all controls assigned to the given codec @codec: HD-audio codec */ | void snd_hda_ctls_clear(struct hda_codec *codec) | /* snd_hda_ctls_clear - Clear all controls assigned to the given codec @codec: HD-audio codec */
void snd_hda_ctls_clear(struct hda_codec *codec) | {
int i;
struct hda_nid_item *items = codec->mixers.list;
for (i = 0; i < codec->mixers.used; i++)
snd_ctl_remove(codec->bus->card, items[i].kctl);
snd_array_free(&codec->mixers);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The inode lookup table is used only by the export code, inode disk locations are directly encoded in directories, enabling direct access without an intermediate lookup for all operations except the export ops. Look-up inode number (ino) in table, returning the inode location. */ | static long long squashfs_inode_lookup(struct super_block *sb, int ino_num) | /* The inode lookup table is used only by the export code, inode disk locations are directly encoded in directories, enabling direct access without an intermediate lookup for all operations except the export ops. Look-up inode number (ino) in table, returning the inode location. */
static long long squashfs_inode_look... | {
struct squashfs_sb_info *msblk = sb->s_fs_info;
int blk = SQUASHFS_LOOKUP_BLOCK(ino_num - 1);
int offset = SQUASHFS_LOOKUP_BLOCK_OFFSET(ino_num - 1);
u64 start = le64_to_cpu(msblk->inode_lookup_table[blk]);
__le64 ino;
int err;
TRACE("Entered squashfs_inode_lookup, inode_number = %d\n", ino_num);
err = squash... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Returns the most recent received data by the SPI peripheral. */ | uint8_t SPI_RxData8(SPI_T *spi) | /* Returns the most recent received data by the SPI peripheral. */
uint8_t SPI_RxData8(SPI_T *spi) | {
return *((uint8_t*) & (spi->DATA));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* The endpoint interrupt handlers can distinguish regular (ACK) interrupts from NAK interrupt by checking the bits in their bEPStatus argument. */ | void USBHwNakIntEnable(U8 bIntBits) | /* The endpoint interrupt handlers can distinguish regular (ACK) interrupts from NAK interrupt by checking the bits in their bEPStatus argument. */
void USBHwNakIntEnable(U8 bIntBits) | {
USBHwCmdWrite(CMD_DEV_SET_MODE, bIntBits);
} | ajhc/demo-cortex-m3 | C++ | null | 38 |
/* Checks if given clock is used as source for any MCLK. */ | static bool dai_ssp_is_mclk_source_in_use(struct dai_intel_ssp *dp) | /* Checks if given clock is used as source for any MCLK. */
static bool dai_ssp_is_mclk_source_in_use(struct dai_intel_ssp *dp) | {
struct dai_intel_ssp_mn *mp = dai_get_mn(dp);
bool ret = false;
int i;
for (i = 0; i < ARRAY_SIZE(mp->mclk_sources_ref); i++) {
if (mp->mclk_sources_ref[i] > 0) {
ret = true;
break;
}
}
return ret;
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Populate the low-level memory allocation function pointers in sqlite3GlobalConfig.m with pointers to the routines in this file. */ | SQLITE_PRIVATE void sqlite3MemSetDefault(void) | /* Populate the low-level memory allocation function pointers in sqlite3GlobalConfig.m with pointers to the routines in this file. */
SQLITE_PRIVATE void sqlite3MemSetDefault(void) | {
static const sqlite3_mem_methods defaultMethods = {
sqlite3MemMalloc,
sqlite3MemFree,
sqlite3MemRealloc,
sqlite3MemSize,
sqlite3MemRoundup,
sqlite3MemInit,
sqlite3MemShutdown,
0
};
sqlite3_config(SQLITE_CONFIG_MALLOC, &defaultMethods);
} | DC-SWAT/DreamShell | C++ | null | 404 |
/* fc_bsg_host_handler - handler for bsg requests for a fc host @q: fc host request queue */ | static void fc_bsg_host_handler(struct request_queue *q) | /* fc_bsg_host_handler - handler for bsg requests for a fc host @q: fc host request queue */
static void fc_bsg_host_handler(struct request_queue *q) | {
struct Scsi_Host *shost = q->queuedata;
fc_bsg_request_handler(q, shost, NULL, &shost->shost_gendev);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function will detach a timer from timer management. */ | rt_err_t rt_timer_detach(rt_timer_t timer) | /* This function will detach a timer from timer management. */
rt_err_t rt_timer_detach(rt_timer_t timer) | {
register rt_base_t level;
RT_ASSERT(timer != RT_NULL);
RT_ASSERT(rt_object_get_type(&timer->parent) == RT_Object_Class_Timer);
RT_ASSERT(rt_object_is_systemobject(&timer->parent));
level = rt_hw_interrupt_disable();
_rt_timer_remove(timer);
timer->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED;
... | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* If bio->bi_dev is a partition, remap the location */ | static void blk_partition_remap(struct bio *bio) | /* If bio->bi_dev is a partition, remap the location */
static void blk_partition_remap(struct bio *bio) | {
struct block_device *bdev = bio->bi_bdev;
if (bio_sectors(bio) && bdev != bdev->bd_contains) {
struct hd_struct *p = bdev->bd_part;
bio->bi_sector += p->start_sect;
bio->bi_bdev = bdev->bd_contains;
trace_block_remap(bdev_get_queue(bio->bi_bdev), bio,
bdev->bd_dev,
bio->bi_sector - p->start_... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Returns: data from the queue or NULL, when no data is available immediately. */ | gpointer g_async_queue_try_pop(GAsyncQueue *queue) | /* Returns: data from the queue or NULL, when no data is available immediately. */
gpointer g_async_queue_try_pop(GAsyncQueue *queue) | {
gpointer retval;
g_return_val_if_fail (queue, NULL);
g_mutex_lock (&queue->mutex);
retval = g_async_queue_pop_intern_unlocked (queue, FALSE, -1);
g_mutex_unlock (&queue->mutex);
return retval;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Checks whether the TIM interrupt has occurred or not. */ | ITStatus TIM_GetITStatus(TIM_TypeDef *TIMx, uint16_t TIM_IT) | /* Checks whether the TIM interrupt has occurred or not. */
ITStatus TIM_GetITStatus(TIM_TypeDef *TIMx, uint16_t TIM_IT) | {
ITStatus bitstatus = RESET;
uint16_t itstatus = 0x0, itenable = 0x0;
assert_param(IS_TIM_ALL_PERIPH(TIMx));
assert_param(IS_TIM_GET_IT(TIM_IT));
itstatus = TIMx->SR & TIM_IT;
itenable = TIMx->DIER & TIM_IT;
if ((itstatus != (uint16_t)RESET) && (itenable != (uint16_t)RESET))
{
b... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* convert the colour format of a given tile to rgb888 */ | arm_fsm_rt_t arm_2dp_convert_colour_to_rgb888(arm_2d_op_cl_convt_t *ptOP, const arm_2d_tile_t *ptSource, const arm_2d_tile_t *ptTarget) | /* convert the colour format of a given tile to rgb888 */
arm_fsm_rt_t arm_2dp_convert_colour_to_rgb888(arm_2d_op_cl_convt_t *ptOP, const arm_2d_tile_t *ptSource, const arm_2d_tile_t *ptTarget) | {
assert(NULL != ptSource);
assert(NULL != ptTarget);
ARM_2D_IMPL(arm_2d_op_cl_convt_t, ptOP);
if (!__arm_2d_op_acquire((arm_2d_op_core_t *)ptThis)) {
return arm_fsm_rt_on_going;
}
OP_CORE.ptOp = &ARM_2D_OP_CONVERT_TO_RGB888;
this.Target.ptTile = ptTarget;
this.Target.ptRegion = ... | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* More details for reference count strategy can refer to the API description for */ | EFI_STATUS EFIAPI JsonArrayAppendValue(IN EDKII_JSON_ARRAY JsonArray, IN EDKII_JSON_VALUE Json) | /* More details for reference count strategy can refer to the API description for */
EFI_STATUS EFIAPI JsonArrayAppendValue(IN EDKII_JSON_ARRAY JsonArray, IN EDKII_JSON_VALUE Json) | {
if (json_array_append ((json_t *)JsonArray, (json_t *)Json) != 0) {
return EFI_ABORTED;
} else {
return EFI_SUCCESS;
}
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Skip encoded FQDN in DNS message. Returns size in bytes of encoded FQDN, or negative error code. */ | static int skip_fqdn(uint8_t *answer, int buf_sz) | /* Skip encoded FQDN in DNS message. Returns size in bytes of encoded FQDN, or negative error code. */
static int skip_fqdn(uint8_t *answer, int buf_sz) | {
int i = 0;
while (1) {
if (i >= buf_sz) {
return -EINVAL;
}
if (answer[i] == 0) {
i += 1;
break;
} else if (answer[i] >= 0xc0) {
i += 2;
if (i > buf_sz) {
return -EINVAL;
}
break;
} else if (answer[i] < DNS_LABEL_MAX_SIZE) {
i += answer[i] + 1;
} else {
return -EINVAL;
}... | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* ADC MSP Initialization This function configures the hardware resources used in this example. */ | void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) | /* ADC MSP Initialization This function configures the hardware resources used in this example. */
void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) | {
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hadc->Instance==ADC1)
{
__HAL_RCC_ADC1_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5
|GPIO_PIN_6|GPIO_PIN_7;
GPIO_InitStruct.Mode... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* param base Pointer to FLEXIO_I2S_Type structure. param handle FlexIO I2S handle pointer. param format Pointer to audio data format structure. param srcClock_Hz FlexIO I2S bit clock source frequency in Hz. This parameter should be 0 while in slave mode. */ | void FLEXIO_I2S_TransferSetFormat(FLEXIO_I2S_Type *base, flexio_i2s_handle_t *handle, flexio_i2s_format_t *format, uint32_t srcClock_Hz) | /* param base Pointer to FLEXIO_I2S_Type structure. param handle FlexIO I2S handle pointer. param format Pointer to audio data format structure. param srcClock_Hz FlexIO I2S bit clock source frequency in Hz. This parameter should be 0 while in slave mode. */
void FLEXIO_I2S_TransferSetFormat(FLEXIO_I2S_Type *base, fle... | {
assert(handle && format);
handle->bitWidth = format->bitWidth;
if (srcClock_Hz != 0)
{
FLEXIO_I2S_MasterSetFormat(base, format, srcClock_Hz);
}
else
{
FLEXIO_I2S_SlaveSetFormat(base, format);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Start the IO functionality used and enable the AF for selected IO pin(s). */ | void mfxstm32l152_IO_Start(uint16_t DeviceAddr, uint32_t IO_Pin) | /* Start the IO functionality used and enable the AF for selected IO pin(s). */
void mfxstm32l152_IO_Start(uint16_t DeviceAddr, uint32_t IO_Pin) | {
uint8_t mode;
mode = MFX_IO_Read(DeviceAddr, MFXSTM32L152_REG_ADR_SYS_CTRL);
mode |= MFXSTM32L152_GPIO_EN;
if (IO_Pin > 0xFFFF)
{
mode |= MFXSTM32L152_ALTERNATE_GPIO_EN;
}
else
{
mode &= ~MFXSTM32L152_ALTERNATE_GPIO_EN;
}
MFX_IO_Write(DeviceAddr, MFXSTM32L152_REG_ADR_SYS_CTRL, mo... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Call a specific function in the thread context of tcpip_thread for easy access synchronization. A function called in that way may access lwIP core code without fearing concurrent access. */ | err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block) | /* Call a specific function in the thread context of tcpip_thread for easy access synchronization. A function called in that way may access lwIP core code without fearing concurrent access. */
err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block) | {
struct tcpip_msg *msg;
LWIP_ASSERT("Invalid mbox", sys_mbox_valid_val(mbox));
msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API);
if (msg == NULL) {
return ERR_MEM;
}
msg->type = TCPIP_MSG_CALLBACK;
msg->msg.cb.function = function;
msg->msg.cb.ctx = ctx;
if (block) {
sys_mbox_post(&mb... | Nicholas3388/LuaNode | C++ | Other | 1,055 |
/* Find the thread state structure for the current thread. */ | struct gru_thread_state* gru_find_thread_state(struct vm_area_struct *vma, int tsid) | /* Find the thread state structure for the current thread. */
struct gru_thread_state* gru_find_thread_state(struct vm_area_struct *vma, int tsid) | {
struct gru_vma_data *vdata = vma->vm_private_data;
struct gru_thread_state *gts;
spin_lock(&vdata->vd_lock);
gts = gru_find_current_gts_nolock(vdata, tsid);
spin_unlock(&vdata->vd_lock);
gru_dbg(grudev, "vma %p, gts %p\n", vma, gts);
return gts;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Start a SPI master blocking single item (frame) transfer. */ | Ecode_t SPIDRV_MTransferSingleItemB(SPIDRV_Handle_t handle, uint32_t txValue, void *rxValue) | /* Start a SPI master blocking single item (frame) transfer. */
Ecode_t SPIDRV_MTransferSingleItemB(SPIDRV_Handle_t handle, uint32_t txValue, void *rxValue) | {
void *pRx;
CORE_DECLARE_IRQ_STATE;
uint32_t rxBuffer;
if ( handle == NULL )
{
return ECODE_EMDRV_SPIDRV_ILLEGAL_HANDLE;
}
if ( handle->initData.type == spidrvSlave )
{
return ECODE_EMDRV_SPIDRV_MODE_ERROR;
}
CORE_ENTER_ATOMIC();
if ( handle->state != spidrvStateIdle )
{
CORE_EXIT_A... | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* param base CDOG peripheral base address param stop expected value which will be compared with value of secure counter param reload reload value for instruction timer param start start value for secure timer */ | void CDOG_Set(CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start) | /* param base CDOG peripheral base address param stop expected value which will be compared with value of secure counter param reload reload value for instruction timer param start start value for secure timer */
void CDOG_Set(CDOG_Type *base, uint32_t stop, uint32_t reload, uint32_t start) | {
base->STOP = stop;
base->RELOAD = reload;
base->START = start;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Switch GAP Role.
This API is used to switch the BLE GAP role. The role switch can only happen if the local device: */ | ADI_BLER_RESULT adi_radio_SwitchRole(ADI_BLE_ROLE *const peDesiredBleRole) | /* Switch GAP Role.
This API is used to switch the BLE GAP role. The role switch can only happen if the local device: */
ADI_BLER_RESULT adi_radio_SwitchRole(ADI_BLE_ROLE *const peDesiredBleRole) | {
ADI_BLER_RESULT bleResult;
ASSERT(peDesiredBleRole != NULL);
ADI_BLE_LOGEVENT(LOGID_CMD_BLEGAP_SWITCH_ROLE);
ADI_BLE_RADIO_CMD_START(CMD_BLEGAP_SWITCH_ROLE);
pBLERadio->eBleDevRole = *peDesiredBleRole;
memcpy(&pBLERadio->cmdPkt[ADI_RADIO_CMD_HEADER_LEN], peDesiredBleRole, 1u);
bleResult = ... | analogdevicesinc/EVAL-ADICUP3029 | C++ | Other | 36 |
/* An asynchronous write is needed to support writing updates from the timer interrupt context. */ | void ps3_os_area_set_rtc_diff(u64 rtc_diff) | /* An asynchronous write is needed to support writing updates from the timer interrupt context. */
void ps3_os_area_set_rtc_diff(u64 rtc_diff) | {
if (saved_params.rtc_diff != rtc_diff) {
saved_params.rtc_diff = rtc_diff;
os_area_queue_work();
}
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This function writes a byte data to data register of USCI_I2C module. */ | void UI2C_SetData(UI2C_T *ui2c, uint8_t u8Data) | /* This function writes a byte data to data register of USCI_I2C module. */
void UI2C_SetData(UI2C_T *ui2c, uint8_t u8Data) | {
ui2c->TXDAT = u8Data;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* The hold enable bit of the sample-hold circuit. */ | void ADC_IoshAmpCmd(uint32_t AmpEn, FunctionalState NewState) | /* The hold enable bit of the sample-hold circuit. */
void ADC_IoshAmpCmd(uint32_t AmpEn, FunctionalState NewState) | {
assert_param(IS_ADC_AMPEN(AmpEn));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
ADC->CR2 |= AmpEn;
}
else
{
ADC->CR2 &= ~AmpEn;
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* If we set up a device for bus mastering, we need to check the latency timer as certain firmware forgets to set it properly, as seen on SX164 and LX164 with SRM. */ | void pcibios_set_master(struct pci_dev *dev) | /* If we set up a device for bus mastering, we need to check the latency timer as certain firmware forgets to set it properly, as seen on SX164 and LX164 with SRM. */
void pcibios_set_master(struct pci_dev *dev) | {
u8 lat;
pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
if (lat >= 16) return;
printk("PCI: Setting latency timer of device %s to 64\n",
pci_name(dev));
pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Checks whether the specified RCC flag is set or not. */ | FlagStatus RCC_GetFlagStatus(uint8_t RCC_FLAG) | /* Checks whether the specified RCC flag is set or not. */
FlagStatus RCC_GetFlagStatus(uint8_t RCC_FLAG) | {
uint32_t tmp = 0;
uint32_t statusreg = 0;
FlagStatus bitstatus = RESET;
assert_param(IS_RCC_FLAG(RCC_FLAG));
tmp = RCC_FLAG >> 5;
if (tmp == 1)
{
statusreg = RCC->CTRL;
}
else if (tmp == 2)
{
statusreg = RCC->LDCTRL;
}
else
{
statusreg... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* DAC MSP Initialization This function configures the hardware resources used in this example. */ | void HAL_DAC_MspInit(DAC_HandleTypeDef *hdac) | /* DAC MSP Initialization This function configures the hardware resources used in this example. */
void HAL_DAC_MspInit(DAC_HandleTypeDef *hdac) | {
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hdac->Instance==DAC1)
{
__HAL_RCC_DAC12_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_4;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Called by port to notify transition to offline state. */ | void bfa_fcs_port_fab_offline(struct bfa_fcs_port_s *port) | /* Called by port to notify transition to offline state. */
void bfa_fcs_port_fab_offline(struct bfa_fcs_port_s *port) | {
bfa_fcs_port_ns_offline(port);
bfa_fcs_port_scn_offline(port);
bfa_fcs_port_ms_offline(port);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function is executed in case of error occurrence. */ | static void Error_Handler(void) | /* This function is executed in case of error occurrence. */
static void Error_Handler(void) | {
BSP_LED_On(LED1);
while(1)
{
}
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Queries the signal system for in-depth information about a specific signal. This function will fill in a user-provided structure to hold signal-specific information. If an invalid signal id is passed in, the @signal_id member of the #GSignalQuery is 0. All members filled into the #GSignalQuery structure should be co... | void g_signal_query(guint signal_id, GSignalQuery *query) | /* Queries the signal system for in-depth information about a specific signal. This function will fill in a user-provided structure to hold signal-specific information. If an invalid signal id is passed in, the @signal_id member of the #GSignalQuery is 0. All members filled into the #GSignalQuery structure should be co... | {
SignalNode *node;
g_return_if_fail (query != NULL);
SIGNAL_LOCK ();
node = LOOKUP_SIGNAL_NODE (signal_id);
if (!node || node->destroyed)
query->signal_id = 0;
else
{
query->signal_id = node->signal_id;
query->signal_name = node->name;
query->itype = node->itype;
query->sign... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Main clock source selection between DFLL and OSC16M. */ | static void main_clock_select(const enum system_clock_source clock_source) | /* Main clock source selection between DFLL and OSC16M. */
static void main_clock_select(const enum system_clock_source clock_source) | {
if (clock_source == SYSTEM_CLOCK_SOURCE_DFLL) {
main_clock_select_dfll();
system_clock_source_disable(SYSTEM_CLOCK_SOURCE_OSC16M);
} else if (clock_source == SYSTEM_CLOCK_SOURCE_OSC16M) {
main_clock_select_osc16m();
system_clock_source_disable(SYSTEM_CLOCK_SOURCE_DFLL);
system_gclk_chan_disable(OSCCTRL_GC... | memfault/zero-to-main | C++ | null | 200 |
/* This function will detach a pipe device from resource management */ | rt_err_t rt_pipe_detach(struct rt_pipe_device *pipe) | /* This function will detach a pipe device from resource management */
rt_err_t rt_pipe_detach(struct rt_pipe_device *pipe) | {
return rt_device_unregister(&pipe->parent);
} | armink/FreeModbus_Slave-Master-RTT-STM32 | C++ | Other | 1,477 |
/* Causes the driver to load a specified file. */ | EFI_STATUS EFIAPI LoadFile2(IN EFI_LOAD_FILE2_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN BOOLEAN BootPolicy, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL) | /* Causes the driver to load a specified file. */
EFI_STATUS EFIAPI LoadFile2(IN EFI_LOAD_FILE2_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN BOOLEAN BootPolicy, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL) | {
PCI_IO_DEVICE *PciIoDevice;
if (BootPolicy) {
return EFI_UNSUPPORTED;
}
PciIoDevice = PCI_IO_DEVICE_FROM_LOAD_FILE2_THIS (This);
return LocalLoadFile2 (
PciIoDevice,
FilePath,
BufferSize,
Buffer
);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This function is used to set duty radio. */ | void tls_pwm_duty_set(u8 channel, u8 duty) | /* This function is used to set duty radio. */
void tls_pwm_duty_set(u8 channel, u8 duty) | {
if(channel > (PWM_CHANNEL_MAX_NUM - 1))
return;
if (duty == 0)
{
tls_pwm_stop(channel);
}
else
{
tls_pwm_duty_config(channel, duty);
tls_pwm_start(channel);
}
} | Nicholas3388/LuaNode | C++ | Other | 1,055 |
/* Initializes the PE state machine and enters the PE_SUSPEND state. */ | void pe_subsys_init(const struct device *dev) | /* Initializes the PE state machine and enters the PE_SUSPEND state. */
void pe_subsys_init(const struct device *dev) | {
struct usbc_port_data *data = dev->data;
struct policy_engine *pe = data->pe;
pe->dev = dev;
smf_set_initial(SMF_CTX(pe), &pe_states[PE_SUSPEND]);
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* The function is used to Enable frequency clock output and set its divider value. */ | void SysCtlFreqDividerOutputEnable(xtBoolean bEnable, unsigned char u8Divider) | /* The function is used to Enable frequency clock output and set its divider value. */
void SysCtlFreqDividerOutputEnable(xtBoolean bEnable, unsigned char u8Divider) | {
xASSERT(u8Divider<=15);
if(bEnable)
{
xHWREG(SYSCLK_FRQDIV) &= ~SYSCLK_FRQDIV_FSEL_M;
xHWREG(SYSCLK_FRQDIV) |= u8Divider;
xHWREG(SYSCLK_FRQDIV) |= SYSCLK_FRQDIV_EN;
SysCtlPeripheralEnable(SYSCTL_PERIPH_FDIV);
}
else
{
xHWREG(SYSCLK_FRQDIV) &= ~SYSCLK_FRQ... | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* If the conversion results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */ | RETURN_STATUS EFIAPI SafeInt16ToUint64(IN INT16 Operand, OUT UINT64 *Result) | /* If the conversion results in an overflow or an underflow condition, then Result is set to UINT64_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeInt16ToUint64(IN INT16 Operand, OUT UINT64 *Result) | {
RETURN_STATUS Status;
if (Result == NULL) {
return RETURN_INVALID_PARAMETER;
}
if (Operand >= 0) {
*Result = (UINT64)Operand;
Status = RETURN_SUCCESS;
} else {
*Result = UINT64_ERROR;
Status = RETURN_BUFFER_TOO_SMALL;
}
return Status;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* param handle codec handle. param mclk master clock frequency in HZ. param sampleRate sample rate in HZ. param bitWidth bit width. return kStatus_Success is success, else configure failed. */ | status_t HAL_CODEC_WM8904_SetFormat(void *handle, uint32_t mclk, uint32_t sampleRate, uint32_t bitWidth) | /* param handle codec handle. param mclk master clock frequency in HZ. param sampleRate sample rate in HZ. param bitWidth bit width. return kStatus_Success is success, else configure failed. */
status_t HAL_CODEC_WM8904_SetFormat(void *handle, uint32_t mclk, uint32_t sampleRate, uint32_t bitWidth) | {
assert(handle != NULL);
status_t ret = kStatus_Success;
ret = WM8904_SetAudioFormat((wm8904_handle_t *)((uint32_t)(((codec_handle_t *)handle)->codecDevHandle)), mclk,
sampleRate, bitWidth);
if (ret != kStatus_Success)
{
return ret;
}
return kStatus_S... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* A negative return value indicates an error occurred while reading the register. */ | static s32 ad525x_write(struct i2c_client *client, u8 reg, u8 value) | /* A negative return value indicates an error occurred while reading the register. */
static s32 ad525x_write(struct i2c_client *client, u8 reg, u8 value) | {
struct dpot_data *data = i2c_get_clientdata(client);
if (reg & AD525X_I2C_CMD)
return i2c_smbus_write_byte(client, reg);
if (data->max_pos > 256)
return i2c_smbus_write_word_data(client, (reg & 0xF8) |
((reg & 0x7) << 1), value);
else
return i2c_smbus_write_byte_data(client, reg, value);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Fills each peli_filter_init_struct member with its default value. */ | void CAN_Peli_FilterStructInit(CAN_Peli_FilterInitTypeDef *peli_filter_init_struct) | /* Fills each peli_filter_init_struct member with its default value. */
void CAN_Peli_FilterStructInit(CAN_Peli_FilterInitTypeDef *peli_filter_init_struct) | {
peli_filter_init_struct->CAN_FilterId0 = 0;
peli_filter_init_struct->CAN_FilterId1 = 0;
peli_filter_init_struct->CAN_FilterId2 = 0;
peli_filter_init_struct->CAN_FilterId3 = 0;
peli_filter_init_struct->CAN_FilterMaskId0 = 0;
peli_filter_init_struct->CAN_FilterMaskId1 = 0;
peli_filter_init_s... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Set 'clear' to TRUE to have it also clear the state variable. */ | static bool multi_ischanged(struct Curl_multi *multi, bool clear) | /* Set 'clear' to TRUE to have it also clear the state variable. */
static bool multi_ischanged(struct Curl_multi *multi, bool clear) | {
bool retval = multi->recheckstate;
if(clear)
multi->recheckstate = FALSE;
return retval;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* RNG MSP Initialization This function configures the hardware resources used in this example. */ | void HAL_RNG_MspInit(RNG_HandleTypeDef *hrng) | /* RNG MSP Initialization This function configures the hardware resources used in this example. */
void HAL_RNG_MspInit(RNG_HandleTypeDef *hrng) | {
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
if(hrng->Instance==RNG)
{
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_RNG;
PeriphClkInit.RngClockSelection = RCC_RNGCLKSOURCE_HSI48;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
Error_Handler();
}
__HAL_RCC_RNG_CLK_... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Writes an unsigned 8 bit values over I2C. */ | err_t lsm303accelWrite8(uint8_t addr, uint8_t reg, uint8_t value) | /* Writes an unsigned 8 bit values over I2C. */
err_t lsm303accelWrite8(uint8_t addr, uint8_t reg, uint8_t value) | {
I2CWriteLength = 3;
I2CReadLength = 0;
I2CMasterBuffer[0] = addr;
I2CMasterBuffer[1] = reg;
I2CMasterBuffer[2] = (value);
ASSERT_I2C_STATUS(i2cEngine());
return ERROR_NONE;
} | microbuilder/LPC11U_LPC13U_CodeBase | C++ | Other | 54 |
/* Network device is taken down. Usually this is done by "ifconfig irda0 down" */ | static int kingsun_net_close(struct net_device *netdev) | /* Network device is taken down. Usually this is done by "ifconfig irda0 down" */
static int kingsun_net_close(struct net_device *netdev) | {
struct kingsun_cb *kingsun = netdev_priv(netdev);
netif_stop_queue(netdev);
usb_kill_urb(kingsun->tx_urb);
usb_kill_urb(kingsun->rx_urb);
usb_free_urb(kingsun->tx_urb);
usb_free_urb(kingsun->rx_urb);
kingsun->tx_urb = NULL;
kingsun->rx_urb = NULL;
kfree_skb(kingsun->rx_buff.skb);
kingsun->rx_buff.skb = NULL... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The STATUS_REG register is read by the primary interface. */ | int32_t lsm6dsl_status_reg_get(stmdev_ctx_t *ctx, lsm6dsl_status_reg_t *val) | /* The STATUS_REG register is read by the primary interface. */
int32_t lsm6dsl_status_reg_get(stmdev_ctx_t *ctx, lsm6dsl_status_reg_t *val) | {
int32_t ret;
ret = lsm6dsl_read_reg(ctx, LSM6DSL_STATUS_REG, (uint8_t*) val, 1);
return ret;
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Return a nodemask representing a mempolicy for filtering nodes for page allocation */ | static nodemask_t* policy_nodemask(gfp_t gfp, struct mempolicy *policy) | /* Return a nodemask representing a mempolicy for filtering nodes for page allocation */
static nodemask_t* policy_nodemask(gfp_t gfp, struct mempolicy *policy) | {
if (unlikely(policy->mode == MPOL_BIND) &&
gfp_zone(gfp) >= policy_zone &&
cpuset_nodemask_valid_mems_allowed(&policy->v.nodes))
return &policy->v.nodes;
return NULL;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* dev_mmio - Get the MMIO address of PDC2027x extended registers @ap: Port @adev: device @offset: offset from mmio base */ | static void __iomem* dev_mmio(struct ata_port *ap, struct ata_device *adev, unsigned int offset) | /* dev_mmio - Get the MMIO address of PDC2027x extended registers @ap: Port @adev: device @offset: offset from mmio base */
static void __iomem* dev_mmio(struct ata_port *ap, struct ata_device *adev, unsigned int offset) | {
u8 adj = (adev->devno) ? 0x08 : 0x00;
return port_mmio(ap, offset) + adj;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Returns a timer value from one of the CPU's internal timers. There is no inherent time interval between ticks but is a function of the CPU frequency. */ | EFI_STATUS EFIAPI CpuGetTimerValue(IN EFI_CPU_ARCH_PROTOCOL *This, IN UINT32 TimerIndex, OUT UINT64 *TimerValue, OUT UINT64 *TimerPeriod OPTIONAL) | /* Returns a timer value from one of the CPU's internal timers. There is no inherent time interval between ticks but is a function of the CPU frequency. */
EFI_STATUS EFIAPI CpuGetTimerValue(IN EFI_CPU_ARCH_PROTOCOL *This, IN UINT32 TimerIndex, OUT UINT64 *TimerValue, OUT UINT64 *TimerPeriod OPTIONAL) | {
if (TimerValue == NULL) {
return EFI_INVALID_PARAMETER;
}
if (TimerIndex != 0) {
return EFI_INVALID_PARAMETER;
}
*TimerValue = (UINT64)RiscVReadTimer ();
if (TimerPeriod != NULL) {
*TimerPeriod = DivU64x32 (
1000000000000000u,
PcdGet64 (PcdCpuCoreCryst... | tianocore/edk2 | C++ | Other | 4,240 |
/* Increment the read sequence number (as a 64 bit endian indepenent #) */ | static void ICACHE_FLASH_ATTR increment_write_sequence(SSL *ssl) | /* Increment the read sequence number (as a 64 bit endian indepenent #) */
static void ICACHE_FLASH_ATTR increment_write_sequence(SSL *ssl) | {
int i;
for (i = 7; i >= 0; i--)
{
if (++ssl->write_sequence[i])
break;
}
} | eerimoq/simba | C++ | Other | 337 |
/* Enables Source address filtering. When enabled source address filtering is performed. Only frames matching SA filtering are passed to application with SAMatch bit of RxStatus is set. GMAC drops failed frames. */ | void synopGMAC_src_addr_filter_enable(synopGMACdevice *gmacdev) | /* Enables Source address filtering. When enabled source address filtering is performed. Only frames matching SA filtering are passed to application with SAMatch bit of RxStatus is set. GMAC drops failed frames. */
void synopGMAC_src_addr_filter_enable(synopGMACdevice *gmacdev) | {
synopGMACSetBits(gmacdev->MacBase, GmacFrameFilter, GmacSrcAddrFilter);
return;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* The coding of the E-UTRAN Cell Global Identity value is according to ECGI field information element as specified in subclause 8.21.5 of 3GPP TS 29.274 (GTPv2-C) */ | static guint16 de_sgsap_ecgi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_) | /* The coding of the E-UTRAN Cell Global Identity value is according to ECGI field information element as specified in subclause 8.21.5 of 3GPP TS 29.274 (GTPv2-C) */
static guint16 de_sgsap_ecgi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len ... | {
guint32 curr_offset;
curr_offset = offset;
dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_NONE, TRUE);
curr_offset += 3;
proto_tree_add_item(tree, hf_sgsap_eci, tvb, curr_offset, 4, ENC_BIG_ENDIAN);
curr_offset += 4;
return(curr_offset-offset);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* This service enables PEIMs to discover additional firmware volumes. */ | EFI_STATUS EFIAPI PeiServicesFfsFindNextVolume(IN UINTN Instance, IN OUT EFI_PEI_FV_HANDLE *VolumeHandle) | /* This service enables PEIMs to discover additional firmware volumes. */
EFI_STATUS EFIAPI PeiServicesFfsFindNextVolume(IN UINTN Instance, IN OUT EFI_PEI_FV_HANDLE *VolumeHandle) | {
CONST EFI_PEI_SERVICES **PeiServices;
PeiServices = GetPeiServicesTablePointer ();
return (*PeiServices)->FfsFindNextVolume (PeiServices, Instance, VolumeHandle);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Backpatch the blocks in 'list' to 'target'. The 'sense' field indicates which of the jt and jf fields has been resolved and which is a pointer back to another unresolved block (or nil). At least one of the fields in each block is already resolved. */ | static void backpatch(struct block *, struct block *) | /* Backpatch the blocks in 'list' to 'target'. The 'sense' field indicates which of the jt and jf fields has been resolved and which is a pointer back to another unresolved block (or nil). At least one of the fields in each block is already resolved. */
static void backpatch(struct block *, struct block *) | {
struct block *next;
while (list) {
if (!list->sense) {
next = JT(list);
JT(list) = target;
} else {
next = JF(list);
JF(list) = target;
}
list = next;
}
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Find a route for an AppleTalk packet. This ought to get cached in the socket (later on...). We know about host routes and the fact that a route must be direct to broadcast. */ | static struct atalk_route* atrtr_find(struct atalk_addr *target) | /* Find a route for an AppleTalk packet. This ought to get cached in the socket (later on...). We know about host routes and the fact that a route must be direct to broadcast. */
static struct atalk_route* atrtr_find(struct atalk_addr *target) | {
struct atalk_route *net_route = NULL;
struct atalk_route *r;
read_lock_bh(&atalk_routes_lock);
for (r = atalk_routes; r; r = r->next) {
if (!(r->flags & RTF_UP))
continue;
if (r->target.s_net == target->s_net) {
if (r->flags & RTF_HOST) {
if (r->target.s_node == target->s_node)
goto out;
} e... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This file is part of the Simba project. */ | int mock_write_nvm_module_init(int res) | /* This file is part of the Simba project. */
int mock_write_nvm_module_init(int res) | {
harness_mock_write("nvm_module_init()",
NULL,
0);
harness_mock_write("nvm_module_init(): return (res)",
&res,
sizeof(res));
return (0);
} | eerimoq/simba | C++ | Other | 337 |
/* g e t W o r k i n g S e t B o u n d s */ | returnValue QProblemB_getWorkingSetBounds(QProblemB *_THIS, real_t *workingSetB) | /* g e t W o r k i n g S e t B o u n d s */
returnValue QProblemB_getWorkingSetBounds(QProblemB *_THIS, real_t *workingSetB) | {
int i;
int nV = QProblemB_getNV( _THIS );
for (i = 0; i < nV; i++) {
switch ( Bounds_getStatus( &(_THIS->bounds),i ) ) {
case ST_LOWER: workingSetB[i] = -1.0; break;
case ST_UPPER: workingSetB[i] = +1.0; break;
default: workingSetB[i] = 0.0; break;
}
}
return SUCCESSFUL_RETURN;
} | DanielMartensson/EmbeddedLapack | C++ | MIT License | 129 |
/* Routine to read bytes from the Modem Management Controller. The implementation is complicated by a lack of address lines, which prevents decoding of the low-order bit. (code has just been moved in the above function) We start by the end because it is the way it should be ! */ | static void mmc_read(u_long base, u_char o, u_char *b, int n) | /* Routine to read bytes from the Modem Management Controller. The implementation is complicated by a lack of address lines, which prevents decoding of the low-order bit. (code has just been moved in the above function) We start by the end because it is the way it should be ! */
static void mmc_read(u_long base, u_cha... | {
o += n;
b += n;
while(n-- > 0)
*(--b) = mmc_in(base, --o);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Setup the receive and transmit "rings". These pointers are the addresses of the rx and tx MAC DMA registers so they are fixed by the hardware */ | static void setup_hw_rings(struct au1000_private *aup, u32 rx_base, u32 tx_base) | /* Setup the receive and transmit "rings". These pointers are the addresses of the rx and tx MAC DMA registers so they are fixed by the hardware */
static void setup_hw_rings(struct au1000_private *aup, u32 rx_base, u32 tx_base) | {
int i;
for (i = 0; i < NUM_RX_DMA; i++) {
aup->rx_dma_ring[i] =
(volatile rx_dma_t *) (rx_base + sizeof(rx_dma_t)*i);
}
for (i = 0; i < NUM_TX_DMA; i++) {
aup->tx_dma_ring[i] =
(volatile tx_dma_t *) (tx_base + sizeof(tx_dma_t)*i);
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* v4l2 ioctl call backs. we are just a wrapper for v4l2_sub_devs. */ | static struct v4l2_device* get_v4l2_dev(struct file *file) | /* v4l2 ioctl call backs. we are just a wrapper for v4l2_sub_devs. */
static struct v4l2_device* get_v4l2_dev(struct file *file) | {
return &((struct radio_si4713_device *)video_drvdata(file))->v4l2_dev;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The Poll() function increases the rate that data is moved between the network and application, and can be called when the TCP instance is created successfully. Its use is optional. */ | EFI_STATUS EFIAPI Tcp6Poll(IN EFI_TCP6_PROTOCOL *This) | /* The Poll() function increases the rate that data is moved between the network and application, and can be called when the TCP instance is created successfully. Its use is optional. */
EFI_STATUS EFIAPI Tcp6Poll(IN EFI_TCP6_PROTOCOL *This) | {
SOCKET *Sock;
EFI_STATUS Status;
if (NULL == This) {
return EFI_INVALID_PARAMETER;
}
Sock = SOCK_FROM_THIS (This);
Status = Sock->ProtoHandler (Sock, SOCK_POLL, NULL);
return Status;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Determine if the ADC sample sequence overflow occurred. */ | xtBoolean xADCOverflow(unsigned long ulBase) | /* Determine if the ADC sample sequence overflow occurred. */
xtBoolean xADCOverflow(unsigned long ulBase) | {
unsigned long ulStatus;
xASSERT(ulBase == ADC0_BASE);
ulStatus = xHWREG(ulBase + ADC_SR);
return ((ulStatus & ADC_SR_OVERRUN_M) ? xtrue : xfalse);
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Turn the timing data intoa clock slot (0 for 33, 1 for 40, 2 for 50 and 3 for 66Mhz) */ | static int hpt37x_clock_slot(unsigned int freq, unsigned int base) | /* Turn the timing data intoa clock slot (0 for 33, 1 for 40, 2 for 50 and 3 for 66Mhz) */
static int hpt37x_clock_slot(unsigned int freq, unsigned int base) | {
unsigned int f = (base * freq) / 192;
if (f < 40)
return 0;
if (f < 45)
return 1;
if (f < 55)
return 2;
return 3;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This file is part of the Simba project. */ | int mock_write_eeprom_i2c_module_init(int res) | /* This file is part of the Simba project. */
int mock_write_eeprom_i2c_module_init(int res) | {
harness_mock_write("eeprom_i2c_module_init()",
NULL,
0);
harness_mock_write("eeprom_i2c_module_init(): return (res)",
&res,
sizeof(res));
return (0);
} | eerimoq/simba | C++ | Other | 337 |
/* Processing function for the Double Precision floating-point real FFT. */ | void arm_rfft_fast_f64(arm_rfft_fast_instance_f64 *S, float64_t *p, float64_t *pOut, uint8_t ifftFlag) | /* Processing function for the Double Precision floating-point real FFT. */
void arm_rfft_fast_f64(arm_rfft_fast_instance_f64 *S, float64_t *p, float64_t *pOut, uint8_t ifftFlag) | {
arm_cfft_instance_f64 * Sint = &(S->Sint);
Sint->fftLen = S->fftLenRFFT / 2;
if (ifftFlag)
{
merge_rfft_f64(S, p, pOut);
arm_cfft_f64( Sint, pOut, ifftFlag, 1);
}
else
{
arm_cfft_f64( Sint, p, ifftFlag, 1);
stage_rfft_f64(S, p, pOut);
}
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Init interrupts callback for the specified UART Port. */ | void xUARTIntCallbackInit(unsigned long ulBase, xtEventCallback xtUARTCallback) | /* Init interrupts callback for the specified UART Port. */
void xUARTIntCallbackInit(unsigned long ulBase, xtEventCallback xtUARTCallback) | {
xASSERT(UARTBaseValid(ulBase));
if (ulBase == UART0_BASE)
{
g_pfnUARTHandlerCallbacks[0] = xtUARTCallback;
}
else if (ulBase == UART1_BASE)
{
g_pfnUARTHandlerCallbacks[1] = xtUARTCallback;
}
else
{
g_pfnUARTHandlerCallbacks[2] = xtUARTCallback;
}
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Read the 64 bit we'd like to have - It a series of 64 bits showing up in the LSB of the base register. */ | static void ds1216_read(u8 __iomem *ioaddr, u8 *buf) | /* Read the 64 bit we'd like to have - It a series of 64 bits showing up in the LSB of the base register. */
static void ds1216_read(u8 __iomem *ioaddr, u8 *buf) | {
unsigned char c;
int i, j;
for (i = 0; i < 8; i++) {
c = 0;
for (j = 0; j < 8; j++)
c |= (readb(ioaddr) & 0x1) << j;
buf[i] = c;
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Function for reading the index previously written to the "index data base" in NV memory. */ | static uint8_t gzp_index_db_read(void) | /* Function for reading the index previously written to the "index data base" in NV memory. */
static uint8_t gzp_index_db_read(void) | {
uint8_t retval;
int16_t i;
for(i = (GZP_INDEX_DB_SIZE - 1); i >= 0; i--)
{
retval = *(uint8_t*)(GZP_INDEX_DB_ADR + i);
if(retval != 0xff)
{
break;
}
}
if(retval == 0xff)
{
retval = GZP_PARAMS_DB_MAX_ENTRIES;
}
else if((retval & 0xf0... | labapart/polymcu | C++ | null | 201 |
/* Current gdt points fs at the "master" per-cpu area: after this, it's on the real one. */ | void switch_to_new_gdt(int cpu) | /* Current gdt points fs at the "master" per-cpu area: after this, it's on the real one. */
void switch_to_new_gdt(int cpu) | {
struct desc_ptr gdt_descr;
gdt_descr.address = (long)get_cpu_gdt_table(cpu);
gdt_descr.size = GDT_SIZE - 1;
load_gdt(&gdt_descr);
load_percpu_segment(cpu);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This routine is used to return substring before period '.' or '\0' Caller should respsonsible of substr space allocation & free */ | STATIC VOID GetSubStringBeforePeriod(IN CHAR16 *Str, OUT CHAR16 *SubStr, OUT UINTN *SubStrLen) | /* This routine is used to return substring before period '.' or '\0' Caller should respsonsible of substr space allocation & free */
STATIC VOID GetSubStringBeforePeriod(IN CHAR16 *Str, OUT CHAR16 *SubStr, OUT UINTN *SubStrLen) | {
UINTN Index;
for (Index = 0; Str[Index] != L'.' && Str[Index] != L'\0'; Index++) {
SubStr[Index] = Str[Index];
}
SubStr[Index] = L'\0';
*SubStrLen = Index;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Enables or disables the USART's Smart Card mode. */ | void USART_EnableSmartCard(USART_Module *USARTx, FunctionalState Cmd) | /* Enables or disables the USART's Smart Card mode. */
void USART_EnableSmartCard(USART_Module *USARTx, FunctionalState Cmd) | {
assert_param(IS_USART_123_PERIPH(USARTx));
assert_param(IS_FUNCTIONAL_STATE(Cmd));
if (Cmd != DISABLE)
{
USARTx->CTRL3 |= CTRL3_SCMEN_SET;
}
else
{
USARTx->CTRL3 &= CTRL3_SCMEN_RESET;
}
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Unregister SNAP clients. Protocols no longer want to play with us ... */ | void unregister_snap_client(struct datalink_proto *proto) | /* Unregister SNAP clients. Protocols no longer want to play with us ... */
void unregister_snap_client(struct datalink_proto *proto) | {
spin_lock_bh(&snap_lock);
list_del_rcu(&proto->node);
spin_unlock_bh(&snap_lock);
synchronize_net();
kfree(proto);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Fills each DCMI_InitStruct member with its default value. */ | void DCMI_StructInit(DCMI_InitTypeDef *DCMI_InitStruct) | /* Fills each DCMI_InitStruct member with its default value. */
void DCMI_StructInit(DCMI_InitTypeDef *DCMI_InitStruct) | {
DCMI_InitStruct->DCMI_CaptureMode = DCMI_CaptureMode_Continuous;
DCMI_InitStruct->DCMI_SynchroMode = DCMI_SynchroMode_Hardware;
DCMI_InitStruct->DCMI_PCKPolarity = DCMI_PCKPolarity_Falling;
DCMI_InitStruct->DCMI_VSPolarity = DCMI_VSPolarity_Low;
DCMI_InitStruct->DCMI_HSPolarity = DCMI_HSPolarity_Low;
DCMI... | MaJerle/stm32f429 | C++ | null | 2,036 |
/* ll uses the opcode of lwc0 and sc uses the opcode of swc0. That is both opcodes are supposed to result in coprocessor unusable exceptions if executed on ll/sc-less processors. That's the theory. In practice a few processors such as NEC's VR4100 throw reserved instruction exceptions instead, so we're doing the emulat... | static int simulate_llsc(struct pt_regs *regs, unsigned int opcode) | /* ll uses the opcode of lwc0 and sc uses the opcode of swc0. That is both opcodes are supposed to result in coprocessor unusable exceptions if executed on ll/sc-less processors. That's the theory. In practice a few processors such as NEC's VR4100 throw reserved instruction exceptions instead, so we're doing the emulat... | {
if ((opcode & OPCODE) == LL)
return simulate_ll(regs, opcode);
if ((opcode & OPCODE) == SC)
return simulate_sc(regs, opcode);
return -1;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Get USB Device Last Frame Number Parameters: None Return Value: Frame Number */ | uint32_t USBD_GetFrame(void) | /* Get USB Device Last Frame Number Parameters: None Return Value: Frame Number */
uint32_t USBD_GetFrame(void) | {
return ((LPC_USBx->FRINDEX_D >> 3) & 0x0FFF);
} | ARMmbed/DAPLink | C++ | Apache License 2.0 | 2,140 |
/* Sets bits in UDCCR, leaving DME and FST bits as they were. */ | static void udc_set_mask_UDCCR(struct pxa_udc *udc, int mask) | /* Sets bits in UDCCR, leaving DME and FST bits as they were. */
static void udc_set_mask_UDCCR(struct pxa_udc *udc, int mask) | {
u32 udccr = udc_readl(udc, UDCCR);
udc_writel(udc, UDCCR,
(udccr & UDCCR_MASK_BITS) | (mask & UDCCR_MASK_BITS));
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Optional External Data: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ext RouterID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ext Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ext Autonomous System Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+... | void dissect_eigrp_ipx_tlv(proto_item *ti, proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, guint16 tlv) | /* Optional External Data: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ext RouterID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ext Router ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ext Autonomous System Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+... | {
int offset = 0;
int unreachable = FALSE;
offset = dissect_eigrp_nexthop(tree, tvb, EIGRP_AF_IPX, offset);
if ((tlv & EIGRP_TLV_TYPEMASK) == EIGRP_TLV_EXTERNAL) {
offset = dissect_eigrp_ipx_extdata(tree, tvb, offset);
}
offset = dissect_eigrp_legacy_metric(tree, tvb, offset);
d... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Throw away all pending data and cancel the corking. Socket is locked. */ | static void udp_v6_flush_pending_frames(struct sock *sk) | /* Throw away all pending data and cancel the corking. Socket is locked. */
static void udp_v6_flush_pending_frames(struct sock *sk) | {
struct udp_sock *up = udp_sk(sk);
if (up->pending == AF_INET)
udp_flush_pending_frames(sk);
else if (up->pending) {
up->len = 0;
up->pending = 0;
ip6_flush_pending_frames(sk);
}
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This initializes the tags structure for each client instance. */ | static int p9_tag_init(struct p9_client *c) | /* This initializes the tags structure for each client instance. */
static int p9_tag_init(struct p9_client *c) | {
int err = 0;
c->tagpool = p9_idpool_create();
if (IS_ERR(c->tagpool)) {
err = PTR_ERR(c->tagpool);
c->tagpool = NULL;
goto error;
}
p9_idpool_get(c->tagpool);
c->max_tag = 0;
error:
return err;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Z8530 transmit interrupt handler for the PIO mode. The basic idea is to attempt to keep the FIFO fed. We fill as many bytes in as possible, its quite possible that we won't keep up with the data rate otherwise. */ | static void z8530_tx(struct z8530_channel *c) | /* Z8530 transmit interrupt handler for the PIO mode. The basic idea is to attempt to keep the FIFO fed. We fill as many bytes in as possible, its quite possible that we won't keep up with the data rate otherwise. */
static void z8530_tx(struct z8530_channel *c) | {
while(c->txcount) {
if(!(read_zsreg(c, R0)&4))
return;
c->txcount--;
write_zsreg(c, R8, *c->tx_ptr++);
write_zsctrl(c, RES_H_IUS);
if(c->txcount==0)
{
write_zsctrl(c, RES_EOM_L);
write_zsreg(c, R10, c->regs[10]&~ABUNDER);
}
}
write_zsctrl(c, RES_Tx_P);
z8530_tx_done(c);
write_zsctrl(c, R... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Read whether the specifie DMA Channel flag is set or not. */ | uint8_t DMA_ReadStatusFlag(DMA_FLAG_T flag) | /* Read whether the specifie DMA Channel flag is set or not. */
uint8_t DMA_ReadStatusFlag(DMA_FLAG_T flag) | {
if ((flag & 0x10000000) != RESET)
{
if ((DMA2->INTSTS & flag) != RESET)
{
return SET ;
}
else
{
return RESET ;
}
}
else
{
if ((DMA1->INTSTS & flag) != RESET)
{
return SET ;
}
else
... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* For all online tty's, try sending data to the lower levels. */ | void isdn_tty_modem_xmit(void) | /* For all online tty's, try sending data to the lower levels. */
void isdn_tty_modem_xmit(void) | {
int ton = 1;
int i;
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
modem_info *info = &dev->mdm.info[i];
if (info->online) {
ton = 1;
isdn_tty_senddown(info);
isdn_tty_tint(info);
}
}
isdn_timer_ctrl(ISDN_TIMER_MODEMXMIT, ton);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* void _reassoc_timer_hdl(void *FunctionContext) { _adapter *padapter = (_adapter *)FunctionContext; reassoc_timer_hdl(padapter); } */ | void init_mlme_ext_timer(_adapter *padapter) | /* void _reassoc_timer_hdl(void *FunctionContext) { _adapter *padapter = (_adapter *)FunctionContext; reassoc_timer_hdl(padapter); } */
void init_mlme_ext_timer(_adapter *padapter) | { struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
_init_timer(&pmlmeext->survey_timer, padapter->pnetdev, _survey_timer_hdl, padapter);
_init_timer(&pmlmeext->link_timer, padapter->pnetdev, _link_timer_hdl, padapter);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Return the number of controllable memory banks in powerdomain pwrdm, starting with 1. Returns -EINVAL if the powerdomain pointer is null. */ | int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm) | /* Return the number of controllable memory banks in powerdomain pwrdm, starting with 1. Returns -EINVAL if the powerdomain pointer is null. */
int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm) | {
if (!pwrdm)
return -EINVAL;
return pwrdm->banks;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This function is called by button_sequence_finished to search through the list of callback functions, and call any of them whose count argument matches the current count of button presses. It starts at the beginning of the list and works up to the end. It will refuse to follow a null pointer (which should never happ... | static void button_consume_callbacks(int bpcount) | /* This function is called by button_sequence_finished to search through the list of callback functions, and call any of them whose count argument matches the current count of button presses. It starts at the beginning of the list and works up to the end. It will refuse to follow a null pointer (which should never happ... | {
int lp = 0;
for (; lp <= 31; lp++) {
if ((button_callback_list [lp].count) == bpcount) {
if (button_callback_list [lp].callback) {
button_callback_list[lp].callback();
}
}
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Output: void, but we will add to proto tree if !NULL. */ | static void dissect_hello_is_neighbors_clv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int id_length _U_, int length) | /* Output: void, but we will add to proto tree if !NULL. */
static void dissect_hello_is_neighbors_clv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int id_length _U_, int length) | {
while ( length > 0 ) {
if (length<6) {
proto_tree_add_expert_format(tree, pinfo, &ei_isis_hello_short_packet, tvb, offset, -1,
"short is neighbor (%d vs 6)", length );
return;
}
proto_tree_add_item(tree, hf_isis_hello_is_neighbor, tvb, offset, 6, ENC... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* One notified function to cleanup the allocated DMA buffers at the end of PEI. */ | EFI_STATUS EFIAPI UfsEndOfPei(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi) | /* One notified function to cleanup the allocated DMA buffers at the end of PEI. */
EFI_STATUS EFIAPI UfsEndOfPei(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi) | {
UFS_PEIM_HC_PRIVATE_DATA *Private;
Private = GET_UFS_PEIM_HC_PRIVATE_DATA_FROM_THIS_NOTIFY (NotifyDescriptor);
if ((Private->Pool != NULL) && (Private->Pool->Head != NULL)) {
UfsPeimFreeMemPool (Private->Pool);
}
if (Private->UtpTmrlBase != NULL) {
IoMmuFreeBuffer (
EFI_SIZE_TO_PAGES (Private... | tianocore/edk2 | C++ | Other | 4,240 |
/* If FirstEntry is NULL, then ASSERT(). If SecondEntry is NULL, then ASSERT(). If PcdVerifyNodeInList is TRUE and SecondEntry and FirstEntry are not in the same linked list, then ASSERT(). If PcdMaximumLinkedListLength is not zero, and the number of nodes in the linked list containing the FirstEntry and SecondEntry no... | LIST_ENTRY* EFIAPI SwapListEntries(IN OUT LIST_ENTRY *FirstEntry, IN OUT LIST_ENTRY *SecondEntry) | /* If FirstEntry is NULL, then ASSERT(). If SecondEntry is NULL, then ASSERT(). If PcdVerifyNodeInList is TRUE and SecondEntry and FirstEntry are not in the same linked list, then ASSERT(). If PcdMaximumLinkedListLength is not zero, and the number of nodes in the linked list containing the FirstEntry and SecondEntry no... | {
LIST_ENTRY *Ptr;
if (FirstEntry == SecondEntry) {
return SecondEntry;
}
ASSERT_VERIFY_NODE_IN_VALID_LIST (FirstEntry, SecondEntry, TRUE);
Ptr = RemoveEntryList (FirstEntry);
if (Ptr->BackLink == SecondEntry) {
return InsertTailList (SecondEntry, FirstEntry);
}
if (Ptr == InsertHeadList (Secon... | tianocore/edk2 | C++ | Other | 4,240 |
/* Attach a device driver that wants to receive events from the sequencer. Returns the new port number on success. A driver that wants to receive the events converted to midi, will use snd_seq_midisynth_register_port(). */ | int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp, int cap, int type, int midi_channels, int midi_voices, char *portname) | /* Attach a device driver that wants to receive events from the sequencer. Returns the new port number on success. A driver that wants to receive the events converted to midi, will use snd_seq_midisynth_register_port(). */
int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp, int cap, int type,... | {
struct snd_seq_port_info portinfo;
int ret;
memset(&portinfo, 0, sizeof(portinfo));
portinfo.addr.client = client;
strlcpy(portinfo.name, portname ? portname : "Unamed port",
sizeof(portinfo.name));
portinfo.capability = cap;
portinfo.type = type;
portinfo.kernel = pcbp;
portinfo.midi_channels = midi_chan... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Return the current value of a status parameter. */ | SQLITE_PRIVATE int sqlite3StatusValue(int) | /* Return the current value of a status parameter. */
SQLITE_PRIVATE int sqlite3StatusValue(int) | {
wsdStatInit;
assert( op>=0 && op<ArraySize(wsdStat.nowValue) );
return wsdStat.nowValue[op];
} | DC-SWAT/DreamShell | C++ | null | 404 |
/* Send a CPC_Control command to change behaviour when interface receives a CAN message, bus error or CAN state changed notifications. */ | static int ems_usb_control_cmd(struct ems_usb *dev, u8 val) | /* Send a CPC_Control command to change behaviour when interface receives a CAN message, bus error or CAN state changed notifications. */
static int ems_usb_control_cmd(struct ems_usb *dev, u8 val) | {
struct ems_cpc_msg cmd;
cmd.type = CPC_CMD_TYPE_CONTROL;
cmd.length = CPC_MSG_HEADER_LEN + 1;
cmd.msgid = 0;
cmd.msg.generic[0] = val;
return ems_usb_command_msg(dev, &cmd);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Some SPI devices require active chip-select over multiple transactions, we achieve this using a GPIO. Still, the SPI controller has to be configured to use one of its own chipselects. To use this feature you have to implement board_spi_cs_gpio() to assign a gpio value for each cs (-1 if cs doesn't need to use gpio).... | static int setup_cs_gpio(struct mxc_spi_slave *mxcs, unsigned int bus, unsigned int cs) | /* Some SPI devices require active chip-select over multiple transactions, we achieve this using a GPIO. Still, the SPI controller has to be configured to use one of its own chipselects. To use this feature you have to implement board_spi_cs_gpio() to assign a gpio value for each cs (-1 if cs doesn't need to use gpio).... | {
int ret;
mxcs->gpio = board_spi_cs_gpio(bus, cs);
if (mxcs->gpio == -1)
return 0;
gpio_request(mxcs->gpio, "spi-cs");
ret = gpio_direction_output(mxcs->gpio, !(mxcs->ss_pol));
if (ret) {
printf("mxc_spi: cannot setup gpio %d\n", mxcs->gpio);
return -EINVAL;
}
return 0;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Notify core of sending a packet. Ackcode is the ack code returned for async transmits or ACKX_SEND_ERROR if the transmission failed completely; ACKX_NONE for other cases (internal errors that don't justify a panic). */ | void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet, int ackcode) | /* Notify core of sending a packet. Ackcode is the ack code returned for async transmits or ACKX_SEND_ERROR if the transmission failed completely; ACKX_NONE for other cases (internal errors that don't justify a panic). */
void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet, int ackcode) | {
unsigned long flags;
spin_lock_irqsave(&pending_packets_lock, flags);
packet->ack_code = ackcode;
if (packet->no_waiter || packet->state == hpsb_complete) {
spin_unlock_irqrestore(&pending_packets_lock, flags);
hpsb_free_packet(packet);
return;
}
atomic_dec(&packet->refcnt);
if (ackcode != ACK_PENDING ||... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Initialize the state structure for the slots bay fan control loop */ | static int init_slots_state(struct slots_pid_state *state) | /* Initialize the state structure for the slots bay fan control loop */
static int init_slots_state(struct slots_pid_state *state) | {
int err;
state->ticks = 1;
state->first = 1;
state->pwm = 50;
state->monitor = attach_i2c_chip(XSERVE_SLOTS_LM75, "slots_temp");
if (state->monitor == NULL)
return -ENODEV;
err = device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
err |= device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* outsb/w/l all write a series of bytes/words/longs to a fixed port address. However as the port address doesn't change we only need to convert the port address to real address once. */ | void generic_outsb(unsigned long port, const void *src, unsigned long count) | /* outsb/w/l all write a series of bytes/words/longs to a fixed port address. However as the port address doesn't change we only need to convert the port address to real address once. */
void generic_outsb(unsigned long port, const void *src, unsigned long count) | {
__raw_writesb(__ioport_map(port, 1), src, count);
dummy_read();
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Parameters: p pointer to databuffer plus escape-character count length of buffer pluscount count of valid escape-characters so far lastplus timestamp of last character */ | static void isdn_tty_check_esc(const u_char *, u_char, int, int *, u_long *) | /* Parameters: p pointer to databuffer plus escape-character count length of buffer pluscount count of valid escape-characters so far lastplus timestamp of last character */
static void isdn_tty_check_esc(const u_char *, u_char, int, int *, u_long *) | {
if (plus > 127)
return;
if (count > 3) {
p += count - 3;
count = 3;
*pluscount = 0;
}
while (count > 0) {
if (*(p++) == plus) {
if ((*pluscount)++) {
if (time_after(jiffies, *lastplus + PLUSWAIT1))
*pluscount = 1;
} else {
if (time_before(jiffies, *lastplus + PLUSWAIT2))
*pluscou... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Check if filesystem has at least 1 free block available for allocation. */ | static int ext3_has_free_blocks(struct ext3_sb_info *sbi) | /* Check if filesystem has at least 1 free block available for allocation. */
static int ext3_has_free_blocks(struct ext3_sb_info *sbi) | {
ext3_fsblk_t free_blocks, root_blocks;
free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count);
if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) &&
sbi->s_resuid != current_fsuid() &&
(sbi->s_resgid == 0 || !in_group_p (sbi-... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Construction function for DMAMOV instruction. This function fills the program buffer with the constructed instruction. */ | static INLINE int XDmaPs_Instr_DMAMOV(char *DmaProg, unsigned Rd, u32 Imm) | /* Construction function for DMAMOV instruction. This function fills the program buffer with the constructed instruction. */
static INLINE int XDmaPs_Instr_DMAMOV(char *DmaProg, unsigned Rd, u32 Imm) | {
*DmaProg = 0xBC;
*(DmaProg + 1) = Rd & 0x7;
XDmaPs_Memcpy4(DmaProg + 2, (char *)&Imm);
return 6;
} | ua1arn/hftrx | C++ | null | 69 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.