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 |
|---|---|---|---|---|---|---|---|
/* Send a request to define the level of priority used to arbitrate concurrent Coex and Wlan requests. */ | sl_status_t sl_wfx_pta_priority(uint32_t priority) | /* Send a request to define the level of priority used to arbitrate concurrent Coex and Wlan requests. */
sl_status_t sl_wfx_pta_priority(uint32_t priority) | {
sl_status_t result;
sl_wfx_pta_priority_req_body_t payload;
payload.priority = sl_wfx_htole32(priority);
result = sl_wfx_send_command(SL_WFX_PTA_PRIORITY_REQ_ID, &payload, sizeof(payload), SL_WFX_STA_INTERFACE, NULL);
return result;
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* The caller must have already set SCCR, SERDES and the PCIE_LAW BARs must have been set to cover all of the requested regions. */ | void mpc83xx_pcie_init(int num_buses, struct pci_region **reg) | /* The caller must have already set SCCR, SERDES and the PCIE_LAW BARs must have been set to cover all of the requested regions. */
void mpc83xx_pcie_init(int num_buses, struct pci_region **reg) | {
int i;
udelay(100000);
if (num_buses > ARRAY_SIZE(mpc83xx_pcie_cfg_space)) {
printf("Second PCIE host contoller not configured!\n");
num_buses = ARRAY_SIZE(mpc83xx_pcie_cfg_space);
}
for (i = 0; i < num_buses; i++)
mpc83xx_pcie_init_bus(i, reg[i]);
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* tipc_port_recv_sections(): Concatenate and deliver sectioned message for this node. */ | int tipc_port_recv_sections(struct port *sender, unsigned int num_sect, struct iovec const *msg_sect) | /* tipc_port_recv_sections(): Concatenate and deliver sectioned message for this node. */
int tipc_port_recv_sections(struct port *sender, unsigned int num_sect, struct iovec const *msg_sect) | {
struct sk_buff *buf;
int res;
res = msg_build(&sender->publ.phdr, msg_sect, num_sect,
MAX_MSG_SIZE, !sender->user_port, &buf);
if (likely(buf))
tipc_port_recv_msg(buf);
return res;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Handler for SysTick interrupt. Increments the timestamp counter. */ | void SysTick_Handler(void) | /* Handler for SysTick interrupt. Increments the timestamp counter. */
void SysTick_Handler(void) | {
g_ul_tick_count++;
if ((g_ul_tick_count % 10) == 0) {
rtouch_process();
}
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Set a Group of Pins Atomic.
Set one or more pins of the given GPIO port to 1 in an atomic operation. */ | void gpio_set(uint32_t gpioport, uint16_t gpios) | /* Set a Group of Pins Atomic.
Set one or more pins of the given GPIO port to 1 in an atomic operation. */
void gpio_set(uint32_t gpioport, uint16_t gpios) | {
GPIO_BSRR(gpioport) = gpios;
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* Return value: CAPI result code (CAPI_NOERROR if at least one ISDN controller is ready for use, CAPI_REGNOTINSTALLED otherwise) */ | u16 capi20_isinstalled(void) | /* Return value: CAPI result code (CAPI_NOERROR if at least one ISDN controller is ready for use, CAPI_REGNOTINSTALLED otherwise) */
u16 capi20_isinstalled(void) | {
int i;
for (i = 0; i < CAPI_MAXCONTR; i++) {
if (capi_cards[i] && capi_cards[i]->cardstate == CARD_RUNNING)
return CAPI_NOERROR;
}
return CAPI_REGNOTINSTALLED;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function waits for FIFO to empty. It returns 1 when FIFO is empty, or 0 if the timeout @timeout is reached before, or if a signal is pending. */ | static unsigned int parport_ip32_drain_fifo(struct parport *p, unsigned long timeout) | /* This function waits for FIFO to empty. It returns 1 when FIFO is empty, or 0 if the timeout @timeout is reached before, or if a signal is pending. */
static unsigned int parport_ip32_drain_fifo(struct parport *p, unsigned long timeout) | {
unsigned long expire = jiffies + timeout;
unsigned int polling_interval;
unsigned int counter;
for (counter = 0; counter < 40; counter++) {
if (parport_ip32_read_econtrol(p) & ECR_F_EMPTY)
break;
if (time_after(jiffies, expire))
break;
if (signal_pending(current))
break;
udelay(5);
}
polling_in... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* get ovsr & ovsr_adj parameters according to the given baudrate and UART IP clock. */ | void USI_UARTBaudParaGetFull(u32 IPclk, u32 baudrate, u32 *ovsr, u32 *ovsr_adj) | /* get ovsr & ovsr_adj parameters according to the given baudrate and UART IP clock. */
void USI_UARTBaudParaGetFull(u32 IPclk, u32 baudrate, u32 *ovsr, u32 *ovsr_adj) | {
u32 i;
u32 Remainder;
u32 TempAdj = 0;
u32 TempMultly;
*ovsr = IPclk / baudrate;
Remainder = IPclk % baudrate;
for(i = 0; i < 11; i++){
TempAdj = TempAdj << 1;
TempMultly = (Remainder * (12-i));
TempAdj |= ((TempMultly / baudrate - (TempMultly - Remainder) / baudrate) ? 1 : 0);
}
*ovsr_adj = TempAdj;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* BlockIo installation notification function. Find out all the current BlockIO PPIs in the system and add them into private data. Assume there is */ | EFI_STATUS EFIAPI BlockIoNotifyEntry(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi) | /* BlockIo installation notification function. Find out all the current BlockIO PPIs in the system and add them into private data. Assume there is */
EFI_STATUS EFIAPI BlockIoNotifyEntry(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi) | {
if (CompareGuid (NotifyDescriptor->Guid, &gEfiPeiVirtualBlockIo2PpiGuid)) {
UpdateBlocksAndVolumes (mPrivateData, TRUE);
} else {
UpdateBlocksAndVolumes (mPrivateData, FALSE);
}
return EFI_SUCCESS;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This is used when a search for a new attribute is being started to reset the search context to the beginning. */ | void ntfs_attr_reinit_search_ctx(ntfs_attr_search_ctx *ctx) | /* This is used when a search for a new attribute is being started to reset the search context to the beginning. */
void ntfs_attr_reinit_search_ctx(ntfs_attr_search_ctx *ctx) | {
if (likely(!ctx->base_ntfs_ino)) {
ctx->is_first = true;
ctx->attr = (ATTR_RECORD*)((u8*)ctx->mrec +
le16_to_cpu(ctx->mrec->attrs_offset));
ctx->al_entry = NULL;
return;
}
if (ctx->ntfs_ino != ctx->base_ntfs_ino)
unmap_extent_mft_record(ctx->ntfs_ino);
ntfs_attr_init_search_ctx(ctx, ctx->base_ntfs_i... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function divides the 64-bit signed value Dividend by the 64-bit signed value Divisor and generates a 64-bit signed quotient. If Remainder is not NULL, then the 64-bit signed remainder is returned in Remainder. This function returns the 64-bit signed quotient. */ | INT64 EFIAPI InternalMathDivRemS64x64(IN INT64 Dividend, IN INT64 Divisor, OUT INT64 *Remainder OPTIONAL) | /* This function divides the 64-bit signed value Dividend by the 64-bit signed value Divisor and generates a 64-bit signed quotient. If Remainder is not NULL, then the 64-bit signed remainder is returned in Remainder. This function returns the 64-bit signed quotient. */
INT64 EFIAPI InternalMathDivRemS64x64(IN INT64 Di... | {
if (Remainder != NULL) {
*Remainder = Dividend % Divisor;
}
return Dividend / Divisor;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Return 1 meaning mf should be freed from _base_interrupt 0 means the mf is freed from this function. */ | static u8 _scsih_tm_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) | /* Return 1 meaning mf should be freed from _base_interrupt 0 means the mf is freed from this function. */
static u8 _scsih_tm_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) | {
MPI2DefaultReply_t *mpi_reply;
if (ioc->tm_cmds.status == MPT2_CMD_NOT_USED)
return 1;
if (ioc->tm_cmds.smid != smid)
return 1;
ioc->tm_cmds.status |= MPT2_CMD_COMPLETE;
mpi_reply = mpt2sas_base_get_reply_virt_addr(ioc, reply);
if (mpi_reply) {
memcpy(ioc->tm_cmds.reply, mpi_reply, mpi_reply->MsgLength*4... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Clear Selected pin interrupt status only when the pin was triggered by edge-sensitive.
This function clears the selected pin interrupt status. */ | void PINT_PinInterruptClrStatus(PINT_Type *base, pint_pin_int_t pintr) | /* Clear Selected pin interrupt status only when the pin was triggered by edge-sensitive.
This function clears the selected pin interrupt status. */
void PINT_PinInterruptClrStatus(PINT_Type *base, pint_pin_int_t pintr) | {
uint32_t pinIntMode = base->ISEL & (1UL << (uint32_t)pintr);
uint32_t pinIntStatus = base->IST & (1UL << (uint32_t)pintr);
if ((pinIntMode == 0x0UL) && (pinIntStatus != 0x0UL))
{
base->IST = (1UL << (uint32_t)pintr);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Returns: (skip): TRUE if the call succeded, FALSE if @error is set. */ | gboolean _g_freedesktop_dbus_call_update_activation_environment_finish(_GFreedesktopDBus *proxy, GAsyncResult *res, GError **error) | /* Returns: (skip): TRUE if the call succeded, FALSE if @error is set. */
gboolean _g_freedesktop_dbus_call_update_activation_environment_finish(_GFreedesktopDBus *proxy, GAsyncResult *res, GError **error) | {
GVariant *_ret;
_ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
if (_ret == NULL)
goto _out;
g_variant_get (_ret,
"()");
g_variant_unref (_ret);
_out:
return _ret != NULL;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Find a dhcp client node by ip address */ | static struct dhcp_client_node* dhcp_client_find(struct dhcp_server *dhcpserver, struct dhcp_msg *msg, u8_t *opt_buf, u16_t len) | /* Find a dhcp client node by ip address */
static struct dhcp_client_node* dhcp_client_find(struct dhcp_server *dhcpserver, struct dhcp_msg *msg, u8_t *opt_buf, u16_t len) | {
u8_t *opt;
struct dhcp_client_node *node;
node = dhcp_client_find_by_mac(dhcpserver, msg->chaddr, msg->hlen);
if (node != NULL)
{
return node;
}
opt = dhcp_server_option_find(opt_buf, len, DHCP_OPTION_REQUESTED_IP);
if (opt != NULL)
{
node = dhcp_client_find_by_ip(d... | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* In case of an error wait 1s before rebooting the modem if the modem don't request reboot (-EAGAIN). Monitor the modem every 1s. */ | static int uea_kthread(void *data) | /* In case of an error wait 1s before rebooting the modem if the modem don't request reboot (-EAGAIN). Monitor the modem every 1s. */
static int uea_kthread(void *data) | {
struct uea_softc *sc = data;
int ret = -EAGAIN;
set_freezable();
uea_enters(INS_TO_USBDEV(sc));
while (!kthread_should_stop()) {
if (ret < 0 || sc->reset)
ret = uea_start_reset(sc);
if (!ret)
ret = sc->stat(sc);
if (ret != -EAGAIN)
uea_wait(sc, 0, msecs_to_jiffies(1000));
try_to_freeze();
}
ue... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Search VLAN device path node in Device Path of specified ServiceHandle and return its VLAN ID. If no VLAN device path node found, then this ServiceHandle is not a VLAN device handle, and 0 will be returned. */ | UINT16 EFIAPI NetLibGetVlanId(IN EFI_HANDLE ServiceHandle) | /* Search VLAN device path node in Device Path of specified ServiceHandle and return its VLAN ID. If no VLAN device path node found, then this ServiceHandle is not a VLAN device handle, and 0 will be returned. */
UINT16 EFIAPI NetLibGetVlanId(IN EFI_HANDLE ServiceHandle) | {
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_DEVICE_PATH_PROTOCOL *Node;
DevicePath = DevicePathFromHandle (ServiceHandle);
if (DevicePath == NULL) {
return 0;
}
Node = DevicePath;
while (!IsDevicePathEnd (Node)) {
if ((Node->Type == MESSAGING_DEVICE_PATH) && (Node->SubType == MSG_VLAN_DP)) {
... | tianocore/edk2 | C++ | Other | 4,240 |
/* Thread creation with priority is higher than current thread.
_handler_k_thread_create validation. */ | ZTEST(mem_protect_kobj, test_create_new_higher_prio_thread_from_user) | /* Thread creation with priority is higher than current thread.
_handler_k_thread_create validation. */
ZTEST(mem_protect_kobj, test_create_new_higher_prio_thread_from_user) | {
set_fault_valid(false);
k_thread_access_grant(&child_thread,
&extra_thread,
&extra_stack);
k_thread_create(&child_thread,
child_stack,
KOBJECT_STACK_SIZE,
higher_prio_from_user_child,
NULL, NULL, NULL,
0, K_USER, K_NO_WAIT);
k_thread_join(&child_thread, K_FOREVER);
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* param base SCTimer peripheral base address param whichIO The output to toggle param event Event number that will trigger the output change */ | void SCTIMER_SetupOutputToggleAction(SCT_Type *base, uint32_t whichIO, uint32_t event) | /* param base SCTimer peripheral base address param whichIO The output to toggle param event Event number that will trigger the output change */
void SCTIMER_SetupOutputToggleAction(SCT_Type *base, uint32_t whichIO, uint32_t event) | {
assert(whichIO < (uint32_t)FSL_FEATURE_SCT_NUMBER_OF_OUTPUTS);
uint32_t reg;
base->OUT[whichIO].CLR |= (1UL << event);
base->OUT[whichIO].SET |= (1UL << event);
reg = base->RES;
reg &= ~(((uint32_t)SCT_RES_O0RES_MASK) << (2U * whichIO));
reg |= ((uint32_t)(kSCTIMER_ResolveToggle)) << (2U *... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Converts a text device path node to USB video device path structure. */ | EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextUsbVideo(CHAR16 *TextDeviceNode) | /* Converts a text device path node to USB video device path structure. */
EFI_DEVICE_PATH_PROTOCOL* DevPathFromTextUsbVideo(CHAR16 *TextDeviceNode) | {
USB_CLASS_TEXT UsbClassText;
UsbClassText.ClassExist = FALSE;
UsbClassText.Class = USB_CLASS_VIDEO;
UsbClassText.SubClassExist = TRUE;
return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* return The status flags. This is the logical OR of members of the enumeration ::snvs_status_flags_t */ | uint32_t SNVS_LP_SRTC_GetStatusFlags(SNVS_Type *base) | /* return The status flags. This is the logical OR of members of the enumeration ::snvs_status_flags_t */
uint32_t SNVS_LP_SRTC_GetStatusFlags(SNVS_Type *base) | {
uint32_t flags = 0U;
if (base->LPSR & SNVS_LPSR_LPTA_MASK)
{
flags |= kSNVS_SRTC_AlarmInterruptFlag;
}
return flags;
} | nanoframework/nf-interpreter | C++ | MIT License | 293 |
/* QSPI MSP De-Initialization This function frees the hardware resources used in this example: */ | void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi) | /* QSPI MSP De-Initialization This function frees the hardware resources used in this example: */
void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi) | {
HAL_NVIC_DisableIRQ(QUADSPI_IRQn);
HAL_GPIO_DeInit(QSPI_CS_GPIO_PORT, QSPI_CS_PIN);
HAL_GPIO_DeInit(QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN);
HAL_GPIO_DeInit(QSPI_D0_GPIO_PORT, QSPI_D0_PIN);
HAL_GPIO_DeInit(QSPI_D1_GPIO_PORT, QSPI_D1_PIN);
HAL_GPIO_DeInit(QSPI_D2_GPIO_PORT, QSPI_D2_PIN);
HAL_GPIO_DeInit(QSPI_D... | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* get memory for JOURNAL_NUM_BITMAPS worth of bitmaps. jb_array is the array to be filled in. */ | int reiserfs_allocate_list_bitmaps(struct super_block *sb, struct reiserfs_list_bitmap *jb_array, unsigned int bmap_nr) | /* get memory for JOURNAL_NUM_BITMAPS worth of bitmaps. jb_array is the array to be filled in. */
int reiserfs_allocate_list_bitmaps(struct super_block *sb, struct reiserfs_list_bitmap *jb_array, unsigned int bmap_nr) | {
int i;
int failed = 0;
struct reiserfs_list_bitmap *jb;
int mem = bmap_nr * sizeof(struct reiserfs_bitmap_node *);
for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) {
jb = jb_array + i;
jb->journal_list = NULL;
jb->bitmaps = vmalloc(mem);
if (!jb->bitmaps) {
reiserfs_warning(sb, "clm-2000", "unable to "
... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Deal with the controller. Do everything we think we need to have the interface operating according to the desired format. */ | static void cafe_ctlr_dma(struct cafe_camera *cam) | /* Deal with the controller. Do everything we think we need to have the interface operating according to the desired format. */
static void cafe_ctlr_dma(struct cafe_camera *cam) | {
cafe_reg_write(cam, REG_Y0BAR, cam->dma_handles[0]);
cafe_reg_write(cam, REG_Y1BAR, cam->dma_handles[1]);
if (cam->nbufs > 2) {
cafe_reg_write(cam, REG_Y2BAR, cam->dma_handles[2]);
cafe_reg_clear_bit(cam, REG_CTRL1, C1_TWOBUFS);
}
else
cafe_reg_set_bit(cam, REG_CTRL1, C1_TWOBUFS);
cafe_reg_write(cam, REG_... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Transmit one 4-9 bit frame.
Notice that possible parity/stop bits in asynchronous mode are not considered part of specified frame bit length. */ | void USART_Tx(USART_TypeDef *usart, uint8_t data) | /* Transmit one 4-9 bit frame.
Notice that possible parity/stop bits in asynchronous mode are not considered part of specified frame bit length. */
void USART_Tx(USART_TypeDef *usart, uint8_t data) | {
while (!(usart->STATUS & USART_STATUS_TXBL));
usart->TXDATA = (uint32_t)data;
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Sets MAC event listener. Sets the given event listener function to be triggered inside MAC_isr(). Assigning NULL pointer as the listener function will disable it. */ | void MSS_MAC_set_callback(MSS_MAC_callback_t listener) | /* Sets MAC event listener. Sets the given event listener function to be triggered inside MAC_isr(). Assigning NULL pointer as the listener function will disable it. */
void MSS_MAC_set_callback(MSS_MAC_callback_t listener) | {
MAC_BITBAND->CSR7_RIE = 0u;
MAC_BITBAND->CSR7_TIE = 0u;
g_mss_mac.listener = listener;
if( listener != NULL_callback ) {
MAC_BITBAND->CSR7_RIE = 1u;
MAC_BITBAND->CSR7_TIE = 1u;
}
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* SD MSP De-Initialization This function freeze the hardware resources used in this example. */ | void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd) | /* SD MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd) | {
if(hsd->Instance==SDIO)
{
__HAL_RCC_SDIO_CLK_DISABLE();
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
|GPIO_PIN_12);
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_2);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Returns the current value of the SMM register for the specified CPU. If the SMM register is not supported, then 0 is returned. */ | UINT64 EFIAPI SmmCpuFeaturesGetSmmRegister(IN UINTN CpuIndex, IN SMM_REG_NAME RegName) | /* Returns the current value of the SMM register for the specified CPU. If the SMM register is not supported, then 0 is returned. */
UINT64 EFIAPI SmmCpuFeaturesGetSmmRegister(IN UINTN CpuIndex, IN SMM_REG_NAME RegName) | {
if (FeaturePcdGet (PcdSmmFeatureControlEnable) && (RegName == SmmRegFeatureControl)) {
return AsmReadMsr64 (SMM_FEATURES_LIB_SMM_FEATURE_CONTROL);
}
return 0;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Disables the I2C slave block. This will disable operation of the I2C slave block. */ | void xI2CSlaveDisable(unsigned long ulBase) | /* Disables the I2C slave block. This will disable operation of the I2C slave block. */
void xI2CSlaveDisable(unsigned long ulBase) | {
xASSERT((ulBase == I2C0_BASE) || (ulBase == I2C1_BASE) ||
(ulBase == I2C2_BASE) || (ulBase == I2C3_BASE) ||
(ulBase == I2C4_BASE));
xHWREG(ulBase + I2C_CON) &= ~I2C_CON_ENS1;
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* We adjust to current frequency first, and need to clean up later. So either call to cpufreq_update_policy() or schedule handle_update()). */ | static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, unsigned int new_freq) | /* We adjust to current frequency first, and need to clean up later. So either call to cpufreq_update_policy() or schedule handle_update()). */
static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, unsigned int new_freq) | {
struct cpufreq_freqs freqs;
dprintk("Warning: CPU frequency out of sync: cpufreq and timing "
"core thinks of %u, is %u kHz.\n", old_freq, new_freq);
freqs.cpu = cpu;
freqs.old = old_freq;
freqs.new = new_freq;
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
cpufreq_notify_transition(&freqs, CPUF... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function gets the FSP info header pointer. */ | FSP_INFO_HEADER* EFIAPI GetFspInfoHeader(VOID) | /* This function gets the FSP info header pointer. */
FSP_INFO_HEADER* EFIAPI GetFspInfoHeader(VOID) | {
return GetFspGlobalDataPointer ()->FspInfoHeader;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This API is used to get the fifo(fifo_enable) interrupt enable bits of the sensor in the registers 0x15 bit 6. */ | BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_enable(u8 *v_fifo_enable_u8) | /* This API is used to get the fifo(fifo_enable) interrupt enable bits of the sensor in the registers 0x15 bit 6. */
BMG160_RETURN_FUNCTION_TYPE bmg160_get_fifo_enable(u8 *v_fifo_enable_u8) | {
BMG160_RETURN_FUNCTION_TYPE comres = ERROR;
u8 v_data_u8 = BMG160_INIT_VALUE;
if (p_bmg160 == BMG160_NULL)
{
return E_BMG160_NULL_PTR;
}
else
{
comres = p_bmg160->BMG160_BUS_READ_FUNC(p_bmg160->dev_addr,
BMG160_INTR_ENABLE0_... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Note that at boot, this probe only picks up one card at a time. */ | static int __init do_ne2_probe(struct net_device *dev) | /* Note that at boot, this probe only picks up one card at a time. */
static int __init do_ne2_probe(struct net_device *dev) | {
static int current_mca_slot = -1;
int i;
int adapter_found = 0;
for(i = 0; (ne2_adapters[i].name != NULL) && !adapter_found; i++) {
current_mca_slot =
mca_find_unused_adapter(ne2_adapters[i].id, 0);
if((current_mca_slot != MCA_NOTFOUND) && !adapter_found) {
int res;
mca_set_adapter_name(current_mca_s... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Reads a set of data from the non-volatile memory of the Hibernation module. */ | void HibernateDataGet(unsigned long *pulData, unsigned long ulCount) | /* Reads a set of data from the non-volatile memory of the Hibernation module. */
void HibernateDataGet(unsigned long *pulData, unsigned long ulCount) | {
unsigned int uIdx;
ASSERT(ulCount <= 64);
ASSERT(pulData != 0);
for(uIdx = 0; uIdx < ulCount; uIdx++)
{
pulData[uIdx] = HWREG(HIB_DATA + (uIdx * 4));
}
} | watterott/WebRadio | C++ | null | 71 |
/* 6.. FMS Stop (Confirmed Service Id = 20) 6..1. Request Message Parameters */ | static void dissect_ff_msg_fms_stop_pi_req(tvbuff_t *tvb, gint offset, guint32 length, packet_info *pinfo, proto_tree *tree) | /* 6.. FMS Stop (Confirmed Service Id = 20) 6..1. Request Message Parameters */
static void dissect_ff_msg_fms_stop_pi_req(tvbuff_t *tvb, gint offset, guint32 length, packet_info *pinfo, proto_tree *tree) | {
proto_tree *sub_tree;
col_set_str(pinfo->cinfo, COL_INFO, "FMS Stop Request");
if (!tree) {
return;
}
sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_ff_fms_stop_req, NULL, "FMS Stop Request");
proto_tree_add_item(sub_tree,
hf_ff_fms_stop_req_idx, tvb, offset, ... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Register a uat 'preference' for QT only. It adds a button that opens the uat's window in the preferences tab of the module. */ | void prefs_register_uat_preference_qt(module_t *module, const char *name, const char *title, const char *description, uat_t *uat) | /* Register a uat 'preference' for QT only. It adds a button that opens the uat's window in the preferences tab of the module. */
void prefs_register_uat_preference_qt(module_t *module, const char *name, const char *title, const char *description, uat_t *uat) | {
pref_t* preference = register_preference(module, name, title, description, PREF_UAT);
preference->varp.uat = uat;
preference->gui = GUI_QT;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* param base DCDC peripheral base address. param config Pointer to configuration structure. See to "dcdc_low_power_config_t". */ | void DCDC_SetLowPowerConfig(DCDC_Type *base, const dcdc_low_power_config_t *config) | /* param base DCDC peripheral base address. param config Pointer to configuration structure. See to "dcdc_low_power_config_t". */
void DCDC_SetLowPowerConfig(DCDC_Type *base, const dcdc_low_power_config_t *config) | {
assert(NULL != config);
uint32_t tmp32;
tmp32 = base->REG0 & ~(DCDC_REG0_EN_LP_OVERLOAD_SNS_MASK | DCDC_REG0_LP_HIGH_HYS_MASK |
DCDC_REG0_LP_OVERLOAD_FREQ_SEL_MASK | DCDC_REG0_LP_OVERLOAD_THRSH_MASK);
tmp32 |= DCDC_REG0_LP_OVERLOAD_FREQ_SEL(config->countChargingTimePeriod) |... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Force autonegotiation.
Force the autonegotiation and set link speed and duplex mode of the link */ | void phy_autoneg_force(uint8_t phy, enum phy_status mode) | /* Force autonegotiation.
Force the autonegotiation and set link speed and duplex mode of the link */
void phy_autoneg_force(uint8_t phy, enum phy_status mode) | {
uint16_t bst = 0;
if ((mode == LINK_FD_10M) || (mode == LINK_FD_100M) ||
(mode == LINK_FD_1000M) || (mode == LINK_FD_10000M)) {
bst |= PHY_REG_BCR_FD;
}
if ((mode == LINK_FD_100M) || (mode == LINK_HD_100M)) {
bst |= PHY_REG_BCR_100M;
}
eth_smi_bit_op(phy, PHY_REG_BCR, bst,
~(PHY_REG_BCR_AN | PHY_... | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* General Purpose Input/Outputs Read from a Port.
Read the current value of the given GPIO port. */ | uint8_t gpio_port_read(uint32_t gpioport) | /* General Purpose Input/Outputs Read from a Port.
Read the current value of the given GPIO port. */
uint8_t gpio_port_read(uint32_t gpioport) | {
return (uint8_t)GPIO_DATA(gpioport)[GPIO_ALL];
} | libopencm3/libopencm3 | C++ | GNU General Public License v3.0 | 2,931 |
/* SConfigures LPUART detected byte or frame match for wakeup CPU from STOPS mode. */ | void LPUART_ConfigWakeUpData(uint32_t LPUART_WakeUpData) | /* SConfigures LPUART detected byte or frame match for wakeup CPU from STOPS mode. */
void LPUART_ConfigWakeUpData(uint32_t LPUART_WakeUpData) | {
LPUART->WUDAT = LPUART_WakeUpData;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* param base SPDIF base pointer. param handle SPDIF eDMA handle pointer. */ | void SPDIF_TransferAbortSendEDMA(SPDIF_Type *base, spdif_edma_handle_t *handle) | /* param base SPDIF base pointer. param handle SPDIF eDMA handle pointer. */
void SPDIF_TransferAbortSendEDMA(SPDIF_Type *base, spdif_edma_handle_t *handle) | {
assert(handle);
EDMA_AbortTransfer(handle->dmaLeftHandle);
EDMA_AbortTransfer(handle->dmaRightHandle);
SPDIF_EnableDMA(base, kSPDIF_TxDMAEnable, false);
memset(handle->spdifQueue, 0U, sizeof(handle->spdifQueue));
memset(handle->transferSize, 0U, sizeof(handle->transferSize));
handle->queue... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Checks whether the flash Prefetch Buffer status is set or not. */ | uint8_t FMC_ReadPrefetchBufferStatus(void) | /* Checks whether the flash Prefetch Buffer status is set or not. */
uint8_t FMC_ReadPrefetchBufferStatus(void) | {
if (FMC->CTRL1_B.PBSF)
{
return SET;
}
return RESET;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* NOTE: We have to handle the case that both old bucket and new bucket will call this function to get the right ret_bh. So The caller must give us the right bh. */ | static int ocfs2_get_reflink_xattr_value_root(struct super_block *sb, struct buffer_head *bh, struct ocfs2_xattr_header *xh, int offset, struct ocfs2_xattr_value_root **xv, struct buffer_head **ret_bh, void *para) | /* NOTE: We have to handle the case that both old bucket and new bucket will call this function to get the right ret_bh. So The caller must give us the right bh. */
static int ocfs2_get_reflink_xattr_value_root(struct super_block *sb, struct buffer_head *bh, struct ocfs2_xattr_header *xh, int offset, struct ocfs2_xatt... | {
struct ocfs2_reflink_xattr_tree_args *args =
(struct ocfs2_reflink_xattr_tree_args *)para;
struct ocfs2_xattr_bucket *bucket;
if (bh == args->old_bucket->bu_bhs[0])
bucket = args->old_bucket;
else
bucket = args->new_bucket;
return ocfs2_get_xattr_tree_value_root(sb, bucket, offset,
xv, ret_bh)... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Get a file's attributes N.B. After this call resp->fh needs an fh_put */ | static __be32 nfsd_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp, struct nfsd_attrstat *resp) | /* Get a file's attributes N.B. After this call resp->fh needs an fh_put */
static __be32 nfsd_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp, struct nfsd_attrstat *resp) | {
__be32 nfserr;
dprintk("nfsd: GETATTR %s\n", SVCFH_fmt(&argp->fh));
fh_copy(&resp->fh, &argp->fh);
nfserr = fh_verify(rqstp, &resp->fh, 0,
NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
return nfsd_return_attrs(nfserr, resp);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Local function to send a command + data to the USB protocol engine */ | static void USBHwCmdWrite(unsigned char bCmd, unsigned short bData) | /* Local function to send a command + data to the USB protocol engine */
static void USBHwCmdWrite(unsigned char bCmd, unsigned short bData) | {
USBHwCmd(bCmd);
LPC_USB->USBCmdCode = 0x00000100 | (bData << 16);
Wait4DevInt(CCEMTY);
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Attempts to set drive's PIO mode. Special cases are 8: prefetch off, 9: prefetch on (both never worked) */ | static void cmd64x_set_pio_mode(ide_drive_t *drive, const u8 pio) | /* Attempts to set drive's PIO mode. Special cases are 8: prefetch off, 9: prefetch on (both never worked) */
static void cmd64x_set_pio_mode(ide_drive_t *drive, const u8 pio) | {
if (pio == 8 || pio == 9)
return;
cmd64x_tune_pio(drive, pio);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Reads and returns the status register of the serial flash. */ | static uint32_t s25fl1xx_read_status(struct qspid_t *qspid) | /* Reads and returns the status register of the serial flash. */
static uint32_t s25fl1xx_read_status(struct qspid_t *qspid) | {
uint32_t status;
status = s25fl1xx_read_status1(qspid) | (s25fl1xx_read_status2(qspid) << 8) | (s25fl1xx_read_status3(qspid) << 16);
return status;
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Set the specified data holding register value for DAC channel1. */ | void DAC_SetChannel1Data(uint32_t DAC_Align, uint8_t Data) | /* Set the specified data holding register value for DAC channel1. */
void DAC_SetChannel1Data(uint32_t DAC_Align, uint8_t Data) | {
assert_param(IS_DAC_DATA(Data));
DAC->DATA1 = (uint32_t)Data;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* get_lpt_node_type - return type (and node number) of a node in a buffer. */ | static int get_lpt_node_type(const struct ubifs_info *c, uint8_t *buf, int *node_num) | /* get_lpt_node_type - return type (and node number) of a node in a buffer. */
static int get_lpt_node_type(const struct ubifs_info *c, uint8_t *buf, int *node_num) | {
uint8_t *addr = buf + UBIFS_LPT_CRC_BYTES;
int pos = 0, node_type;
node_type = ubifs_unpack_bits(&addr, &pos, UBIFS_LPT_TYPE_BITS);
*node_num = ubifs_unpack_bits(&addr, &pos, c->pcnt_bits);
return node_type;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function returns the number of empty LEBs needed to commit @cnt znodes to the current index head. The number is not exact and may be more than needed. */ | static int get_leb_cnt(struct ubifs_info *c, int cnt) | /* This function returns the number of empty LEBs needed to commit @cnt znodes to the current index head. The number is not exact and may be more than needed. */
static int get_leb_cnt(struct ubifs_info *c, int cnt) | {
int d;
cnt -= (c->leb_size - c->ihead_offs) / c->max_idx_node_sz;
if (cnt < 0)
cnt = 0;
d = c->leb_size / c->max_idx_node_sz;
return DIV_ROUND_UP(cnt, d);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This API sets the Aux Mag write address in the sensor. Mag write address is where the Mag data will be written. */ | uint16_t bma4_set_mag_write_addr(uint8_t mag_write_addr, struct bma4_dev *dev) | /* This API sets the Aux Mag write address in the sensor. Mag write address is where the Mag data will be written. */
uint16_t bma4_set_mag_write_addr(uint8_t mag_write_addr, struct bma4_dev *dev) | {
uint16_t rslt = 0;
if (dev == NULL)
rslt |= BMA4_E_NULL_PTR;
else
rslt |= bma4_write_regs(BMA4_AUX_WR_ADDR, &mag_write_addr, 1, dev);
return rslt;
} | arendst/Tasmota | C++ | GNU General Public License v3.0 | 21,318 |
/* Set Timer Option.
Set timer options register on TIM2 or TIM3, used for trigger remapping. */ | void timer_set_option(uint32_t timer_peripheral, uint32_t option) | /* Set Timer Option.
Set timer options register on TIM2 or TIM3, used for trigger remapping. */
void timer_set_option(uint32_t timer_peripheral, uint32_t option) | {
if (timer_peripheral == TIM2) {
TIM_OR(timer_peripheral) &= ~TIM2_OR_ITR1_RMP_MASK;
TIM_OR(timer_peripheral) |= option;
} else if (timer_peripheral == TIM3) {
TIM_OR(timer_peripheral) &= ~TIM3_OR_ITR2_RMP_MASK;
TIM_OR(timer_peripheral) |= option;
}
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* get the size of a given (TPM) NV area */ | static int get_tpm_nv_size(struct udevice *tpm, uint32_t index, uint32_t *size) | /* get the size of a given (TPM) NV area */
static int get_tpm_nv_size(struct udevice *tpm, uint32_t index, uint32_t *size) | {
uint32_t err;
uint8_t info[72];
uint8_t *ptr;
uint16_t v16;
err = tpm_get_capability(tpm, TPM_CAP_NV_INDEX, index,
info, sizeof(info));
if (err) {
printf("tpm_get_capability(CAP_NV_INDEX, %08x) failed: %u\n",
index, err);
return 1;
}
ptr = info + 6;
v16 = get_unaligned_be16(ptr);
ptr += 2 ... | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Check whether there is a instance in BlockIoDevicePath, which contain multi device path instances, has the same partition node with HardDriveDevicePath device path */ | BOOLEAN BmMatchPartitionDevicePathNode(IN EFI_DEVICE_PATH_PROTOCOL *BlockIoDevicePath, IN HARDDRIVE_DEVICE_PATH *HardDriveDevicePath) | /* Check whether there is a instance in BlockIoDevicePath, which contain multi device path instances, has the same partition node with HardDriveDevicePath device path */
BOOLEAN BmMatchPartitionDevicePathNode(IN EFI_DEVICE_PATH_PROTOCOL *BlockIoDevicePath, IN HARDDRIVE_DEVICE_PATH *HardDriveDevicePath) | {
HARDDRIVE_DEVICE_PATH *Node;
if ((BlockIoDevicePath == NULL) || (HardDriveDevicePath == NULL)) {
return FALSE;
}
while (!IsDevicePathEnd (BlockIoDevicePath)) {
if ((DevicePathType (BlockIoDevicePath) == MEDIA_DEVICE_PATH) &&
(DevicePathSubType (BlockIoDevicePath) == MEDIA_HARDDRIVE_DP)
... | tianocore/edk2 | C++ | Other | 4,240 |
/* Fetch a POS value directly from the hardware to obtain the current value. This is much slower than mca_read_stored_pos and may not be invoked from interrupt context. It handles the deep magic required for onboard devices transparently. */ | unsigned char mca_read_pos(int slot, int reg) | /* Fetch a POS value directly from the hardware to obtain the current value. This is much slower than mca_read_stored_pos and may not be invoked from interrupt context. It handles the deep magic required for onboard devices transparently. */
unsigned char mca_read_pos(int slot, int reg) | {
struct mca_device *mca_dev = mca_find_device_by_slot(slot);
if(!mca_dev)
return 0;
return mca_device_read_pos(mca_dev, reg);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Sets the number of data units in the current DMAy Channelx transfer. */ | void DMA_SetCurrDataCounter(DMA_ChannelType *DMAyChx, uint16_t DataNumber) | /* Sets the number of data units in the current DMAy Channelx transfer. */
void DMA_SetCurrDataCounter(DMA_ChannelType *DMAyChx, uint16_t DataNumber) | {
assert_param(IS_DMA_ALL_PERIPH(DMAyChx));
DMAyChx->TXNUM = DataNumber;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Reads the EH_ON status from the EH_CTRL_DYN register. */ | int32_t BSP_NFCTAG_GetEHON_Dyn(uint32_t Instance, ST25DV_EN_STATUS *const pEHON) | /* Reads the EH_ON status from the EH_CTRL_DYN register. */
int32_t BSP_NFCTAG_GetEHON_Dyn(uint32_t Instance, ST25DV_EN_STATUS *const pEHON) | {
UNUSED(Instance);
return ST25DV_GetEHON_Dyn(&NfcTagObj, pEHON);
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Old devices have chip data hardcoded in the device ID table. nand_decode_id decodes a matching ID table entry and assigns the MTD size parameters for the chip. */ | static void nand_decode_id(struct mtd_info *mtd, struct nand_chip *chip, struct nand_flash_dev *type, u8 id_data[8], int *busw) | /* Old devices have chip data hardcoded in the device ID table. nand_decode_id decodes a matching ID table entry and assigns the MTD size parameters for the chip. */
static void nand_decode_id(struct mtd_info *mtd, struct nand_chip *chip, struct nand_flash_dev *type, u8 id_data[8], int *busw) | {
int maf_id = id_data[0];
mtd->erasesize = type->erasesize;
mtd->writesize = type->pagesize;
mtd->oobsize = mtd->writesize / 32;
*busw = type->options & NAND_BUSWIDTH_16;
chip->bits_per_cell = 1;
if (maf_id == NAND_MFR_AMD && id_data[4] != 0x00 && id_data[5] == 0x00
&& id_data[6] == 0x00 && id_data[7] == 0x0... | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Work queue function for starting the HCD when A-Cable is connected */ | static void dwc2_hcd_start_func(struct work_struct *work) | /* Work queue function for starting the HCD when A-Cable is connected */
static void dwc2_hcd_start_func(struct work_struct *work) | {
struct dwc2_hsotg *hsotg = container_of(work, struct dwc2_hsotg,
start_work.work);
dev_dbg(hsotg->dev, "%s() %p\n", __func__, hsotg);
dwc2_host_start(hsotg);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Now two pseudo ASN1 routines that take an EVP_PKEY structure and encode or decode as X509_PUBKEY */ | EVP_PKEY* d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length) | /* Now two pseudo ASN1 routines that take an EVP_PKEY structure and encode or decode as X509_PUBKEY */
EVP_PKEY* d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length) | {
X509_PUBKEY *xpk;
EVP_PKEY *pktmp;
xpk = d2i_X509_PUBKEY(NULL, pp, length);
if (!xpk)
return NULL;
pktmp = X509_PUBKEY_get(xpk);
X509_PUBKEY_free(xpk);
if (!pktmp)
return NULL;
if (a) {
EVP_PKEY_free(*a);
*a = pktmp;
}
return pktmp;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Disable I2C master module of the specified I2C port.
The */ | void xI2CMasterDisable(unsigned long ulBase) | /* Disable I2C master module of the specified I2C port.
The */
void xI2CMasterDisable(unsigned long ulBase) | {
xASSERT((ulBase == I2C0_BASE) || (ulBase == I2C1_BASE));
xHWREG(ulBase + I2C_CON) &= ~I2C_CON_ENS1;
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Return the next available sensor instance ID This may be called by drivers from multiple threads, unprotected by any locks */ | SDL_SensorID SDL_GetNextSensorInstanceID() | /* Return the next available sensor instance ID This may be called by drivers from multiple threads, unprotected by any locks */
SDL_SensorID SDL_GetNextSensorInstanceID() | {
return SDL_AtomicIncRef(&SDL_next_sensor_instance_id);
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* When not using a directory, most resource names will hash to a new static master nodeid and the resource will need to be remastered. */ | static int recover_master_static(struct dlm_rsb *r) | /* When not using a directory, most resource names will hash to a new static master nodeid and the resource will need to be remastered. */
static int recover_master_static(struct dlm_rsb *r) | {
int master = dlm_dir_nodeid(r);
if (master == dlm_our_nodeid())
master = 0;
if (r->res_nodeid != master) {
if (is_master(r))
dlm_purge_mstcpy_locks(r);
set_new_master(r, master);
return 1;
}
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Basic board specific setup. Pinmux has been handled already. */ | int board_init(void) | /* Basic board specific setup. Pinmux has been handled already. */
int board_init(void) | {
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
return 0;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Returns: (transfer full): a #GMount or NULL if @volume isn't mounted. The returned object should be unreffed with g_object_unref() when no longer needed. */ | GMount* g_volume_get_mount(GVolume *volume) | /* Returns: (transfer full): a #GMount or NULL if @volume isn't mounted. The returned object should be unreffed with g_object_unref() when no longer needed. */
GMount* g_volume_get_mount(GVolume *volume) | {
GVolumeIface *iface;
g_return_val_if_fail (G_IS_VOLUME (volume), NULL);
iface = G_VOLUME_GET_IFACE (volume);
return (* iface->get_mount) (volume);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Note that the spec says a DIFFERENT value must be written to the reload register each time. The "perturb" variable deals with this by adding 1 to the count every other time the function is called. */ | static void mpcore_wdt_keepalive(struct mpcore_wdt *wdt) | /* Note that the spec says a DIFFERENT value must be written to the reload register each time. The "perturb" variable deals with this by adding 1 to the count every other time the function is called. */
static void mpcore_wdt_keepalive(struct mpcore_wdt *wdt) | {
unsigned int count;
count = (mpcore_timer_rate / 256) * mpcore_margin;
spin_lock(&wdt_lock);
writel(count + wdt->perturb, wdt->base + TWD_WDOG_LOAD);
wdt->perturb = wdt->perturb ? 0 : 1;
spin_unlock(&wdt_lock);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The tasklist_lock is not held here, as do_each_thread() and while_each_thread() are protected by RCU. */ | static void cgroup_enable_task_cg_lists(void) | /* The tasklist_lock is not held here, as do_each_thread() and while_each_thread() are protected by RCU. */
static void cgroup_enable_task_cg_lists(void) | {
struct task_struct *p, *g;
write_lock(&css_set_lock);
use_task_css_set_links = 1;
do_each_thread(g, p) {
task_lock(p);
if (!(p->flags & PF_EXITING) && list_empty(&p->cg_list))
list_add(&p->cg_list, &p->cgroups->tasks);
task_unlock(p);
} while_each_thread(g, p);
write_unlock(&css_set_lock);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Set the sensor's bandwidth parameter (one of BMA4XX_BWP_*) */ | static int bma4xx_attr_set_bwp(const struct device *dev, const struct sensor_value *val) | /* Set the sensor's bandwidth parameter (one of BMA4XX_BWP_*) */
static int bma4xx_attr_set_bwp(const struct device *dev, const struct sensor_value *val) | {
if (val->val2 || val->val1 < BMA4XX_BWP_OSR4_AVG1 || val->val1 > BMA4XX_BWP_RES_AVG128) {
return -EINVAL;
}
struct bma4xx_data *bma4xx = dev->data;
return bma4xx->hw_ops->update_reg(dev, BMA4XX_REG_ACCEL_CONFIG, BMA4XX_MASK_ACC_CONF_BWP,
(((uint8_t)val->val1) << BMA4XX_SHIFT_ACC_CONF_BWP));
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* To check if FtwRecord is the first record of FtwHeader. */ | BOOLEAN IsFirstRecordOfWrites(IN EFI_FAULT_TOLERANT_WRITE_HEADER *FtwHeader, IN EFI_FAULT_TOLERANT_WRITE_RECORD *FtwRecord) | /* To check if FtwRecord is the first record of FtwHeader. */
BOOLEAN IsFirstRecordOfWrites(IN EFI_FAULT_TOLERANT_WRITE_HEADER *FtwHeader, IN EFI_FAULT_TOLERANT_WRITE_RECORD *FtwRecord) | {
UINT8 *Head;
UINT8 *Ptr;
Head = (UINT8 *)FtwHeader;
Ptr = (UINT8 *)FtwRecord;
Head += sizeof (EFI_FAULT_TOLERANT_WRITE_HEADER);
return (BOOLEAN)(Head == Ptr);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* This is called to unpin an inode. It can be directed to wait or to return immediately without waiting for the inode to be unpinned. The caller must have the inode locked in at least shared mode so that the buffer cannot be subsequently pinned once someone is waiting for it to be unpinned. */ | STATIC void __xfs_iunpin_wait(xfs_inode_t *ip, int wait) | /* This is called to unpin an inode. It can be directed to wait or to return immediately without waiting for the inode to be unpinned. The caller must have the inode locked in at least shared mode so that the buffer cannot be subsequently pinned once someone is waiting for it to be unpinned. */
STATIC void __xfs_iunpi... | {
xfs_inode_log_item_t *iip = ip->i_itemp;
ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED));
if (atomic_read(&ip->i_pincount) == 0)
return;
xfs_log_force(ip->i_mount, (iip && iip->ili_last_lsn) ?
iip->ili_last_lsn : 0, XFS_LOG_FORCE);
if (wait)
wait_event(ip->i_ipin_wait, (atomic_read(&ip->i_pinc... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Reads and returns the current value of CR4. This function is only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on X64. */ | UINTN EFIAPI AsmReadCr4(VOID) | /* Reads and returns the current value of CR4. This function is only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on X64. */
UINTN EFIAPI AsmReadCr4(VOID) | {
UINTN Data;
__asm__ __volatile__ (
"movl %%cr4, %0"
: "=a" (Data)
);
return Data;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Start to acquire device profile. The device acquire its own profile, if profile message is found. The acquired AP information is stored in CC3000 EEPROM only in case AES128 encryption is used. In case AES128 encryption is not used, a profile is created by CC3000 internally.
wlan_smart_config_start */ | INT32 wlan_smart_config_start(UINT32 algoEncryptedFlag) | /* Start to acquire device profile. The device acquire its own profile, if profile message is found. The acquired AP information is stored in CC3000 EEPROM only in case AES128 encryption is used. In case AES128 encryption is not used, a profile is created by CC3000 internally.
wlan_smart_config_start */
INT32 wlan_sma... | {
INT32 ret;
UINT8 *ptr;
UINT8 *args;
ret = EFAIL;
ptr = tSLInformation.pucTxCommandBuffer;
args = (UINT8 *)(ptr + HEADERS_SIZE_CMD);
args = UINT32_TO_STREAM(args, algoEncryptedFlag);
ret = EFAIL;
hci_command_send(HCI_CMND_WLAN_IOCTL_SIMPLE_CONFIG_START, ptr,
WLAN_SMART_CONFIG_START_PARAMS_LEN);
SimpleLink... | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* If Length > 0 and DestinationBuffer is NULL, then ASSERT(). If Length > 0 and SourceBuffer is NULL, then ASSERT(). If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). */ | INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length) | /* If Length > 0 and DestinationBuffer is NULL, then ASSERT(). If Length > 0 and SourceBuffer is NULL, then ASSERT(). If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). */
INTN EFIAPI CompareMem(IN CONST VOID *Destin... | {
if ((Length == 0) || (DestinationBuffer == SourceBuffer)) {
return 0;
}
ASSERT (DestinationBuffer != NULL);
ASSERT (SourceBuffer != NULL);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
return InternalMemCompareMem (De... | tianocore/edk2 | C++ | Other | 4,240 |
/* Enable/Disable the detection of a low level on the pin NRST as User Reset */ | void RSTC_SetUserResetEnable(unsigned char enable) | /* Enable/Disable the detection of a low level on the pin NRST as User Reset */
void RSTC_SetUserResetEnable(unsigned char enable) | {
unsigned int rmr = AT91C_BASE_RSTC->RSTC_RMR & (~AT91C_RSTC_KEY);
if (enable) {
rmr |= AT91C_RSTC_URSTEN;
}
else {
rmr &= ~AT91C_RSTC_URSTEN;
}
AT91C_BASE_RSTC->RSTC_RMR = rmr | RSTC_KEY_PASSWORD;
} | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Checks to see of the link status of the hardware has changed. If a change in link status has been detected, then we read the PHY registers to get the current speed/duplex if link exists. */ | s32 e1000e_check_for_copper_link(struct e1000_hw *hw) | /* Checks to see of the link status of the hardware has changed. If a change in link status has been detected, then we read the PHY registers to get the current speed/duplex if link exists. */
s32 e1000e_check_for_copper_link(struct e1000_hw *hw) | {
struct e1000_mac_info *mac = &hw->mac;
s32 ret_val;
bool link;
if (!mac->get_link_status)
return 0;
ret_val = e1000e_phy_has_link_generic(hw, 1, 0, &link);
if (ret_val)
return ret_val;
if (!link)
return ret_val;
mac->get_link_status = false;
e1000e_check_downshift(hw);
if (!mac->autoneg) {
ret_val =... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Open the network interface. The number of the interface to be opened is set by the configNETWORK_INTERFACE_TO_USE constant in FreeRTOSConfig.h. */ | static void prvOpenSelectedNetworkInterface(pcap_if_t *pxAllNetworkInterfaces) | /* Open the network interface. The number of the interface to be opened is set by the configNETWORK_INTERFACE_TO_USE constant in FreeRTOSConfig.h. */
static void prvOpenSelectedNetworkInterface(pcap_if_t *pxAllNetworkInterfaces) | {
pcap_if_t *xInterface;
long x;
xInterface = pxAllNetworkInterfaces;
for( x = 0L; x < ( configNETWORK_INTERFACE_TO_USE - 1L ); x++ )
{
xInterface = xInterface->next;
}
pxOpenedInterfaceHandle = pcap_open( xInterface->name,
netifMAX_MTU,
PCAP_OPENFLAG_PROMISCUOUS,
0L,
... | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Handle write events to the Location and Speed cccd. */ | static void on_loc_speed_cccd_write(ble_lns_t *p_lns, ble_gatts_evt_write_t const *p_evt_write) | /* Handle write events to the Location and Speed cccd. */
static void on_loc_speed_cccd_write(ble_lns_t *p_lns, ble_gatts_evt_write_t const *p_evt_write) | {
if (p_evt_write->len == BLE_CCCD_VALUE_LEN)
{
p_lns->is_loc_speed_notification_enabled = ble_srv_is_notification_enabled(p_evt_write->data);
if (p_lns->evt_handler != NULL)
{
ble_lns_evt_t evt;
if (p_lns->is_loc_speed_notification_enabled)
{
... | labapart/polymcu | C++ | null | 201 |
/* Returns the most recent received data by the SPIx peripheral. */ | uint32_t SPI_ReceiveData(SPI_TypeDef *SPIx) | /* Returns the most recent received data by the SPIx peripheral. */
uint32_t SPI_ReceiveData(SPI_TypeDef *SPIx) | {
u32 temp=0;
assert_param(IS_SPI_ALL_PERIPH(SPIx));
temp =(u32)SPIx->RXREG;
if(SPIx->EXTCTL>8||SPIx->EXTCTL==0) temp |=(u32) (SPIx->RXREG)<<8;
if(SPIx->EXTCTL>16||SPIx->EXTCTL==0) temp |=(u32)( SPIx->RXREG)<<16;
if(SPIx->EXTCTL>24||SPIx->EXTCTL==0) temp |=(u32)( SPIx->RXREG)<<24;
return temp;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* SC_Itf_Secure Process the Secure command This is Optional function & user implementable. */ | uint8_t SC_Itf_Secure(uint32_t dwLength, uint8_t bBWI, uint16_t wLevelParameter, uint8_t *pbuf, uint32_t *returnLen) | /* SC_Itf_Secure Process the Secure command This is Optional function & user implementable. */
uint8_t SC_Itf_Secure(uint32_t dwLength, uint8_t bBWI, uint16_t wLevelParameter, uint8_t *pbuf, uint32_t *returnLen) | {
UNUSED(pbuf);
UNUSED(wLevelParameter);
UNUSED(bBWI);
UNUSED(dwLength);
*returnLen = 0U;
return SLOTERROR_CMD_NOT_SUPPORTED;
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Initializes an element of the data buffer queue. */ | static void data_queue_element_init(uint8_t element_index) | /* Initializes an element of the data buffer queue. */
static void data_queue_element_init(uint8_t element_index) | {
DATA_QUEUE_ELEMENT_INIT(element_index);
DATA_QUEUE_ELEMENT_SET_PTYPE(element_index, INVALID_PACKET);
DATA_QUEUE_ELEMENT_COPY_PDATA(element_index, NULL);
DATA_QUEUE_ELEMENT_SET_PLEN(element_index, 0);
} | labapart/polymcu | C++ | null | 201 |
/* This sample handler checks that a static data buffer can be accessed from a given context buffer. */ | PRM_HANDLER_EXPORT(CheckStaticDataBufferPrmHandler) | /* This sample handler checks that a static data buffer can be accessed from a given context buffer. */
PRM_HANDLER_EXPORT(CheckStaticDataBufferPrmHandler) | {
return EFI_INVALID_PARAMETER;
}
if (ContextBuffer->StaticDataBuffer == NULL) {
return EFI_INVALID_PARAMETER;
}
if (
(ContextBuffer->Signature != PRM_CONTEXT_BUFFER_SIGNATURE) ||
(ContextBuffer->StaticDataBuffer->Header.Signature != PRM_DATA_BUFFER_HEADER_SIGNATURE))
{
return EFI_NOT_... | tianocore/edk2 | C++ | Other | 4,240 |
/* Fix an expression to return one result. If expression is not a multi-ret expression (function call or vararg), it already returns one result, so nothing needs to be done. Function calls become VNONRELOC expressions (as its result comes fixed in the base register of the call), while vararg expressions become VRELOC (... | void luaK_setoneret(FuncState *fs, expdesc *e) | /* Fix an expression to return one result. If expression is not a multi-ret expression (function call or vararg), it already returns one result, so nothing needs to be done. Function calls become VNONRELOC expressions (as its result comes fixed in the base register of the call), while vararg expressions become VRELOC (... | {
lua_assert(GETARG_C(getinstruction(fs, e)) == 2);
e->k = VNONRELOC;
e->u.info = GETARG_A(getinstruction(fs, e));
}
else if (e->k == VVARARG) {
SETARG_C(getinstruction(fs, e), 2);
e->k = VRELOC;
}
} | Nicholas3388/LuaNode | C++ | Other | 1,055 |
/* Find the SDL_Sensor that owns this instance id */ | SDL_Sensor* SDL_SensorFromInstanceID(SDL_SensorID instance_id) | /* Find the SDL_Sensor that owns this instance id */
SDL_Sensor* SDL_SensorFromInstanceID(SDL_SensorID instance_id) | {
SDL_Sensor *sensor;
SDL_LockSensors();
for (sensor = SDL_sensors; sensor; sensor = sensor->next) {
if (sensor->instance_id == instance_id) {
break;
}
}
SDL_UnlockSensors();
return sensor;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* This function will init pit for system ticks */ | void rt_hw_timer_init() | /* This function will init pit for system ticks */
void rt_hw_timer_init() | {
at91sam9g45_pit_init();
rt_hw_interrupt_install(AT91C_ID_SYS, rt_timer_handler,
RT_NULL, "system");
rt_hw_interrupt_umask(AT91C_ID_SYS);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Description: See blk_iopoll_complete(). This function must be called with interrupts disabled. */ | void __blk_iopoll_complete(struct blk_iopoll *iop) | /* Description: See blk_iopoll_complete(). This function must be called with interrupts disabled. */
void __blk_iopoll_complete(struct blk_iopoll *iop) | {
list_del(&iop->list);
smp_mb__before_clear_bit();
clear_bit_unlock(IOPOLL_F_SCHED, &iop->state);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This function unregisters the handler to be called when a system control interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called. */ | void SysCtlIntUnregister(void) | /* This function unregisters the handler to be called when a system control interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called. */
void SysCtlIntUnregister(void) | {
IntDisable(INT_SYSCTL_BLIZZARD);
IntUnregister(INT_SYSCTL_BLIZZARD);
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* This function requests irq and enables interrupts for the PS/2 device. */ | static int sxps2_open(struct serio *pserio) | /* This function requests irq and enables interrupts for the PS/2 device. */
static int sxps2_open(struct serio *pserio) | {
struct xps2data *drvdata = pserio->port_data;
int error;
u8 c;
error = request_irq(drvdata->irq, &xps2_interrupt, 0,
DRIVER_NAME, drvdata);
if (error) {
dev_err(drvdata->serio.dev.parent,
"Couldn't allocate interrupt %d\n", drvdata->irq);
return error;
}
out_be32(drvdata->base_address + XPS2_GIER_OF... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Note: Address is not captured if not requested by receiver. */ | static void set_orig_addr(struct msghdr *m, struct tipc_msg *msg) | /* Note: Address is not captured if not requested by receiver. */
static void set_orig_addr(struct msghdr *m, struct tipc_msg *msg) | {
struct sockaddr_tipc *addr = (struct sockaddr_tipc *)m->msg_name;
if (addr) {
addr->family = AF_TIPC;
addr->addrtype = TIPC_ADDR_ID;
addr->addr.id.ref = msg_origport(msg);
addr->addr.id.node = msg_orignode(msg);
addr->addr.name.domain = 0;
addr->scope = 0;
m->msg_namelen = sizeof(struct sockaddr_tipc)... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Terminate execution of a thread and remove it from ActiveThreads. */ | osStatus svcThreadTerminate(osThreadId thread_id) | /* Terminate execution of a thread and remove it from ActiveThreads. */
osStatus svcThreadTerminate(osThreadId thread_id) | {
rt_free_mem(os_stack_mem, stk);
}
return osOK;
} | microbuilder/LPC11U_LPC13U_CodeBase | C++ | Other | 54 |
/* Configures the capture unit of a timer operating in waveform mode. */ | void HRTIM_WaveformCaptureConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureUnit, HRTIM_CaptureCfgTypeDef *pCaptureCfg) | /* Configures the capture unit of a timer operating in waveform mode. */
void HRTIM_WaveformCaptureConfig(HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureUnit, HRTIM_CaptureCfgTypeDef *pCaptureCfg) | {
switch (CaptureUnit)
{
case HRTIM_CAPTUREUNIT_1:
{
HRTIMx->HRTIM_TIMERx[TimerIdx].CPT1xCR = pCaptureCfg->Trigger;
}
break;
case HRTIM_CAPTUREUNIT_2:
{
HRTIMx->HRTIM_TIMERx[TimerIdx].CPT2xCR = pCaptureCfg->Trigger;
}
break;
default:
break;
}
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Check if the whole buffer is DMA-able. It means it is below the 16M of physical memory and doesn't span the 64k boundary. For now it seems SKB's never do this, but we'll check this anyway. */ | static int cosa_dma_able(struct channel_data *chan, char *buf, int data) | /* Check if the whole buffer is DMA-able. It means it is below the 16M of physical memory and doesn't span the 64k boundary. For now it seems SKB's never do this, but we'll check this anyway. */
static int cosa_dma_able(struct channel_data *chan, char *buf, int data) | {
static int count;
unsigned long b = (unsigned long)buf;
if (b+len >= MAX_DMA_ADDRESS)
return 0;
if ((b^ (b+len)) & 0x10000) {
if (count++ < 5)
printk(KERN_INFO "%s: packet spanning a 64k boundary\n",
chan->name);
return 0;
}
return 1;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Setup the hardware, create the tasks/co-routines, then start the scheduler. */ | void main(void) | /* Setup the hardware, create the tasks/co-routines, then start the scheduler. */
void main(void) | {
xLCDQueue = xQueueCreate( mainLCD_QUEUE_LEN, sizeof( xLCDMessage ) );
prvSetupHardware();
vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES );
xCoRoutineCreate( vSerialTxCoRoutine, mainTX_CO_ROUTINE_PRIORITY, mainTX_CO_ROUTINE_INDEX );
xTaskCreate( vCommsRxTask, "CMS", configMINIMAL_STACK_SIZE, NULL, mainCOMMS_RX... | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* instantiate a key and link it into the target keyring atomically */ | int key_instantiate_and_link(struct key *key, const void *data, size_t datalen, struct key *keyring, struct key *authkey) | /* instantiate a key and link it into the target keyring atomically */
int key_instantiate_and_link(struct key *key, const void *data, size_t datalen, struct key *keyring, struct key *authkey) | {
int ret;
if (keyring)
down_write(&keyring->sem);
ret = __key_instantiate_and_link(key, data, datalen, keyring, authkey);
if (keyring)
up_write(&keyring->sem);
return ret;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Get a size represented as a sequence of decimal digits. */ | static size_t extract_decimal(const char **str) | /* Get a size represented as a sequence of decimal digits. */
static size_t extract_decimal(const char **str) | {
const char *sp = *str;
size_t val = 0;
while (isdigit((int)(unsigned char)*sp) != 0) {
val = 10U * val + *sp++ - '0';
}
*str = sp;
return val;
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Convert a section name to the function/data attribute .init.text => __init .cpuinit.data => __cpudata .memexitconst => __memconst etc. */ | static char* sec2annotation(const char *s) | /* Convert a section name to the function/data attribute .init.text => __init .cpuinit.data => __cpudata .memexitconst => __memconst etc. */
static char* sec2annotation(const char *s) | {
if (match(s, init_exit_sections)) {
char *p = malloc(20);
char *r = p;
*p++ = '_';
*p++ = '_';
if (*s == '.')
s++;
while (*s && *s != '.')
*p++ = *s++;
*p = '\0';
if (*s == '.')
s++;
if (strstr(s, "rodata") != NULL)
strcat(p, "const ");
else if (strstr(s, "data") != NULL)
strcat(p,... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Disables all the endpoints for the interface's current altsetting. */ | void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf, bool reset_hardware) | /* Disables all the endpoints for the interface's current altsetting. */
void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf, bool reset_hardware) | {
struct usb_host_interface *alt = intf->cur_altsetting;
int i;
for (i = 0; i < alt->desc.bNumEndpoints; ++i) {
usb_disable_endpoint(dev,
alt->endpoint[i].desc.bEndpointAddress,
reset_hardware);
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* TEMPLATE_Receive Data received over USB OUT endpoint are sent over PRNT interface through this function. */ | static int8_t TEMPLATE_Receive(uint8_t *Buf, uint32_t *Len) | /* TEMPLATE_Receive Data received over USB OUT endpoint are sent over PRNT interface through this function. */
static int8_t TEMPLATE_Receive(uint8_t *Buf, uint32_t *Len) | {
UNUSED(Buf);
UNUSED(Len);
return (0);
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Make sure all buffered data is written out and deallocate the buffer. Only needs to be called if current->signal-> */ | void tty_audit_exit(void) | /* Make sure all buffered data is written out and deallocate the buffer. Only needs to be called if current->signal-> */
void tty_audit_exit(void) | {
struct tty_audit_buf *buf;
spin_lock_irq(¤t->sighand->siglock);
buf = current->signal->tty_audit_buf;
current->signal->tty_audit_buf = NULL;
spin_unlock_irq(¤t->sighand->siglock);
if (!buf)
return;
mutex_lock(&buf->mutex);
tty_audit_buf_push_current(buf);
mutex_unlock(&buf->mutex);
tty_audit_b... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Compute weighted cross-power spectrum of a half-complex (packed) vector with conjugate */ | static void weighted_spectral_mul_conj(const spx_float_t *w, const spx_float_t p, const spx_word16_t *X, const spx_word16_t *Y, spx_word32_t *prod, int N) | /* Compute weighted cross-power spectrum of a half-complex (packed) vector with conjugate */
static void weighted_spectral_mul_conj(const spx_float_t *w, const spx_float_t p, const spx_word16_t *X, const spx_word16_t *Y, spx_word32_t *prod, int N) | {
int i, j;
spx_float_t W;
W = FLOAT_AMULT(p, w[0]);
prod[0] = FLOAT_MUL32(W,MULT16_16(X[0],Y[0]));
for (i=1,j=1;i<N-1;i+=2,j++)
{
W = FLOAT_AMULT(p, w[j]);
prod[i] = FLOAT_MUL32(W,MAC16_16(MULT16_16(X[i],Y[i]), X[i+1],Y[i+1]));
prod[i+1] = FLOAT_MUL32(W,MAC16_16(MULT16_16(-X[i+1],Y[... | ua1arn/hftrx | C++ | null | 69 |
/* Release the resources assigned to this adapter after it has finished being used. */ | static void initio_remove_one(struct pci_dev *pdev) | /* Release the resources assigned to this adapter after it has finished being used. */
static void initio_remove_one(struct pci_dev *pdev) | {
struct Scsi_Host *host = pci_get_drvdata(pdev);
struct initio_host *s = (struct initio_host *)host->hostdata;
scsi_remove_host(host);
free_irq(pdev->irq, host);
release_region(s->addr, 256);
scsi_host_put(host);
pci_disable_device(pdev);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.