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 |
|---|---|---|---|---|---|---|---|
/* this function is a POSIX compliant version, which will write specified data buffer length for an open file descriptor. */ | ssize_t pwrite(int fd, const void *buf, size_t len, off_t offset) | /* this function is a POSIX compliant version, which will write specified data buffer length for an open file descriptor. */
ssize_t pwrite(int fd, const void *buf, size_t len, off_t offset) | {
ssize_t result;
off_t fpos;
struct dfs_file *file;
if (buf == NULL)
{
rt_set_errno(-EBADF);
return -1;
}
file = fd_get(fd);
if (file == NULL)
{
rt_set_errno(-EBADF);
return -1;
}
fpos = dfs_file_get_fpos(file);
dfs_file_lseek(file, offset... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Set the contents of a G_TYPE_ULONG #GValue to @v_ulong. */ | void g_value_set_ulong(GValue *value, gulong v_ulong) | /* Set the contents of a G_TYPE_ULONG #GValue to @v_ulong. */
void g_value_set_ulong(GValue *value, gulong v_ulong) | {
g_return_if_fail (G_VALUE_HOLDS_ULONG (value));
value->data[0].v_ulong = v_ulong;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* This FILTER_FUNCTION checks if a handle corresponds to a non-discoverable USB host controller. */ | STATIC BOOLEAN EFIAPI IsUsbHost(IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText) | /* This FILTER_FUNCTION checks if a handle corresponds to a non-discoverable USB host controller. */
STATIC BOOLEAN EFIAPI IsUsbHost(IN EFI_HANDLE Handle, IN CONST CHAR16 *ReportText) | {
NON_DISCOVERABLE_DEVICE *Device;
EFI_STATUS Status;
Status = gBS->HandleProtocol (
Handle,
&gEdkiiNonDiscoverableDeviceProtocolGuid,
(VOID **)&Device
);
if (EFI_ERROR (Status)) {
return FALSE;
}
if (CompareGuid (Dev... | tianocore/edk2 | C++ | Other | 4,240 |
/* this function can be called asynchronous (e.g. during a signal) */ | LUA_API int lua_sethook(lua_State *L, lua_Hook func, int mask, int count) | /* this function can be called asynchronous (e.g. during a signal) */
LUA_API int lua_sethook(lua_State *L, lua_Hook func, int mask, int count) | {
mask = 0;
func = NULL;
}
L->hook = func;
L->basehookcount = count;
resethookcount(L);
L->hookmask = cast_byte(mask);
return 1;
} | Nicholas3388/LuaNode | C++ | Other | 1,055 |
/* mos7720_bulk_out_data_callback this is the callback function for when we have finished sending serial data on the bulk out endpoint. */ | static void mos7720_bulk_out_data_callback(struct urb *urb) | /* mos7720_bulk_out_data_callback this is the callback function for when we have finished sending serial data on the bulk out endpoint. */
static void mos7720_bulk_out_data_callback(struct urb *urb) | {
struct moschip_port *mos7720_port;
struct tty_struct *tty;
int status = urb->status;
if (status) {
dbg("nonzero write bulk status received:%d", status);
return;
}
mos7720_port = urb->context;
if (!mos7720_port) {
dbg("NULL mos7720_port pointer");
return ;
}
dbg("Entering .........");
tty = tty_port_... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This should only get called for sa1111_device types due to the way we configure our device dma_masks. */ | int dma_needs_bounce(struct device *dev, dma_addr_t addr, size_t size) | /* This should only get called for sa1111_device types due to the way we configure our device dma_masks. */
int dma_needs_bounce(struct device *dev, dma_addr_t addr, size_t size) | {
return ((machine_is_assabet() || machine_is_pfs168()) &&
(addr >= 0xc8000000 || (addr + size) >= 0xc8000000));
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* XXX - should map lead and trail surrogate values to a "substitute" UTF-8 character? XXX - should map code points > 10FFFF to REPLACEMENT CHARACTERs. XXX - if the number of bytes isn't a multiple of 4, should put a REPLACEMENT CHARACTER at the end. */ | guint8* get_ucs_4_string(wmem_allocator_t *scope, const guint8 *ptr, gint length, const guint encoding) | /* XXX - should map lead and trail surrogate values to a "substitute" UTF-8 character? XXX - should map code points > 10FFFF to REPLACEMENT CHARACTERs. XXX - if the number of bytes isn't a multiple of 4, should put a REPLACEMENT CHARACTER at the end. */
guint8* get_ucs_4_string(wmem_allocator_t *scope, const guint8 *p... | {
gunichar uchar;
gint i;
wmem_strbuf_t *strbuf;
strbuf = wmem_strbuf_sized_new(scope, length+1, 0);
for(i = 0; i + 3 < length; i += 4) {
if (encoding == ENC_BIG_ENDIAN)
uchar = pntoh32(ptr + i);
else
uchar = pletoh32(ptr + i);
wmem_str... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Angular rate sensor. The value is expressed as a 16-bit word in two’s complement.. */ | int32_t lsm6dso_angular_rate_raw_get(stmdev_ctx_t *ctx, int16_t *val) | /* Angular rate sensor. The value is expressed as a 16-bit word in two’s complement.. */
int32_t lsm6dso_angular_rate_raw_get(stmdev_ctx_t *ctx, int16_t *val) | {
uint8_t buff[6];
int32_t ret;
ret = lsm6dso_read_reg(ctx, LSM6DSO_OUTX_L_G, buff, 6);
val[0] = (int16_t)buff[1];
val[0] = (val[0] * 256) + (int16_t)buff[0];
val[1] = (int16_t)buff[3];
val[1] = (val[1] * 256) + (int16_t)buff[2];
val[2] = (int16_t)buff[5];
val[2] = (val[2] * 256) + (int16_t)buff[4];
... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* This searches for expander device based on handle, then returns the sas_node object. */ | struct _sas_node* mpt2sas_scsih_expander_find_by_handle(struct MPT2SAS_ADAPTER *ioc, u16 handle) | /* This searches for expander device based on handle, then returns the sas_node object. */
struct _sas_node* mpt2sas_scsih_expander_find_by_handle(struct MPT2SAS_ADAPTER *ioc, u16 handle) | {
struct _sas_node *sas_expander, *r;
r = NULL;
list_for_each_entry(sas_expander, &ioc->sas_expander_list, list) {
if (sas_expander->handle != handle)
continue;
r = sas_expander;
goto out;
}
out:
return r;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Removes CDATA attributes from the special attribute table */ | static void xmlCleanSpecialAttrCallback(void *payload, void *data, const xmlChar *fullname, const xmlChar *fullattr, const xmlChar *unused ATTRIBUTE_UNUSED) | /* Removes CDATA attributes from the special attribute table */
static void xmlCleanSpecialAttrCallback(void *payload, void *data, const xmlChar *fullname, const xmlChar *fullattr, const xmlChar *unused ATTRIBUTE_UNUSED) | {
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data;
if (((long) payload) == XML_ATTRIBUTE_CDATA) {
xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL);
}
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* param base SAI base pointer. param handle SAI eDMA handle pointer. */ | void SAI_TransferAbortSendEDMA(I2S_Type *base, sai_edma_handle_t *handle) | /* param base SAI base pointer. param handle SAI eDMA handle pointer. */
void SAI_TransferAbortSendEDMA(I2S_Type *base, sai_edma_handle_t *handle) | {
assert(handle != NULL);
EDMA_AbortTransfer(handle->dmaHandle);
base->TCR3 &= ~I2S_TCR3_TCE_MASK;
SAI_TxEnableDMA(base, kSAI_FIFORequestDMAEnable, false);
SAI_TxEnable(base, false);
if ((base->TCSR & I2S_TCSR_TE_MASK) == 0UL)
{
base->TCSR |= (I2S_TCSR_FR_MASK | I2S_TCSR_SR_MASK);
... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Compare two device paths to check if they are exactly same. */ | BOOLEAN EfiCompareDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2) | /* Compare two device paths to check if they are exactly same. */
BOOLEAN EfiCompareDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2) | {
UINTN Size1;
UINTN Size2;
Size1 = GetDevicePathSize (DevicePath1);
Size2 = GetDevicePathSize (DevicePath2);
if (Size1 != Size2) {
return FALSE;
}
if (CompareMem (DevicePath1, DevicePath2, Size1) != 0) {
return FALSE;
}
return TRUE;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* The space between the end of the leaf items and the start of the leaf data. IOW, how much room the leaf has left for both items and data */ | noinline int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf) | /* The space between the end of the leaf items and the start of the leaf data. IOW, how much room the leaf has left for both items and data */
noinline int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf) | {
int nritems = btrfs_header_nritems(leaf);
int ret;
ret = BTRFS_LEAF_DATA_SIZE(root) - leaf_space_used(leaf, 0, nritems);
if (ret < 0) {
printk(KERN_CRIT "leaf free space ret %d, leaf data size %lu, "
"used %d nritems %d\n",
ret, (unsigned long) BTRFS_LEAF_DATA_SIZE(root),
leaf_space_u... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* USBD_MTP_STORAGE_ReceiveContainer Receive the Data from USB BulkOut Buffer to Pointer. */ | static uint8_t USBD_MTP_STORAGE_ReceiveContainer(USBD_HandleTypeDef *pdev, uint32_t *pDst, uint32_t len) | /* USBD_MTP_STORAGE_ReceiveContainer Receive the Data from USB BulkOut Buffer to Pointer. */
static uint8_t USBD_MTP_STORAGE_ReceiveContainer(USBD_HandleTypeDef *pdev, uint32_t *pDst, uint32_t len) | {
USBD_MTP_HandleTypeDef *hmtp = (USBD_MTP_HandleTypeDef *)pdev->pClassDataCmsit[pdev->classId];
uint32_t Counter;
uint32_t *pdst = pDst;
for (Counter = 0; Counter < len; Counter++)
{
*pdst = (hmtp->rx_buff[Counter]);
pdst++;
}
return (uint8_t)USBD_OK;
} | STMicroelectronics/STM32CubeF4 | C++ | Other | 789 |
/* Reads and returns the status register of the serial flash. */ | static uint8_t s25fl1xx_read_status1(struct qspid_t *qspid) | /* Reads and returns the status register of the serial flash. */
static uint8_t s25fl1xx_read_status1(struct qspid_t *qspid) | {
uint8_t status;
s25fl1xx_exec_command(qspid, S25FL1XX_READ_STATUS_1, 0, (uint32_t *)(&status), QSPI_READ_ACCESS, 1);
return status;
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Create a new socket, initialise the fields It is the responsibility of the caller to insque() it into the correct linked-list */ | struct socket* socreate(Slirp *slirp) | /* Create a new socket, initialise the fields It is the responsibility of the caller to insque() it into the correct linked-list */
struct socket* socreate(Slirp *slirp) | {
struct socket *so;
so = (struct socket *)malloc(sizeof(struct socket));
if(so) {
memset(so, 0, sizeof(struct socket));
so->so_state = SS_NOFDREF;
so->s = -1;
so->slirp = slirp;
so->pollfds_idx = -1;
}
return(so);
} | ve3wwg/teensy3_qemu | C++ | Other | 15 |
/* This service enables PEIMs to ascertain the present value of the boot mode. */ | EFI_STATUS EFIAPI PeiServicesGetBootMode(OUT EFI_BOOT_MODE *BootMode) | /* This service enables PEIMs to ascertain the present value of the boot mode. */
EFI_STATUS EFIAPI PeiServicesGetBootMode(OUT EFI_BOOT_MODE *BootMode) | {
ASSERT (FALSE);
return EFI_OUT_OF_RESOURCES;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* param base SPDIF base pointer. param handle SPDIF handle pointer. param callback Pointer to the user callback function. param userData User parameter passed to the callback function. */ | void SPDIF_TransferRxCreateHandle(SPDIF_Type *base, spdif_handle_t *handle, spdif_transfer_callback_t callback, void *userData) | /* param base SPDIF base pointer. param handle SPDIF handle pointer. param callback Pointer to the user callback function. param userData User parameter passed to the callback function. */
void SPDIF_TransferRxCreateHandle(SPDIF_Type *base, spdif_handle_t *handle, spdif_transfer_callback_t callback, void *userData) | {
assert(handle != NULL);
(void)memset(handle, 0, sizeof(*handle));
s_spdifHandle[SPDIF_GetInstance(base)][1] = handle;
handle->callback = callback;
handle->userData = userData;
handle->watermark =
s_spdif_rx_watermark[(base->SCR & SPDIF_SCR_RXFIFOFULL_SEL_MASK) >> SPDIF_SCR_RXFIFOFULL_S... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Set the TWI bus speed in conjunction with the clock frequency in high speed mode. */ | status_code_t twim_set_hsmode_speed(Twim *twim, uint32_t speed, uint32_t clk, uint8_t cycles) | /* Set the TWI bus speed in conjunction with the clock frequency in high speed mode. */
status_code_t twim_set_hsmode_speed(Twim *twim, uint32_t speed, uint32_t clk, uint8_t cycles) | {
uint32_t f_prescaled;
uint8_t cwgr_exp = 0;
f_prescaled = (clk / speed / 2);
while ((f_prescaled > 0xFF) && (cwgr_exp <= 0x7)) {
cwgr_exp++;
f_prescaled /= 2;
}
if (cwgr_exp > 0x7) {
return ERR_INVALID_ARG;
}
twim->TWIM_HSCWGR = TWIM_HSCWGR_LOW(f_prescaled / 2)
| TWIM_HSCWGR_HIGH(f_prescaled - f_pres... | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* SPI Set the Software NSS Signal High.
In slave mode, and only when software slave management is used, this replaces the NSS signal with a slave select enable signal. */ | void spi_set_nss_high(uint32_t spi) | /* SPI Set the Software NSS Signal High.
In slave mode, and only when software slave management is used, this replaces the NSS signal with a slave select enable signal. */
void spi_set_nss_high(uint32_t spi) | {
SPI_CR1(spi) |= SPI_CR1_SSI;
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* This is the exactly like the IDT code. */ | static void lguest_load_gdt(const struct desc_ptr *desc) | /* This is the exactly like the IDT code. */
static void lguest_load_gdt(const struct desc_ptr *desc) | {
unsigned int i;
struct desc_struct *gdt = (void *)desc->address;
for (i = 0; i < (desc->size+1)/8; i++)
kvm_hypercall3(LHCALL_LOAD_GDT_ENTRY, i, gdt[i].a, gdt[i].b);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Write a 32-bit word to a location in VPD EEPROM using the card's PCI VPD ROM capability. */ | int t3_seeprom_write(struct adapter *adapter, u32 addr, __le32 data) | /* Write a 32-bit word to a location in VPD EEPROM using the card's PCI VPD ROM capability. */
int t3_seeprom_write(struct adapter *adapter, u32 addr, __le32 data) | {
u16 val;
int attempts = EEPROM_MAX_POLL;
unsigned int base = adapter->params.pci.vpd_cap_addr;
if ((addr >= EEPROMSIZE && addr != EEPROM_STAT_ADDR) || (addr & 3))
return -EINVAL;
pci_write_config_dword(adapter->pdev, base + PCI_VPD_DATA,
le32_to_cpu(data));
pci_write_config_word(adapter->pdev,base +... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This function is used to Initialize DMA Control. */ | void tls_dma_init(void) | /* This function is used to Initialize DMA Control. */
void tls_dma_init(void) | {
u32 i = 0;
u32 value = 0;
for (i = 0; i < 8; i++)
{
if (!(dma_used_bit & (1<<i)))
{
value |= 3<<(i*2);
}
}
DMA_INTMASK_REG = value;
DMA_INTSRC_REG = value;
} | Nicholas3388/LuaNode | C++ | Other | 1,055 |
/* Function for storing the event handler provided by a registered application module. */ | static uint32_t registered_handler_set(const ble_uuid_t *const p_srv_uuid, ble_db_discovery_evt_handler_t p_evt_handler) | /* Function for storing the event handler provided by a registered application module. */
static uint32_t registered_handler_set(const ble_uuid_t *const p_srv_uuid, ble_db_discovery_evt_handler_t p_evt_handler) | {
if (registered_handler_get(p_srv_uuid) != NULL)
{
return NRF_SUCCESS;
}
if (m_num_of_handlers_reg < DB_DISCOVERY_MAX_USERS)
{
m_registered_handlers[m_num_of_handlers_reg] = *p_srv_uuid;
m_num_of_handlers_reg++;
return NRF_SUCCESS;
}
else
{
return... | labapart/polymcu | C++ | null | 201 |
/* Enables or disables simultaneously the two DAC channels software triggers. */ | void DAC_DualSoftwareTriggerCmd(FunctionalState NewState) | /* Enables or disables simultaneously the two DAC channels software triggers. */
void DAC_DualSoftwareTriggerCmd(FunctionalState NewState) | {
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
DAC->SWTRIGR |= DUAL_SWTRIG_Set ;
}
else
{
DAC->SWTRIGR &= DUAL_SWTRIG_Reset;
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* param handle The RTOS LPUART handle. param tx_timeout_constant_ms TX timeout applied per transmition. param tx_timeout_multiplier_ms TX timeout added for each byte of the transmition. */ | int LPUART_RTOS_SetTxTimeout(lpuart_rtos_handle_t *handle, uint32_t tx_timeout_constant_ms, uint32_t tx_timeout_multiplier_ms) | /* param handle The RTOS LPUART handle. param tx_timeout_constant_ms TX timeout applied per transmition. param tx_timeout_multiplier_ms TX timeout added for each byte of the transmition. */
int LPUART_RTOS_SetTxTimeout(lpuart_rtos_handle_t *handle, uint32_t tx_timeout_constant_ms, uint32_t tx_timeout_multiplier_ms) | {
if (NULL == handle)
{
return kStatus_InvalidArgument;
}
handle->tx_timeout_constant_ms = tx_timeout_constant_ms;
handle->tx_timeout_multiplier_ms = tx_timeout_multiplier_ms;
return kStatus_Success;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Initialize the control inode/socket with a control endpoint data structure. This endpoint is reserved exclusively for the OOTB processing. */ | static int sctp_ctl_sock_init(void) | /* Initialize the control inode/socket with a control endpoint data structure. This endpoint is reserved exclusively for the OOTB processing. */
static int sctp_ctl_sock_init(void) | {
int err;
sa_family_t family = PF_INET;
if (sctp_get_pf_specific(PF_INET6))
family = PF_INET6;
err = inet_ctl_sock_create(&sctp_ctl_sock, family,
SOCK_SEQPACKET, IPPROTO_SCTP, &init_net);
if (err < 0 && family == PF_INET6)
err = inet_ctl_sock_create(&sctp_ctl_sock, AF_INET,
SOCK_SEQPACKET, IPPR... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Print all names corresponding to a mask. This may want to be used in iw_print_retry_value() ? */ | static void iw_print_mask_name(unsigned int mask, const struct iwmask_name names[], const unsigned int num_names, const char *sep) | /* Print all names corresponding to a mask. This may want to be used in iw_print_retry_value() ? */
static void iw_print_mask_name(unsigned int mask, const struct iwmask_name names[], const unsigned int num_names, const char *sep) | {
unsigned int i;
for(i = 0; i < num_names; i++)
{
if(mask & names[i].mask)
{
printf("%s%s", sep, names[i].name);
mask &= ~names[i].mask;
}
}
if(mask != 0)
printf("%sUnknown", sep);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Read values defined by a type string from a buffer, and write these values to environment variables. */ | int type_string_write_vars(const char *type_str, u8 *data, char *const vars[]) | /* Read values defined by a type string from a buffer, and write these values to environment variables. */
int type_string_write_vars(const char *type_str, u8 *data, char *const vars[]) | {
size_t offset;
u32 value;
for (offset = 0; *type_str; type_str++, vars++) {
switch (*type_str) {
case 'b':
value = data[offset];
offset += 1;
break;
case 'w':
value = get_unaligned_be16(data + offset);
offset += 2;
break;
case 'd':
value = get_unaligned_be32(data + offset);
offset +... | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Reserve room for additional data in a netlink message */ | void* nlmsg_reserve(struct nl_msg *n, size_t len, int pad) | /* Reserve room for additional data in a netlink message */
void* nlmsg_reserve(struct nl_msg *n, size_t len, int pad) | {
void *buf = n->nm_nlh;
size_t nlmsg_len = n->nm_nlh->nlmsg_len;
size_t tlen;
tlen = pad ? ((len + (pad - 1)) & ~(pad - 1)) : len;
if ((tlen + nlmsg_len) > n->nm_size)
return NULL;
buf += nlmsg_len;
n->nm_nlh->nlmsg_len += tlen;
if (tlen > len)
memset(buf + len, 0, tlen - len);
NL_DBG(2, "msg %p: Reserved... | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Read an SGE response queue context. The caller is responsible for ensuring only one context operation occurs at a time. */ | int t3_sge_read_rspq(struct adapter *adapter, unsigned int id, u32 data[4]) | /* Read an SGE response queue context. The caller is responsible for ensuring only one context operation occurs at a time. */
int t3_sge_read_rspq(struct adapter *adapter, unsigned int id, u32 data[4]) | {
if (id >= SGE_QSETS)
return -EINVAL;
return t3_sge_read_context(F_RESPONSEQ, adapter, id, data);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Flush all ACL Data Packages from the input-copy queue. */ | static void le_flush_data(uint16_t size) | /* Flush all ACL Data Packages from the input-copy queue. */
static void le_flush_data(uint16_t size) | {
uint16_t response = sys_cpu_to_le16(CMD_LE_FLUSH_DATA_RSP);
struct net_buf *buf;
while ((buf = net_buf_get(&data_queue, K_NO_WAIT))) {
net_buf_unref(buf);
}
read_excess_bytes(size);
size = 0;
edtt_write((uint8_t *)&response, sizeof(response), EDTTT_BLOCK);
edtt_write((uint8_t *)&size, sizeof(size), EDTTT_B... | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* ADC MSP De-Initialization This function freeze the hardware resources used in this example. */ | void HAL_ADC_MspDeInit(ADC_HandleTypeDef *hadc) | /* ADC MSP De-Initialization This function freeze the hardware resources used in this example. */
void HAL_ADC_MspDeInit(ADC_HandleTypeDef *hadc) | {
if(hadc->Instance==ADC1)
{
__HAL_RCC_ADC1_CLK_DISABLE();
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_0|GPIO_PIN_1);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Information regarding the number of caches and their sizes, frequency of operation, slot numbers is all considered platform-related information and is not provided by this service. */ | EFI_STATUS EFIAPI GetProcessorInfo(IN EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer) | /* Information regarding the number of caches and their sizes, frequency of operation, slot numbers is all considered platform-related information and is not provided by this service. */
EFI_STATUS EFIAPI GetProcessorInfo(IN EFI_MP_SERVICES_PROTOCOL *This, IN UINTN ProcessorNumber, OUT EFI_PROCESSOR_INFORMATION *Proces... | {
return MpInitLibGetProcessorInfo (ProcessorNumber, ProcessorInfoBuffer, NULL);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Save non-integer context information.
This routine saves the system's "live" non-integer context into the specified area. If the specified thread supports SSE then x87/MMX/SSEx thread info is saved, otherwise only x87/MMX thread is saved. Function is invoked by FpCtxSave(struct k_thread *thread) */ | static void z_do_fp_regs_save(void *preemp_float_reg) | /* Save non-integer context information.
This routine saves the system's "live" non-integer context into the specified area. If the specified thread supports SSE then x87/MMX/SSEx thread info is saved, otherwise only x87/MMX thread is saved. Function is invoked by FpCtxSave(struct k_thread *thread) */
static void z_d... | {
__asm__ volatile("fnsave (%0);\n\t"
:
: "r"(preemp_float_reg)
: "memory");
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* The sim modem sends and unsolicited +CADATAIND: <cid> if data can be read from a socket. */ | MODEM_CMD_DEFINE(on_urc_cadataind) | /* The sim modem sends and unsolicited +CADATAIND: <cid> if data can be read from a socket. */
MODEM_CMD_DEFINE(on_urc_cadataind) | {
struct modem_socket *sock;
int sock_fd;
sock_fd = atoi(argv[0]);
sock = modem_socket_from_fd(&mdata.socket_config, sock_fd);
if (!sock) {
return 0;
}
modem_socket_packet_size_update(&mdata.socket_config, sock, 1);
LOG_INF("Data available on socket: %d", sock_fd);
modem_socket_data_ready(&mdata.socket_confi... | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Tristates the DAI so that others can use it. */ | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate) | /* Tristates the DAI so that others can use it. */
int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate) | {
if (dai->ops && dai->ops->set_tristate)
return dai->ops->set_tristate(dai, tristate);
else
return -EINVAL;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The operations to get and set the status word just access the status field of the device descriptor. set_status will also make a hypercall to the host, to tell about status changes */ | static u8 kvm_get_status(struct virtio_device *vdev) | /* The operations to get and set the status word just access the status field of the device descriptor. set_status will also make a hypercall to the host, to tell about status changes */
static u8 kvm_get_status(struct virtio_device *vdev) | {
return to_kvmdev(vdev)->desc->status;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Expand a component horizontally from width input_cols to width output_cols, by duplicating the rightmost samples. */ | expand_right_edge(JSAMPARRAY image_data, int num_rows, JDIMENSION input_cols, JDIMENSION output_cols) | /* Expand a component horizontally from width input_cols to width output_cols, by duplicating the rightmost samples. */
expand_right_edge(JSAMPARRAY image_data, int num_rows, JDIMENSION input_cols, JDIMENSION output_cols) | {
register JSAMPROW ptr;
register JSAMPLE pixval;
register int count;
int row;
int numcols = (int)(output_cols - input_cols);
if (numcols > 0) {
for (row = 0; row < num_rows; row++) {
ptr = image_data[row] + input_cols;
pixval = ptr[-1];
for (count = n... | nanoframework/nf-interpreter | C++ | MIT License | 293 |
/* Get the status of the specified flag of SRAM. */ | en_flag_status_t SRAM_GetStatus(uint32_t u32Flag) | /* Get the status of the specified flag of SRAM. */
en_flag_status_t SRAM_GetStatus(uint32_t u32Flag) | {
en_flag_status_t enStatus = RESET;
DDL_ASSERT(IS_SRAM_FLAG(u32Flag));
if (READ_REG32_BIT(CM_SRAMC->CKSR, u32Flag) != 0U) {
enStatus = SET;
}
return enStatus;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This function retrieves the user readable name of a driver in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the driver name is returned in DriverName, and EFI_SUCCESS is returned. If the driver specified by This does no... | EFI_STATUS EFIAPI OpalEfiDriverComponentNameGetDriverName(EFI_COMPONENT_NAME_PROTOCOL *This, CHAR8 *Language, CHAR16 **DriverName) | /* This function retrieves the user readable name of a driver in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the driver name is returned in DriverName, and EFI_SUCCESS is returned. If the driver specified by This does no... | {
return LookupUnicodeString2 (
Language,
This->SupportedLanguages,
mOpalDriverNameTable,
DriverName,
TRUE
);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Merges two consequent lists of equal size depending on bits read. */ | static void merge(GetBitContext *gb, uint8_t *dst, uint8_t *src, int size) | /* Merges two consequent lists of equal size depending on bits read. */
static void merge(GetBitContext *gb, uint8_t *dst, uint8_t *src, int size) | {
uint8_t *src2 = src + size;
int size2 = size;
do {
if (!get_bits1(gb)) {
*dst++ = *src++;
size--;
} else {
*dst++ = *src2++;
size2--;
}
} while (size && size2);
while (size--)
*dst++ = *src++;
while (size2--)
... | DC-SWAT/DreamShell | C++ | null | 404 |
/* Return the julian day number of the date specified in the arguments */ | static void juliandayFunc(sqlite3_context *context, int argc, sqlite3_value **argv) | /* Return the julian day number of the date specified in the arguments */
static void juliandayFunc(sqlite3_context *context, int argc, sqlite3_value **argv) | {
DateTime x;
if( isDate(context, argc, argv, &x)==0 ){
computeJD(&x);
sqlite3_result_double(context, x.iJD/86400000.0);
}
} | DC-SWAT/DreamShell | C++ | null | 404 |
/* Polarity is determined based on the PHY specific status register. */ | s32 e1000_check_polarity_m88(struct e1000_hw *hw) | /* Polarity is determined based on the PHY specific status register. */
s32 e1000_check_polarity_m88(struct e1000_hw *hw) | {
struct e1000_phy_info *phy = &hw->phy;
s32 ret_val;
u16 data;
ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &data);
if (!ret_val)
phy->cable_polarity = (data & M88E1000_PSSR_REV_POLARITY)
? e1000_rev_polarity_reversed
: e1000_rev_polarity_normal;
return ret_val;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* uIP Management function. This function manages the uIP stack when called while an RNDIS device has been attached to the system. */ | void uIPManagement_ManageNetwork(void) | /* uIP Management function. This function manages the uIP stack when called while an RNDIS device has been attached to the system. */
void uIPManagement_ManageNetwork(void) | {
if (((USB_CurrentMode == USB_MODE_Host) && (USB_HostState == HOST_STATE_Configured)) ||
((USB_CurrentMode == USB_MODE_Device) && (USB_DeviceState == DEVICE_STATE_Configured)))
{
uIPManagement_ProcessIncomingPacket();
uIPManagement_ManageConnections();
}
} | prusa3d/Prusa-Firmware-Buddy | C++ | Other | 1,019 |
/* This is based on cpu_clock(), which will allow at most ~1 jiffy of jitter between CPUs. So it's a pretty scalable clock, but there can be offsets in the trace data. */ | u64 notrace trace_clock(void) | /* This is based on cpu_clock(), which will allow at most ~1 jiffy of jitter between CPUs. So it's a pretty scalable clock, but there can be offsets in the trace data. */
u64 notrace trace_clock(void) | {
return cpu_clock(raw_smp_processor_id());
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Prints (calling the Lua 'print' function) any values on the stack */ | static void l_print(lua_State *L) | /* Prints (calling the Lua 'print' function) any values on the stack */
static void l_print(lua_State *L) | {
luaL_checkstack(L, LUA_MINSTACK, "too many results to print");
lua_getglobal(L, "print");
lua_insert(L, 1);
if (lua_pcall(L, n, 0, 0) != LUA_OK)
l_message(progname, lua_pushfstring(L, "error calling 'print' (%s)",
lua_tostring(L, -1)));
}
} | Nicholas3388/LuaNode | C++ | Other | 1,055 |
/* The registers will be default values after the reset */ | void XAxiVdma_Reset(XAxiVdma *InstancePtr, u16 Direction) | /* The registers will be default values after the reset */
void XAxiVdma_Reset(XAxiVdma *InstancePtr, u16 Direction) | {
XAxiVdma_Channel *Channel;
Channel = XAxiVdma_GetChannel(InstancePtr, Direction);
if (!Channel) {
return;
}
if (Channel->IsValid) {
XAxiVdma_ChannelReset(Channel);
return;
}
} | ua1arn/hftrx | C++ | null | 69 |
/* 48 = DIP switch 1 49 = DIP switch 2 50 = DIP switch 3 51 = DIP switch 4 52 = DIP switch 5 53 = DIP switch 6 54 = DIP switch 7 55 = DIP switch 8 */ | static char get_led(void) | /* 48 = DIP switch 1 49 = DIP switch 2 50 = DIP switch 3 51 = DIP switch 4 52 = DIP switch 5 53 = DIP switch 6 54 = DIP switch 7 55 = DIP switch 8 */
static char get_led(void) | {
return (char)tb0219_read(TB0219_LED);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* param base AIPSTZ peripheral base pointer param master Masters for AIPSTZ. param privilegeConfig Configuration is ORed from aipstz_master_privilege_level_t. */ | void AIPSTZ_SetMasterPriviledgeLevel(AIPSTZ_Type *base, aipstz_master_t master, uint32_t privilegeConfig) | /* param base AIPSTZ peripheral base pointer param master Masters for AIPSTZ. param privilegeConfig Configuration is ORed from aipstz_master_privilege_level_t. */
void AIPSTZ_SetMasterPriviledgeLevel(AIPSTZ_Type *base, aipstz_master_t master, uint32_t privilegeConfig) | {
uint32_t mask = ((uint32_t)master >> 8U) - 1U;
uint32_t shift = (uint32_t)master & 0xFFU;
base->MPR = (base->MPR & (~(mask << shift))) | (privilegeConfig << shift);
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Returns: the element, or NULL if the position is off the end of the #GSList */ | GSList* g_slist_nth(GSList *list, guint n) | /* Returns: the element, or NULL if the position is off the end of the #GSList */
GSList* g_slist_nth(GSList *list, guint n) | {
while (n-- > 0 && list)
list = list->next;
return list;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* This routine checks the status of the last configuration cycle. If an error was detected it returns a 1, else it returns a 0. The errors being checked are parity, master abort, target abort (master and target). These types of errors occur during a config cycle where there is no device, like during the discovery stag... | static int iop3xx_pci_status(void) | /* This routine checks the status of the last configuration cycle. If an error was detected it returns a 1, else it returns a 0. The errors being checked are parity, master abort, target abort (master and target). These types of errors occur during a config cycle where there is no device, like during the discovery stag... | {
unsigned int status;
int ret = 0;
status = *IOP3XX_ATUSR;
if (status & 0xf900) {
DBG("\t\t\tPCI: P0 - status = 0x%08x\n", status);
*IOP3XX_ATUSR = status & 0xf900;
ret = 1;
}
status = *IOP3XX_ATUISR;
if (status & 0x679f) {
DBG("\t\t\tPCI: P1 - status = 0x%08x\n", status);
*IOP3XX_ATUISR = status & 0x... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* this routine will put a word on the processes privileged stack. the offset is how far from the base addr as stored in the THREAD. this routine assumes that all the privileged stacks are in our data space. */ | static int put_user_reg(struct task_struct *task, int offset, long data) | /* this routine will put a word on the processes privileged stack. the offset is how far from the base addr as stored in the THREAD. this routine assumes that all the privileged stacks are in our data space. */
static int put_user_reg(struct task_struct *task, int offset, long data) | {
struct pt_regs newregs, *regs = task_pt_regs(task);
int ret = -EINVAL;
newregs = *regs;
newregs.uregs[offset] = data;
if (valid_user_regs(&newregs)) {
regs->uregs[offset] = data;
ret = 0;
}
return ret;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Setup the timer to generate the tick interrupts. Configure a number of standard MPU regions that are used by all tasks.
Setup the timer to generate the tick interrupts. */ | static void prvSetupTimerInterrupt(static void prvSetupMPU void) | /* Setup the timer to generate the tick interrupts. Configure a number of standard MPU regions that are used by all tasks.
Setup the timer to generate the tick interrupts. */
static void prvSetupTimerInterrupt(static void prvSetupMPU void) | {
pxTopOfStack--;
*pxTopOfStack = portINITIAL_XPSR;
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) pxCode;
pxTopOfStack--;
*pxTopOfStack = 0;
pxTopOfStack -= 5;
*pxTopOfStack = ( portSTACK_TYPE ) pvParameters;
pxTopOfStack -= 9;
if( xRunPrivileged == pdTRUE )
{
*pxTopOfStack = portINITIAL_CONTROL_IF_PR... | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Removes the mapping from handle to filp for this object. */ | static int drm_gem_handle_delete(struct drm_file *filp, u32 handle) | /* Removes the mapping from handle to filp for this object. */
static int drm_gem_handle_delete(struct drm_file *filp, u32 handle) | {
struct drm_device *dev;
struct drm_gem_object *obj;
spin_lock(&filp->table_lock);
obj = idr_find(&filp->object_idr, handle);
if (obj == NULL) {
spin_unlock(&filp->table_lock);
return -EINVAL;
}
dev = obj->dev;
idr_remove(&filp->object_idr, handle);
spin_unlock(&filp->table_lock);
mutex_lock(&dev->struct... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Configure the SPI as Master.
To support multiple masters (dynamic switching between master and slave) you must set SSOE to 0 and select either software or hardware control of the NSS pin. */ | int spi_init_master(uint32_t spi, uint32_t br, uint32_t cpol, uint32_t cpha, uint32_t dff, uint32_t lsbfirst) | /* Configure the SPI as Master.
To support multiple masters (dynamic switching between master and slave) you must set SSOE to 0 and select either software or hardware control of the NSS pin. */
int spi_init_master(uint32_t spi, uint32_t br, uint32_t cpol, uint32_t cpha, uint32_t dff, uint32_t lsbfirst) | {
uint32_t reg32 = SPI_CR1(spi);
reg32 &= SPI_CR1_SPE | SPI_CR1_CRCEN | SPI_CR1_CRCNEXT;
reg32 |= SPI_CR1_MSTR;
reg32 |= br;
reg32 |= cpol;
reg32 |= cpha;
reg32 |= dff;
reg32 |= lsbfirst;
SPI_CR2(spi) |= SPI_CR2_SSOE;
SPI_CR1(spi) = reg32;
return 0;
} | libopencm3/libopencm3 | C++ | GNU General Public License v3.0 | 2,931 |
/* Unregisters an interrupt handler for the CAN controller. */ | void CANIntUnregister(uint32_t ui32Base) | /* Unregisters an interrupt handler for the CAN controller. */
void CANIntUnregister(uint32_t ui32Base) | {
uint_fast8_t ui8IntNumber;
ASSERT(_CANBaseValid(ui32Base));
ui8IntNumber = _CANIntNumberGet(ui32Base);
ASSERT(ui8IntNumber != 0);
IntDisable(ui8IntNumber);
IntUnregister(ui8IntNumber);
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* read from a secondary register on the PASIC3 */ | u8 pasic3_read_register(struct device *dev, u32 reg) | /* read from a secondary register on the PASIC3 */
u8 pasic3_read_register(struct device *dev, u32 reg) | {
struct pasic3_data *asic = dev_get_drvdata(dev);
int bus_shift = asic->bus_shift;
void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift);
void __iomem *data = asic->mapping + (REG_DATA << bus_shift);
__raw_writeb(READ_MODE | reg, addr);
return __raw_readb(data);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Note: Resetting the camera FIFO via the CC_RST bit in the CC_CTRL register is supposed to be sufficient to recover from a camera interface error, but it doesn't seem to be enough. If we only do that then subsequent image captures are out of sync by either one or two times DMA_THRESHOLD bytes. Resetting and re-initia... | static void omap24xxcam_capture_cont(struct omap24xxcam_device *cam) | /* Note: Resetting the camera FIFO via the CC_RST bit in the CC_CTRL register is supposed to be sufficient to recover from a camera interface error, but it doesn't seem to be enough. If we only do that then subsequent image captures are out of sync by either one or two times DMA_THRESHOLD bytes. Resetting and re-initia... | {
unsigned long flags;
spin_lock_irqsave(&cam->core_enable_disable_lock, flags);
if (atomic_read(&cam->in_reset) != 1)
goto out;
omap24xxcam_hwinit(cam);
omap24xxcam_sensor_if_enable(cam);
omap24xxcam_sgdma_process(&cam->sgdma);
if (cam->sgdma_in_queue)
omap24xxcam_core_enable(cam);
out:
atomic_dec(&cam->in... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* step1 of enumeration - wait a USB reset */ | static void main_usb_enum_step1(void) | /* step1 of enumeration - wait a USB reset */
static void main_usb_enum_step1(void) | {
main_usb_wait_end_of_reset();
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Enables I2C 10-bit header only mode with read direction. */ | void I2C_Enable10BitAddressHeader(I2C_T *i2c) | /* Enables I2C 10-bit header only mode with read direction. */
void I2C_Enable10BitAddressHeader(I2C_T *i2c) | {
i2c->CTRL2_B.ADDR10 = BIT_SET;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* This function sets the maximum number of SCBs and DDBs which can be used by the sequencer. This is normally 512 and 128 respectively. If support for more SCBs or more DDBs is required then CMDCTXBASE, DEVCTXBASE and CTXDOMAIN are initialized here to extend context memory to point to host memory, thus allowing unlimi... | static int asd_init_ctxmem(struct asd_ha_struct *asd_ha) | /* This function sets the maximum number of SCBs and DDBs which can be used by the sequencer. This is normally 512 and 128 respectively. If support for more SCBs or more DDBs is required then CMDCTXBASE, DEVCTXBASE and CTXDOMAIN are initialized here to extend context memory to point to host memory, thus allowing unlimi... | {
int bitmap_bytes;
asd_get_max_scb_ddb(asd_ha);
asd_extend_devctx(asd_ha);
asd_extend_cmdctx(asd_ha);
bitmap_bytes = (asd_ha->hw_prof.max_ddbs+7)/8;
bitmap_bytes = BITS_TO_LONGS(bitmap_bytes*8)*sizeof(unsigned long);
asd_ha->hw_prof.ddb_bitmap = kzalloc(bitmap_bytes, GFP_KERNEL);
if (!asd_ha->hw_prof.ddb_bitma... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* param base CSI peripheral base address. param fifo The FIFO to clear. */ | void CSI_ClearFifo(CSI_Type *base, csi_fifo_t fifo) | /* param base CSI peripheral base address. param fifo The FIFO to clear. */
void CSI_ClearFifo(CSI_Type *base, csi_fifo_t fifo) | {
uint32_t cr1;
uint32_t mask = 0U;
cr1 = CSI_REG_CR1(base);
CSI_REG_CR1(base) = (cr1 & ~CSI_CR1_FCC_MASK);
if (0U != ((uint32_t)fifo & (uint32_t)kCSI_RxFifo))
{
mask |= CSI_CR1_CLR_RXFIFO_MASK;
}
if (0U != ((uint32_t)fifo & (uint32_t)kCSI_StatFifo))
{
m... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Change Logs: Date Author Notes armink the first version ring block buffer object initialization */ | void rt_rbb_init(rt_rbb_t rbb, rt_uint8_t *buf, rt_size_t buf_size, rt_rbb_blk_t block_set, rt_size_t blk_max_num) | /* Change Logs: Date Author Notes armink the first version ring block buffer object initialization */
void rt_rbb_init(rt_rbb_t rbb, rt_uint8_t *buf, rt_size_t buf_size, rt_rbb_blk_t block_set, rt_size_t blk_max_num) | {
rt_size_t i;
RT_ASSERT(rbb);
RT_ASSERT(buf);
RT_ASSERT(block_set);
rbb->buf = buf;
rbb->buf_size = buf_size;
rbb->blk_set = block_set;
rbb->blk_max_num = blk_max_num;
rt_slist_init(&rbb->blk_list);
for (i = 0; i < blk_max_num; i++)
{
block_set[i].status = RT_RBB_BLK... | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Enables or disables the Pin(s) active level inversion. */ | void USART_InvPinCmd(USART_TypeDef *USARTx, uint32_t USART_InvPin, FunctionalState NewState) | /* Enables or disables the Pin(s) active level inversion. */
void USART_InvPinCmd(USART_TypeDef *USARTx, uint32_t USART_InvPin, FunctionalState NewState) | {
assert_param(IS_USART_ALL_PERIPH(USARTx));
assert_param(IS_USART_INVERSTION_PIN(USART_InvPin));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
USARTx->CR2 |= USART_InvPin;
}
else
{
USARTx->CR2 &= (uint32_t)~USART_InvPin;
}
} | ajhc/demo-cortex-m3 | C++ | null | 38 |
/* _detach is called to deconfigure a device. It should deallocate resources. This function is also called when _attach() fails, so it should be careful not to release resources that were not necessarily allocated by _attach(). dev->private and dev->subdevices are deallocated automatically by the core. */ | static int skel_detach(struct comedi_device *dev) | /* _detach is called to deconfigure a device. It should deallocate resources. This function is also called when _attach() fails, so it should be careful not to release resources that were not necessarily allocated by _attach(). dev->private and dev->subdevices are deallocated automatically by the core. */
static int s... | {
printk("comedi%d: skel: remove\n", dev->minor);
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Description: Parse a CIPSO local tag and return the security attributes in @secattr. Return zero on success, negatives values on failure. */ | static int cipso_v4_parsetag_loc(const struct cipso_v4_doi *doi_def, const unsigned char *tag, struct netlbl_lsm_secattr *secattr) | /* Description: Parse a CIPSO local tag and return the security attributes in @secattr. Return zero on success, negatives values on failure. */
static int cipso_v4_parsetag_loc(const struct cipso_v4_doi *doi_def, const unsigned char *tag, struct netlbl_lsm_secattr *secattr) | {
secattr->attr.secid = *(u32 *)&tag[2];
secattr->flags |= NETLBL_SECATTR_SECID;
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* After receiving "dec_cntr" times RR command, this action decreases "npta" by one. Returns 0 for success, 1 otherwise. */ | int llc_conn_ac_adjust_npta_by_rr(struct sock *sk, struct sk_buff *skb) | /* After receiving "dec_cntr" times RR command, this action decreases "npta" by one. Returns 0 for success, 1 otherwise. */
int llc_conn_ac_adjust_npta_by_rr(struct sock *sk, struct sk_buff *skb) | {
struct llc_sock *llc = llc_sk(sk);
if (!llc->connect_step && !llc->remote_busy_flag) {
if (!llc->dec_step) {
if (!llc->dec_cntr) {
llc->inc_cntr = llc->dec_cntr = 2;
if (llc->npta > 0)
llc->npta = llc->npta - 1;
} else
llc->dec_cntr -=1;
}
} else
llc->connect_step = 0 ;
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Determine if an address is a broadcast address on a network interface */ | u8_t ip4_addr_isbroadcast(u32_t addr, const struct netif *netif) | /* Determine if an address is a broadcast address on a network interface */
u8_t ip4_addr_isbroadcast(u32_t addr, const struct netif *netif) | {
ip_addr_t ipaddr;
ip4_addr_set_u32(&ipaddr, addr);
if ((~addr == IPADDR_ANY) ||
(addr == IPADDR_ANY)) {
return 1;
} else if ((netif->flags & NETIF_FLAG_BROADCAST) == 0) {
return 0;
} else if (addr == ip4_addr_get_u32(&netif->ip_addr)) {
return 0;
} else if (ip_addr_netcmp(&ipaddr, &(neti... | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Request the PE to send a Source Capability message. */ | USBPD_StatusTypeDef USBPD_DPM_RequestSourceCapability(uint8_t PortNum) | /* Request the PE to send a Source Capability message. */
USBPD_StatusTypeDef USBPD_DPM_RequestSourceCapability(uint8_t PortNum) | {
return USBPD_PE_Request_DataMessage(PortNum, USBPD_DATAMSG_SRC_CAPABILITIES, NULL, 0);
} | st-one/X-CUBE-USB-PD | C++ | null | 110 |
/* This address an errata where diag reset clears out the table */ | static void _base_save_msix_table(struct MPT2SAS_ADAPTER *ioc) | /* This address an errata where diag reset clears out the table */
static void _base_save_msix_table(struct MPT2SAS_ADAPTER *ioc) | {
int i;
if (!ioc->msix_enable || ioc->msix_table_backup == NULL)
return;
for (i = 0; i < ioc->msix_vector_count; i++)
ioc->msix_table_backup[i] = ioc->msix_table[i];
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* iop_adma_free_slots - flags descriptor slots for reuse @slot: Slot to free Caller must hold &iop_chan->lock while calling this function */ | static void iop_adma_free_slots(struct iop_adma_desc_slot *slot) | /* iop_adma_free_slots - flags descriptor slots for reuse @slot: Slot to free Caller must hold &iop_chan->lock while calling this function */
static void iop_adma_free_slots(struct iop_adma_desc_slot *slot) | {
int stride = slot->slots_per_op;
while (stride--) {
slot->slots_per_op = 0;
slot = list_entry(slot->slot_node.next,
struct iop_adma_desc_slot,
slot_node);
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Force a portmap lookup of the remote lockd port */ | void nlm_rebind_host(struct nlm_host *host) | /* Force a portmap lookup of the remote lockd port */
void nlm_rebind_host(struct nlm_host *host) | {
dprintk("lockd: rebind host %s\n", host->h_name);
if (host->h_rpcclnt && time_after_eq(jiffies, host->h_nextrebind)) {
rpc_force_rebind(host->h_rpcclnt);
host->h_nextrebind = jiffies + NLM_HOST_REBIND;
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Set the specified data holding register value for DAC channel 1. */ | void DAC_ConfigChannel1Data(DAC_ALIGN_T align, uint16_t data) | /* Set the specified data holding register value for DAC channel 1. */
void DAC_ConfigChannel1Data(DAC_ALIGN_T align, uint16_t data) | {
__IO uint32_t tmp = 0;
tmp = (uint32_t)DAC_BASE;
tmp += 0x00000008 + align;
*(__IO uint32_t*) tmp = data;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Mark the given read buffer descriptor as free */ | static void fec_rbd_clean(int last, struct fec_bd *pRbd) | /* Mark the given read buffer descriptor as free */
static void fec_rbd_clean(int last, struct fec_bd *pRbd) | {
if (last)
writew(FEC_RBD_WRAP | FEC_RBD_EMPTY, &pRbd->status);
else
writew(FEC_RBD_EMPTY, &pRbd->status);
writew(0, &pRbd->data_length);
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* Write an error message in the given output buffer. */ | static void tpm_write_fatal_error_response(uint8_t *out, uint32_t out_len) | /* Write an error message in the given output buffer. */
static void tpm_write_fatal_error_response(uint8_t *out, uint32_t out_len) | {
if (out_len >= sizeof(struct tpm_resp_hdr)) {
struct tpm_resp_hdr *resp = (struct tpm_resp_hdr *)out;
resp->tag = cpu_to_be16(TPM_TAG_RSP_COMMAND);
resp->len = cpu_to_be32(sizeof(struct tpm_resp_hdr));
resp->errcode = cpu_to_be32(TPM_FAIL);
}
} | ve3wwg/teensy3_qemu | C++ | Other | 15 |
/* The dev_link structure is initialized, but we don't actually configure the card at this point */ | static int spectrum_cs_probe(struct pcmcia_device *link) | /* The dev_link structure is initialized, but we don't actually configure the card at this point */
static int spectrum_cs_probe(struct pcmcia_device *link) | {
struct orinoco_private *priv;
struct orinoco_pccard *card;
priv = alloc_orinocodev(sizeof(*card), &link->dev,
spectrum_cs_hard_reset,
spectrum_cs_stop_firmware);
if (!priv)
return -ENOMEM;
card = priv->card;
card->p_dev = link;
link->priv = priv;
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
lin... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* retval kStatus_Success Slave transfers were successfully started. retval #kStatus_I2C_Busy Slave transfers have already been started on this handle. */ | status_t I2C_SlaveTransferNonBlocking(I2C_Type *base, i2c_slave_handle_t *handle, uint32_t eventMask) | /* retval kStatus_Success Slave transfers were successfully started. retval #kStatus_I2C_Busy Slave transfers have already been started on this handle. */
status_t I2C_SlaveTransferNonBlocking(I2C_Type *base, i2c_slave_handle_t *handle, uint32_t eventMask) | {
return I2C_SlaveTransferNonBlockingInternal(base, handle, NULL, 0u, NULL, 0u, eventMask);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* If Map is NULL, then ASSERT(). If Item is NULL, then ASSERT(). if item in not in the netmap, then ASSERT(). */ | VOID* EFIAPI NetMapRemoveItem(IN OUT NET_MAP *Map, IN OUT NET_MAP_ITEM *Item, OUT VOID **Value OPTIONAL) | /* If Map is NULL, then ASSERT(). If Item is NULL, then ASSERT(). if item in not in the netmap, then ASSERT(). */
VOID* EFIAPI NetMapRemoveItem(IN OUT NET_MAP *Map, IN OUT NET_MAP_ITEM *Item, OUT VOID **Value OPTIONAL) | {
ASSERT ((Map != NULL) && (Item != NULL));
ASSERT (NetItemInMap (Map, Item));
RemoveEntryList (&Item->Link);
Map->Count--;
InsertHeadList (&Map->Recycled, &Item->Link);
if (Value != NULL) {
*Value = Item->Value;
}
return Item->Key;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Returns 0 if dmi1 and dmi2 are the same, non-0 otherwise */ | static int bond_is_dmi_same(const struct dev_mc_list *dmi1, const struct dev_mc_list *dmi2) | /* Returns 0 if dmi1 and dmi2 are the same, non-0 otherwise */
static int bond_is_dmi_same(const struct dev_mc_list *dmi1, const struct dev_mc_list *dmi2) | {
return memcmp(dmi1->dmi_addr, dmi2->dmi_addr, dmi1->dmi_addrlen) == 0 &&
dmi1->dmi_addrlen == dmi2->dmi_addrlen;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* leb_read_unlock - unlock logical eraseblock. @ubi: UBI device description object @vol_id: volume ID @lnum: logical eraseblock number */ | static void leb_read_unlock(struct ubi_device *ubi, int vol_id, int lnum) | /* leb_read_unlock - unlock logical eraseblock. @ubi: UBI device description object @vol_id: volume ID @lnum: logical eraseblock number */
static void leb_read_unlock(struct ubi_device *ubi, int vol_id, int lnum) | {
int _free = 0;
struct ubi_ltree_entry *le;
spin_lock(&ubi->ltree_lock);
le = ltree_lookup(ubi, vol_id, lnum);
le->users -= 1;
ubi_assert(le->users >= 0);
if (le->users == 0) {
rb_erase(&le->rb, &ubi->ltree);
_free = 1;
}
spin_unlock(&ubi->ltree_lock);
up_read(&le->mutex);
if (_free)
kfree(le);
} | EmcraftSystems/u-boot | C++ | Other | 181 |
/* This function returns the interrupt number for a system exception. */ | static uint32_t _SysExcIntNumberGet(void) | /* This function returns the interrupt number for a system exception. */
static uint32_t _SysExcIntNumberGet(void) | {
uint32_t ui32Int;
if(CLASS_IS_BLIZZARD)
{
ui32Int = INT_SYSEXC_BLIZZARD;
}
else
{
ui32Int = 0;
}
return(ui32Int);
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* This function sets the update marker flag for volume @vol. Returns zero in case of success and a negative error code in case of failure. */ | static int set_update_marker(struct ubi_device *ubi, struct ubi_volume *vol) | /* This function sets the update marker flag for volume @vol. Returns zero in case of success and a negative error code in case of failure. */
static int set_update_marker(struct ubi_device *ubi, struct ubi_volume *vol) | {
int err;
struct ubi_vtbl_record vtbl_rec;
dbg_gen("set update marker for volume %d", vol->vol_id);
if (vol->upd_marker) {
ubi_assert(ubi->vtbl[vol->vol_id].upd_marker);
dbg_gen("already set");
return 0;
}
memcpy(&vtbl_rec, &ubi->vtbl[vol->vol_id],
sizeof(struct ubi_vtbl_record));
vtbl_rec.upd_mar... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* If the update of the counter for the specified PWM generator has yet to be completed, the value returned may not be the active period. The value returned is the programmed period, measured in PWM clock ticks. */ | uint32_t PWMGenPeriodGet(uint32_t ui32Base, uint32_t ui32Gen) | /* If the update of the counter for the specified PWM generator has yet to be completed, the value returned may not be the active period. The value returned is the programmed period, measured in PWM clock ticks. */
uint32_t PWMGenPeriodGet(uint32_t ui32Base, uint32_t ui32Gen) | {
ASSERT(ui32Base == PWM0_BASE);
ASSERT(_PWMGenValid(ui32Gen));
ui32Gen = PWM_GEN_BADDR(ui32Base, ui32Gen);
if (HWREG(ui32Gen + PWM_O_X_CTL) & PWM_X_CTL_MODE)
{
return (HWREG(ui32Gen + PWM_O_X_LOAD) * 2);
}
else
{
return (HWREG(ui32Gen + PWM_O_X_LOAD) + 1);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* USBD_VIDEO_GetEpDesc This function return the Video Endpoint descriptor. */ | static void * USBD_VIDEO_GetEpDesc(uint8_t *pConfDesc, uint8_t EpAddr) | /* USBD_VIDEO_GetEpDesc This function return the Video Endpoint descriptor. */
static void * USBD_VIDEO_GetEpDesc(uint8_t *pConfDesc, uint8_t EpAddr) | {
USBD_VIDEO_DescHeader_t *pdesc = (USBD_VIDEO_DescHeader_t *)(void *)pConfDesc;
USBD_ConfigDescTypedef *desc = (USBD_ConfigDescTypedef *)(void *)pConfDesc;
USBD_EpDescTypedef *pEpDesc = NULL;
uint16_t ptr;
if (desc->wTotalLength > desc->bLength)
{
ptr = desc->bLength;
while (ptr < desc->wTotalLengt... | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* A helper for ->readlink(). This should be used */ | int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) | /* A helper for ->readlink(). This should be used */
int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) | {
struct nameidata nd;
void *cookie;
int res;
nd.depth = 0;
cookie = dentry->d_inode->i_op->follow_link(dentry, &nd);
if (IS_ERR(cookie))
return PTR_ERR(cookie);
res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd));
if (dentry->d_inode->i_op->put_link)
dentry->d_inode->i_op->put_link(dentry, &nd, co... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* USBH_MSC_BOT_Abort The function handle the BOT Abort process. */ | static USBH_StatusTypeDef USBH_MSC_BOT_Abort(USBH_HandleTypeDef *phost, uint8_t lun, uint8_t dir) | /* USBH_MSC_BOT_Abort The function handle the BOT Abort process. */
static USBH_StatusTypeDef USBH_MSC_BOT_Abort(USBH_HandleTypeDef *phost, uint8_t lun, uint8_t dir) | {
USBH_StatusTypeDef status = USBH_FAIL;
MSC_HandleTypeDef *MSC_Handle = (MSC_HandleTypeDef *) phost->pActiveClass->pData;
switch (dir)
{
case BOT_DIR_IN :
status = USBH_ClrFeature(phost, MSC_Handle->InEp);
break;
case BOT_DIR_OUT :
status = USBH_ClrFeature(phost, MSC_Handle->OutEp);
break;... | labapart/polymcu | C++ | null | 201 |
/* g e t D u a l S o l u t i o n */ | returnValue QProblemB_getDualSolution(QProblemB *_THIS, real_t *const yOpt) | /* g e t D u a l S o l u t i o n */
returnValue QProblemB_getDualSolution(QProblemB *_THIS, real_t *const yOpt) | {
int i;
for( i=0; i<QProblemB_getNV( _THIS ); ++i )
yOpt[i] = _THIS->y[i];
if ( ( QProblemB_getStatus( _THIS ) == QPS_AUXILIARYQPSOLVED ) ||
( QProblemB_getStatus( _THIS ) == QPS_HOMOTOPYQPSOLVED ) ||
( QProblemB_getStatus( _THIS ) == QPS_SOLVED ) )
{
return SUCCESSFUL_RETURN;
}
else
{
return RET_Q... | DanielMartensson/EmbeddedLapack | C++ | MIT License | 129 |
/* This code cleans up enrolled file by closing file & free related resources attached to enrolled file. */ | VOID CloseEnrolledFile(IN SECUREBOOT_FILE_CONTEXT *FileContext) | /* This code cleans up enrolled file by closing file & free related resources attached to enrolled file. */
VOID CloseEnrolledFile(IN SECUREBOOT_FILE_CONTEXT *FileContext) | {
if (FileContext->FHandle != NULL) {
CloseFile (FileContext->FHandle);
FileContext->FHandle = NULL;
}
if (FileContext->FileName != NULL) {
FreePool (FileContext->FileName);
FileContext->FileName = NULL;
}
FileContext->FileType = UNKNOWN_FILE_TYPE;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Resets the RCC clock configuration to the default reset state. */ | void RCC_DeInit(void) | /* Resets the RCC clock configuration to the default reset state. */
void RCC_DeInit(void) | {
RCC->CR |= (uint32_t)0x00000001;
RCC->CFGR &= (uint32_t)0xF8FF0000;
RCC->CR &= (uint32_t)0xFEF6FFFF;
RCC->CR &= (uint32_t)0xFFFBFFFF;
RCC->CFGR &= (uint32_t)0xFF80FFFF;
RCC->CIR = 0x009F0000;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Gets the current transfer size for a uDMA channel control structure. */ | unsigned long uDMAChannelSizeGet(unsigned long ulChannelStructIndex) | /* Gets the current transfer size for a uDMA channel control structure. */
unsigned long uDMAChannelSizeGet(unsigned long ulChannelStructIndex) | {
tDMAControlTable *pControlTable;
unsigned long ulControl;
ASSERT(ulChannelStructIndex < 64);
ASSERT(HWREG(UDMA_CTLBASE) != 0);
pControlTable = (tDMAControlTable *)HWREG(UDMA_CTLBASE);
ulControl = (pControlTable[ulChannelStructIndex].ulControl &
(UDMA_CHCTL_XFERSIZE_M | UDMA_CH... | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Disables asynchronous callback generation for a given channel and type.
Disables asynchronous callbacks for a given logical external interrupt channel and type. */ | enum status_code extint_chan_disable_callback(const uint8_t channel, const enum extint_callback_type type) | /* Disables asynchronous callback generation for a given channel and type.
Disables asynchronous callbacks for a given logical external interrupt channel and type. */
enum status_code extint_chan_disable_callback(const uint8_t channel, const enum extint_callback_type type) | {
if (type == EXTINT_CALLBACK_TYPE_DETECT) {
Eic *const eic = _extint_get_eic_from_channel(channel);
eic->INTENCLR.reg = (1UL << channel);
}
else {
Assert(false);
return STATUS_ERR_INVALID_ARG;
}
return STATUS_OK;
} | memfault/zero-to-main | C++ | null | 200 |
/* Expand the service_set of *fmt into valid service_lines for the std, and clear the passed in fmt->service_set */ | void cx18_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal) | /* Expand the service_set of *fmt into valid service_lines for the std, and clear the passed in fmt->service_set */
void cx18_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal) | {
u16 set = fmt->service_set;
int f, l;
fmt->service_set = 0;
for (f = 0; f < 2; f++) {
for (l = 0; l < 24; l++)
fmt->service_lines[f][l] = select_service_from_set(f, l, set, is_pal);
}
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* avc_audit_post_callback - SELinux specific information will be called by generic audit code @ab: the audit buffer */ | static void avc_audit_post_callback(struct audit_buffer *ab, void *a) | /* avc_audit_post_callback - SELinux specific information will be called by generic audit code @ab: the audit buffer */
static void avc_audit_post_callback(struct audit_buffer *ab, void *a) | {
struct common_audit_data *ad = a;
audit_log_format(ab, " ");
avc_dump_query(ab, ad->selinux_audit_data.ssid,
ad->selinux_audit_data.tsid,
ad->selinux_audit_data.tclass);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* If Sha512Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. */ | BOOLEAN EFIAPI Sha512Final(IN OUT VOID *Sha512Context, OUT UINT8 *HashValue) | /* If Sha512Context is NULL, then return FALSE. If HashValue is NULL, then return FALSE. */
BOOLEAN EFIAPI Sha512Final(IN OUT VOID *Sha512Context, OUT UINT8 *HashValue) | {
INT32 Ret;
if ((Sha512Context == NULL) || (HashValue == NULL)) {
return FALSE;
}
Ret = mbedtls_sha512_finish_ret (Sha512Context, HashValue);
mbedtls_sha512_free (Sha512Context);
if (Ret != 0) {
return FALSE;
}
return TRUE;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Release the SW/FW semaphore used to access the PHY or NVM. The mask will also specify which port we're releasing the lock for. */ | static void igb_release_swfw_sync_82575(struct e1000_hw *, u16) | /* Release the SW/FW semaphore used to access the PHY or NVM. The mask will also specify which port we're releasing the lock for. */
static void igb_release_swfw_sync_82575(struct e1000_hw *, u16) | {
u32 swfw_sync;
while (igb_get_hw_semaphore(hw) != 0);
swfw_sync = rd32(E1000_SW_FW_SYNC);
swfw_sync &= ~mask;
wr32(E1000_SW_FW_SYNC, swfw_sync);
igb_put_hw_semaphore(hw);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* RETURN VALUES: starting bit number of free bits. */ | static int dbFindBits(u32 word, int l2nb) | /* RETURN VALUES: starting bit number of free bits. */
static int dbFindBits(u32 word, int l2nb) | {
int bitno, nb;
u32 mask;
nb = 1 << l2nb;
assert(nb <= DBWORD);
word = ~word;
mask = ONES << (DBWORD - nb);
for (bitno = 0; mask != 0; bitno += nb, mask >>= nb) {
if ((mask & word) == mask)
break;
}
ASSERT(bitno < 32);
return (bitno);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Maintained at www.Open-FCoE.org NPIV VN_Port helper functions for libfc fc_vport_create() - Create a new NPIV vport instance @vport: fc_vport structure from scsi_transport_fc @privsize: driver private data size to allocate along with the Scsi_Host */ | struct fc_lport* libfc_vport_create(struct fc_vport *vport, int privsize) | /* Maintained at www.Open-FCoE.org NPIV VN_Port helper functions for libfc fc_vport_create() - Create a new NPIV vport instance @vport: fc_vport structure from scsi_transport_fc @privsize: driver private data size to allocate along with the Scsi_Host */
struct fc_lport* libfc_vport_create(struct fc_vport *vport, int p... | {
struct Scsi_Host *shost = vport_to_shost(vport);
struct fc_lport *n_port = shost_priv(shost);
struct fc_lport *vn_port;
vn_port = libfc_host_alloc(shost->hostt, privsize);
if (!vn_port)
goto err_out;
if (fc_exch_mgr_list_clone(n_port, vn_port))
goto err_put;
vn_port->vport = vport;
vport->dd_data = vn_por... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The general purpose timer ticks at 1MHz independent if the rest of the system */ | static void sibyte_set_mode(enum clock_event_mode mode, struct clock_event_device *evt) | /* The general purpose timer ticks at 1MHz independent if the rest of the system */
static void sibyte_set_mode(enum clock_event_mode mode, struct clock_event_device *evt) | {
unsigned int cpu = smp_processor_id();
void __iomem *cfg, *init;
cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT));
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
__raw_writeq(0, cfg);
__raw_writeq((V_SCD_TIMER_FREQ / HZ) - 1, init);
__raw_... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Start specified slot in transfer list of a UFS device. */ | EFI_STATUS UfsStartExecCmd(IN UFS_PASS_THRU_PRIVATE_DATA *Private, IN UINT8 Slot) | /* Start specified slot in transfer list of a UFS device. */
EFI_STATUS UfsStartExecCmd(IN UFS_PASS_THRU_PRIVATE_DATA *Private, IN UINT8 Slot) | {
UINT32 Data;
EFI_STATUS Status;
Status = UfsMmioRead32 (Private, UFS_HC_UTRLRSR_OFFSET, &Data);
if (EFI_ERROR (Status)) {
return Status;
}
if ((Data & UFS_HC_UTRLRSR) != UFS_HC_UTRLRSR) {
Status = UfsMmioWrite32 (Private, UFS_HC_UTRLRSR_OFFSET, UFS_HC_UTRLRSR);
if (EFI_ERROR (Status)) {
... | tianocore/edk2 | C++ | Other | 4,240 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.