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 |
|---|---|---|---|---|---|---|---|
/* initialize the system Initialize the psr and vbr. */ | void SystemInit(void) | /* initialize the system Initialize the psr and vbr. */
void SystemInit(void) | {
int i;
uint32_t mxstatus = __get_MXSTATUS();
mxstatus |= (1 << 22);
__set_MXSTATUS(mxstatus);
g_system_clock = IHS_VALUE;
PLIC->PLIC_PER = 0x1;
for (i = 0; i < 32; i++) {
PLIC->PLIC_IP[i] = 0;
}
for (i = 0; i < 1023; i++) {
PLIC->PLIC_H0_MCLAIM = i;
}
for (i... | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* The length of the hash result is dependent on the algorithm that is in use. The following table shows the correct array size for each algorithm: */ | void SHAMD5DataProcess(uint32_t ui32Base, uint32_t *pui32DataSrc, uint32_t ui32DataLength, uint32_t *pui32HashResult) | /* The length of the hash result is dependent on the algorithm that is in use. The following table shows the correct array size for each algorithm: */
void SHAMD5DataProcess(uint32_t ui32Base, uint32_t *pui32DataSrc, uint32_t ui32DataLength, uint32_t *pui32HashResult) | {
ASSERT(ui32Base == SHAMD5_BASE);
ASSERT((ui32DataLength % 64) == 0);
while((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) & SHAMD5_INT_CONTEXT_READY) ==
0)
{
}
SHAMD5HashLengthSet(ui32Base, ui32DataLength);
_SHAMD5DataWriteMultiple(ui32Base, pui32DataSrc, ui32DataLength);
while((HWREG... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Save and restart an expired event. Called by NMI contexts, so it has to be careful about preempting normal event ops: */ | static int intel_pmu_save_and_restart(struct perf_event *event) | /* Save and restart an expired event. Called by NMI contexts, so it has to be careful about preempting normal event ops: */
static int intel_pmu_save_and_restart(struct perf_event *event) | {
struct hw_perf_event *hwc = &event->hw;
int idx = hwc->idx;
int ret;
x86_perf_event_update(event, hwc, idx);
ret = x86_perf_event_set_period(event, hwc, idx);
if (event->state == PERF_EVENT_STATE_ACTIVE)
intel_pmu_enable_event(hwc, idx);
return ret;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Checks whether the specified ETHERNET PTP flag is set or not. */ | FlagStatus ETH_GetPtpFlagStatus(uint32_t ETH_PTP_FLAG) | /* Checks whether the specified ETHERNET PTP flag is set or not. */
FlagStatus ETH_GetPtpFlagStatus(uint32_t ETH_PTP_FLAG) | {
FlagStatus bitstatus = RESET;
assert_param(IS_ETH_PTP_GET_FLAG(ETH_PTP_FLAG));
if ((ETH->PTPTSCTRL & ETH_PTP_FLAG) != (uint32_t)RESET)
{
bitstatus = SET;
}
else
{
bitstatus = RESET;
}
return bitstatus;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Function to transmit a given packet on the wire. Whenever Linux Kernel has a packet ready to be transmitted, this function is called. The function prepares a packet and prepares the descriptor and enables/resumes the transmission. */ | s32 synopGMAC_xmit_frames(synopGMACdevice *gmacdev, u8 *pkt_data, u32 pkt_len, u32 offload_needed, u32 ts) | /* Function to transmit a given packet on the wire. Whenever Linux Kernel has a packet ready to be transmitted, this function is called. The function prepares a packet and prepares the descriptor and enables/resumes the transmission. */
s32 synopGMAC_xmit_frames(synopGMACdevice *gmacdev, u8 *pkt_data, u32 pkt_len, u32... | {
s32 status = 0;
u32 dma_addr = (u32)pkt_data;
status = synopGMAC_set_tx_qptr(gmacdev, dma_addr, pkt_len, dma_addr, offload_needed, ts);
if (status < 0)
{
TR0("%s No More Free Tx Descriptors\n", __FUNCTION__);
return -1;
}
synopGMAC_resume_dma_tx(gmacdev);
return 0;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Get the level-trigger transmission status of the specified SPI port. */ | xtBoolean SPILevelTriggerStatusGet(unsigned long ulBase) | /* Get the level-trigger transmission status of the specified SPI port. */
xtBoolean SPILevelTriggerStatusGet(unsigned long ulBase) | {
xASSERT((ulBase == SPI0_BASE) || (ulBase == SPI1_BASE)||
(ulBase == SPI2_BASE)||(ulBase == SPI3_BASE) );
return ((xHWREG(ulBase + SPI_SSR) & SPI_LTRIG_FLAG) ? xtrue : xfalse);
} | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* Dumps a character a_nb times on a file. */ | void cr_utils_dump_n_chars(guchar a_char, FILE *a_fp, glong a_nb) | /* Dumps a character a_nb times on a file. */
void cr_utils_dump_n_chars(guchar a_char, FILE *a_fp, glong a_nb) | {
glong i = 0;
for (i = 0; i < a_nb; i++) {
fprintf (a_fp, "%c", a_char);
}
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Display a short tutorial for using the 'ai' command in case of mistake. */ | static void aiodio_analog_in_prompt(struct aiodio_dev *dev) | /* Display a short tutorial for using the 'ai' command in case of mistake. */
static void aiodio_analog_in_prompt(struct aiodio_dev *dev) | {
usr_uart_write_string(dev->board_cli->uart_device,
(uint8_t*)"Analog Input command model:\n");
usr_uart_write_string(dev->board_cli->uart_device,
(uint8_t*)"ai x\n");
usr_uart_write_string(dev->board_cli->uart_device,
(uint8_t*)"Where:\n");
usr_uart_write_string(dev->board_cli->uart_dev... | analogdevicesinc/EVAL-ADICUP3029 | C++ | Other | 36 |
/* Handle a buffer overflow error To be improved... */ | static void xmlBufOverflowError(xmlBufPtr buf, const char *extra) | /* Handle a buffer overflow error To be improved... */
static void xmlBufOverflowError(xmlBufPtr buf, const char *extra) | {
__xmlSimpleError(XML_FROM_BUFFER, XML_BUF_OVERFLOW, NULL, NULL, extra);
if ((buf) && (buf->error == 0))
buf->error = XML_BUF_OVERFLOW;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Evaluate a*b/400 rounded to the nearest integer. When, for example, a*b == 200 and the nearest integer is ill-defined, use a table to emulate the following broken float-based implementation used by the binary decoder: */ | static int very_broken_op(int a, int b) | /* Evaluate a*b/400 rounded to the nearest integer. When, for example, a*b == 200 and the nearest integer is ill-defined, use a table to emulate the following broken float-based implementation used by the binary decoder: */
static int very_broken_op(int a, int b) | {
int x = a*b + 200;
int size;
const uint8_t *rtab;
if (x%400 || b%5)
return x/400;
x /= 400;
size = tabs[b/5].size;
rtab = tabs[b/5].tab;
return x - rtab[size*av_log2(2*(x - 1)/size)+(x - 1)%size];
} | DC-SWAT/DreamShell | C++ | null | 404 |
/* param handle codec handle. param channel audio codec play channel, can be a value or combine value of _codec_play_channel. param volume volume value, support 0 ~ 100, 0 is mute, 100 is the maximum volume value. return kStatus_Success is success, else configure failed. */ | status_t HAL_CODEC_SetVolume(void *handle, uint32_t playChannel, uint32_t volume) | /* param handle codec handle. param channel audio codec play channel, can be a value or combine value of _codec_play_channel. param volume volume value, support 0 ~ 100, 0 is mute, 100 is the maximum volume value. return kStatus_Success is success, else configure failed. */
status_t HAL_CODEC_SetVolume(void *handle, u... | {
assert(handle != NULL);
if (playChannel & (kCODEC_PlayChannelHeadphoneLeft | kCODEC_PlayChannelHeadphoneRight))
{
return SGTL_SetVolume((sgtl_handle_t *)((uint32_t)(((codec_handle_t *)handle)->codecDevHandle)), kSGTL_ModuleHP,
volume);
}
if (playChannel & (kCO... | eclipse-threadx/getting-started | C++ | Other | 310 |
/* spu_acquire_saved - lock spu contex and make sure it is in saved state @ctx: spu contex to lock */ | int spu_acquire_saved(struct spu_context *ctx) | /* spu_acquire_saved - lock spu contex and make sure it is in saved state @ctx: spu contex to lock */
int spu_acquire_saved(struct spu_context *ctx) | {
int ret;
spu_context_nospu_trace(spu_acquire_saved__enter, ctx);
ret = spu_acquire(ctx);
if (ret)
return ret;
if (ctx->state != SPU_STATE_SAVED) {
set_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags);
spu_deactivate(ctx);
}
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* The event() function is this driver's Card Services event handler. It will be called by Card Services when an appropriate card status event is received. The config() and release() entry points are used to configure or release a socket, in response to card insertion and ejection events. They are invoked from the even... | static int has_ce2_string(struct pcmcia_device *link) | /* The event() function is this driver's Card Services event handler. It will be called by Card Services when an appropriate card status event is received. The config() and release() entry points are used to configure or release a socket, in response to card insertion and ejection events. They are invoked from the even... | {
if (p_dev->prod_id[2] && strstr(p_dev->prod_id[2], "CE2"))
return 1;
return 0;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* nand_get_default_data_interface - Retrieve NAND data interface for mode 0. This is used as default timing after reset. */ | const struct nand_data_interface* nand_get_default_data_interface(void) | /* nand_get_default_data_interface - Retrieve NAND data interface for mode 0. This is used as default timing after reset. */
const struct nand_data_interface* nand_get_default_data_interface(void) | {
return &onfi_sdr_timings[0];
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Calculate new CCOMPARE value based on s_ccount_{mul,div}.
Adjusts CCOMPARE value so that the interrupt happens at the same time as it would happen without the frequency change. Assumes that the new_frequency = old_frequency * s_ccount_mul / s_ccount_div. */ | static void IRAM_ATTR update_ccompare() | /* Calculate new CCOMPARE value based on s_ccount_{mul,div}.
Adjusts CCOMPARE value so that the interrupt happens at the same time as it would happen without the frequency change. Assumes that the new_frequency = old_frequency * s_ccount_mul / s_ccount_div. */
static void IRAM_ATTR update_ccompare() | {
uint32_t ccount = XTHAL_GET_CCOUNT();
uint32_t ccompare = XTHAL_GET_CCOMPARE(XT_TIMER_INDEX);
if ((ccompare - CCOMPARE_MIN_CYCLES_IN_FUTURE) - ccount < UINT32_MAX / 2) {
uint32_t diff = ccompare - ccount;
uint32_t diff_scaled = (diff * s_ccount_mul + s_ccount_div - 1) / s_ccount_div;
... | retro-esp32/RetroESP32 | C++ | Creative Commons Attribution Share Alike 4.0 International | 581 |
/* Create a handle for this object. This adds a handle reference to the object, which includes a regular reference count. Callers will likely want to dereference the object afterwards. */ | int drm_gem_handle_create(struct drm_file *file_priv, struct drm_gem_object *obj, u32 *handlep) | /* Create a handle for this object. This adds a handle reference to the object, which includes a regular reference count. Callers will likely want to dereference the object afterwards. */
int drm_gem_handle_create(struct drm_file *file_priv, struct drm_gem_object *obj, u32 *handlep) | {
int ret;
again:
if (idr_pre_get(&file_priv->object_idr, GFP_KERNEL) == 0)
return -ENOMEM;
spin_lock(&file_priv->table_lock);
ret = idr_get_new_above(&file_priv->object_idr, obj, 1, (int *)handlep);
spin_unlock(&file_priv->table_lock);
if (ret == -EAGAIN)
goto again;
if (ret != 0)
return ret;
drm_gem_obj... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* ISR handler for a specific vector index in the interrupt vector table for linking the actual interrupts vectors to the one in the user program's vector table. */ | void Vector20_handler(void) | /* ISR handler for a specific vector index in the interrupt vector table for linking the actual interrupts vectors to the one in the user program's vector table. */
void Vector20_handler(void) | {
asm
{
LDX(VCT_USER_PROGRAM_VECTOR_TABLE_STARTADDR + (20 * 2))
JMP 0,X
}
} | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* 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;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Bosch BMP085 barometric sensor driver initialization.
This is the main initialization function for the BMP085 device. */ | bool bmp085_init(sensor_t *sensor, int resvd) | /* Bosch BMP085 barometric sensor driver initialization.
This is the main initialization function for the BMP085 device. */
bool bmp085_init(sensor_t *sensor, int resvd) | {
bool status = false;
sensor_hal_t *const hal = sensor->hal;
if ((BMP085_ID_VAL == sensor_bus_get(hal, BMP_CHIP_ID)) &&
(BMP085_VER_VAL ==
sensor_bus_get(hal, BMP_CHIP_VERSION))) {
status = bmp_get_cal_param(hal);
static const sensor_device_t bmp085_device = {
.func.read = bmp_read,
.func.ioctl ... | memfault/zero-to-main | C++ | null | 200 |
/* PCI IDE controllers use non-standard I/O port decoding, respect it. */ | static void __devinit pci_fixup_ide_bases(struct pci_dev *dev) | /* PCI IDE controllers use non-standard I/O port decoding, respect it. */
static void __devinit pci_fixup_ide_bases(struct pci_dev *dev) | {
struct resource *r;
int i;
if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
return;
for (i = 0; i < PCI_NUM_RESOURCES; i++) {
r = dev->resource + i;
if ((r->start & ~0x80) == 0x374) {
r->start |= 2;
r->end = r->start;
}
}
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Because we only ever have the default environment available we must mark it as invalid. */ | static int env_nowhere_init(void) | /* Because we only ever have the default environment available we must mark it as invalid. */
static int env_nowhere_init(void) | {
gd->env_addr = (ulong)&default_environment[0];
gd->env_valid = ENV_INVALID;
return 0;
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Encode given binary value to a printable ascii value. */ | static uint8_t encode(int value) | /* Encode given binary value to a printable ascii value. */
static uint8_t encode(int value) | {
return ((uint8_t)value + SPACE);
} | eerimoq/simba | C++ | Other | 337 |
/* Parse a netlink message and add it to the cache. */ | int nl_cache_parse_and_add(struct nl_cache *cache, struct nl_msg *msg) | /* Parse a netlink message and add it to the cache. */
int nl_cache_parse_and_add(struct nl_cache *cache, struct nl_msg *msg) | {
struct nl_parser_param p = {
.pp_cb = pickup_cb,
.pp_arg = cache,
};
return nl_cache_parse(cache->c_ops, NULL, nlmsg_hdr(msg), &p);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Normally the management layer sets the task to aborted state, and then calls query task and then abort task. */ | int asd_query_task(struct sas_task *task) | /* Normally the management layer sets the task to aborted state, and then calls query task and then abort task. */
int asd_query_task(struct sas_task *task) | {
struct asd_ascb *ascb = task->lldd_task;
int index;
if (ascb) {
index = ascb->tc_index;
return asd_initiate_ssp_tmf(task->dev, task->ssp_task.LUN,
TMF_QUERY_TASK, index);
}
return TMF_RESP_FUNC_COMPLETE;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Compare the address 1 and port 1 in the two conversation keys. We don't check both directions of the conversation - the routine doing the hash lookup has to do two searches, as the hash key will be different for the two directions. */ | static gint conversation_match_no_addr2_or_port2(gconstpointer v, gconstpointer w) | /* Compare the address 1 and port 1 in the two conversation keys. We don't check both directions of the conversation - the routine doing the hash lookup has to do two searches, as the hash key will be different for the two directions. */
static gint conversation_match_no_addr2_or_port2(gconstpointer v, gconstpointer w... | {
const conversation_key *v1 = (const conversation_key *)v;
const conversation_key *v2 = (const conversation_key *)w;
if (v1->ptype != v2->ptype)
return 0;
if (v1->port1 == v2->port1 &&
addresses_equal(&v1->addr1, &v2->addr1)) {
return 1;
}
return 0;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* 0x000000-0x0a0000 Useable RAM 0x0a0000-0x100000 Reserved for ISA 0x100000-gd->ram_size Useable RAM CONFIG_PCIE_ECAM_BASE PCIe ECAM */ | __weak unsigned int install_e820_map(unsigned int max_entries, struct e820_entry *entries) | /* 0x000000-0x0a0000 Useable RAM 0x0a0000-0x100000 Reserved for ISA 0x100000-gd->ram_size Useable RAM CONFIG_PCIE_ECAM_BASE PCIe ECAM */
__weak unsigned int install_e820_map(unsigned int max_entries, struct e820_entry *entries) | {
entries[0].addr = 0;
entries[0].size = ISA_START_ADDRESS;
entries[0].type = E820_RAM;
entries[1].addr = ISA_START_ADDRESS;
entries[1].size = ISA_END_ADDRESS - ISA_START_ADDRESS;
entries[1].type = E820_RESERVED;
entries[2].addr = ISA_END_ADDRESS;
entries[2].size = gd->ram_size - ISA_END_ADDRESS;
entries[2].ty... | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* this function handles USART wakeup from deepsleep interrupt request */ | void USART0_IRQHandler(void) | /* this function handles USART wakeup from deepsleep interrupt request */
void USART0_IRQHandler(void) | {
if (SET == usart_interrupt_flag_get(EVAL_COM1, USART_STAT_WUF,USART_INT_WUIE)){
usart_flag_clear(EVAL_COM1, USART_INC_WUC);
counter0 = 0x01;
}
} | liuxuming/trochili | C++ | Apache License 2.0 | 132 |
/* Function to reset the GMAC core. This reests the DMA and GMAC core. After reset all the registers holds their respective reset value */ | s32 synopGMAC_reset(synopGMACdevice *gmacdev) | /* Function to reset the GMAC core. This reests the DMA and GMAC core. After reset all the registers holds their respective reset value */
s32 synopGMAC_reset(synopGMACdevice *gmacdev) | {
u32 data = 0;
synopGMACWriteReg(gmacdev->DmaBase, DmaBusMode, DmaResetOn);
plat_delay(DEFAULT_LOOP_VARIABLE);
do
{
data = synopGMACReadReg(gmacdev->DmaBase, DmaBusMode);
}
while (data & 1);
TR("DATA after Reset = %08x\n", data);
return 0;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Write a hexadecimal number on lower alphanumeric part of Segment LCD display. */ | void SegmentLCD_LowerHex(uint32_t num) | /* Write a hexadecimal number on lower alphanumeric part of Segment LCD display. */
void SegmentLCD_LowerHex(uint32_t num) | {
int i;
char str[7];
uint32_t nibble;
SegmentLCD_Symbol(LCD_SYMBOL_MINUS, 0);
for ( i=6; i>=0; i-- )
{
nibble = num & 0xF;
if ( nibble < 10 )
str[i] = nibble + '0';
else if ( nibble == 11 )
str[i] = 'b';
else if ( nibble == 13 )
str[i] = 'd';
else
str... | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* MTBSF: Backward space over 'count' file marks. The tape is positioned at the EOT (End of Tape) side of the last skipped file mark. */ | int tape_std_mtbsf(struct tape_device *device, int mt_count) | /* MTBSF: Backward space over 'count' file marks. The tape is positioned at the EOT (End of Tape) side of the last skipped file mark. */
int tape_std_mtbsf(struct tape_device *device, int mt_count) | {
struct tape_request *request;
struct ccw1 *ccw;
int rc;
request = tape_alloc_request(mt_count + 2, 0);
if (IS_ERR(request))
return PTR_ERR(request);
request->op = TO_BSF;
ccw = tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1,
device->modeset_byte);
ccw = tape_ccw_repeat(ccw, BACKSPACEFILE, mt_count);
ccw ... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | */ | static void dissect_pmip6_opt_ts(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset, guint optlen _U_, packet_info *pinfo _U_, proto_tree *opt_tree, proto_item *hdr_item _U_) | /* 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | */
static void dissect_pmip6_opt_ts(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset, guint optlen _U_, packet_info *pin... | {
const gchar *str;
offset++;
proto_tree_add_item(opt_tree, hf_mip6_opt_len, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
str = tvb_mip6_fmt_ts(tvb,offset);
proto_tree_add_string(opt_tree, hf_pmip6_timestamp, tvb, offset, 8, str);
proto_item_append_text(hdr_item, ": %s", str);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Remove any previously-set unicast MAC filter. Add secondary FCoE MAC address filter for our OUI. */ | static void fcoe_update_src_mac(struct fc_lport *, u8 *) | /* Remove any previously-set unicast MAC filter. Add secondary FCoE MAC address filter for our OUI. */
static void fcoe_update_src_mac(struct fc_lport *, u8 *) | {
struct fcoe_port *port = lport_priv(lport);
struct fcoe_interface *fcoe = port->fcoe;
rtnl_lock();
if (!is_zero_ether_addr(port->data_src_addr))
dev_unicast_delete(fcoe->netdev, port->data_src_addr);
if (!is_zero_ether_addr(addr))
dev_unicast_add(fcoe->netdev, addr);
memcpy(port->data_src_addr, addr, ETH_AL... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Check constraints on flags passed to the unshare system call and force unsharing of additional process context as appropriate. */ | static void check_unshare_flags(unsigned long *flags_ptr) | /* Check constraints on flags passed to the unshare system call and force unsharing of additional process context as appropriate. */
static void check_unshare_flags(unsigned long *flags_ptr) | {
if (*flags_ptr & CLONE_THREAD)
*flags_ptr |= CLONE_VM;
if (*flags_ptr & CLONE_VM)
*flags_ptr |= CLONE_SIGHAND;
if ((*flags_ptr & CLONE_SIGHAND) &&
(atomic_read(¤t->signal->count) > 1))
*flags_ptr |= CLONE_THREAD;
if (*flags_ptr & CLONE_NEWNS)
*flags_ptr |= CLONE_FS;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* brief DMA instance 1, channel 7 IRQ handler. */ | void EDMA_1_CH7_DriverIRQHandler(void) | /* brief DMA instance 1, channel 7 IRQ handler. */
void EDMA_1_CH7_DriverIRQHandler(void) | {
EDMA_DriverIRQHandler(1U, 7U);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* xfs_filestream_mount() is called when a file system is mounted with the filestream option. It is responsible for allocating the data structures needed to track the new file system's file streams. */ | int xfs_filestream_mount(xfs_mount_t *mp) | /* xfs_filestream_mount() is called when a file system is mounted with the filestream option. It is responsible for allocating the data structures needed to track the new file system's file streams. */
int xfs_filestream_mount(xfs_mount_t *mp) | {
int err;
unsigned int lifetime, grp_count;
lifetime = xfs_fstrm_centisecs * 10;
grp_count = 10;
err = xfs_mru_cache_create(&mp->m_filestream, lifetime, grp_count,
xfs_fstrm_free_func);
return err;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Initiates pressure measurement on the barometric pressure sensor and reads pressure from it. */ | uint32_t BMP_getPressure(float *pressure) | /* Initiates pressure measurement on the barometric pressure sensor and reads pressure from it. */
uint32_t BMP_getPressure(float *pressure) | {
int8_t result;
int32_t uncompTemp;
int32_t uncompPressure;
uint32_t compPressure;
if( bmp280PowerMode == BMP280_NORMAL_MODE ) {
result = bmp280_read_uncomp_pressure( &uncompPressure );
if( result == SUCCESS ){
result = bmp280_read_uncomp_temperature( &uncompTemp );
}
}
... | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* param base ACMP peripheral base address. param enable True to enable window mode. */ | void ACMP_EnableWindowMode(CMP_Type *base, bool enable) | /* param base ACMP peripheral base address. param enable True to enable window mode. */
void ACMP_EnableWindowMode(CMP_Type *base, bool enable) | {
if (enable)
{
base->C0 = ((base->C0 | CMP_C0_WE_MASK) & ~CMP_C0_CFx_MASK);
}
else
{
base->C0 &= ~(CMP_C0_WE_MASK | CMP_C0_CFx_MASK);
}
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* LEB properties are categorized to enable fast find operations. When the LEB properties change they must be re-categorized. */ | static void change_category(struct ubifs_info *c, struct ubifs_lprops *lprops) | /* LEB properties are categorized to enable fast find operations. When the LEB properties change they must be re-categorized. */
static void change_category(struct ubifs_info *c, struct ubifs_lprops *lprops) | {
int old_cat = lprops->flags & LPROPS_CAT_MASK;
int new_cat = ubifs_categorize_lprops(c, lprops);
if (old_cat == new_cat) {
struct ubifs_lpt_heap *heap;
if (new_cat < 1 || new_cat > LPROPS_HEAP_CNT)
return;
heap = &c->lpt_heap[new_cat - 1];
adjust_lpt_heap(c, heap, lprops, lprops->hpos, new_cat);
} else... | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* The LCD is written two by more than one task so is controlled by a 'gatekeeper' task. This is the only task that is actually permitted to access the LCD directly. Other tasks wanting to display a message send the message to the gatekeeper. */ | void vLCDTask(void *pvParameters) | /* The LCD is written two by more than one task so is controlled by a 'gatekeeper' task. This is the only task that is actually permitted to access the LCD directly. Other tasks wanting to display a message send the message to the gatekeeper. */
void vLCDTask(void *pvParameters) | {
xLCDMessage xMessage;
LCD_init();
LCD_cur_off();
LCD_cls();
LCD_gotoxy( 1, 1 );
LCD_puts( ( signed char * ) "www.FreeRTOS.org" );
for( ;; )
{
while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );
LCD_cls();
LCD_gotoxy( ( xMessage.xColumn & 0x07 ) + 1, ( xMessage.xColumn & ... | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Enables or disables the peripheral Preload register on CCM2. */ | void TMR_ConfigOC2Preload(TMR_T *tmr, TMR_OC_PRELOAD_T OCPreload) | /* Enables or disables the peripheral Preload register on CCM2. */
void TMR_ConfigOC2Preload(TMR_T *tmr, TMR_OC_PRELOAD_T OCPreload) | {
tmr->CCM1_COMPARE_B.OC2PEN = OCPreload;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Get the actual frequency of QSPI bus clock. Only available in Master mode. */ | uint32_t QSPI_GetBusClock(QSPI_T *qspi) | /* Get the actual frequency of QSPI bus clock. Only available in Master mode. */
uint32_t QSPI_GetBusClock(QSPI_T *qspi) | {
uint32_t u32Div;
uint32_t u32ClkSrcFreq;
u32ClkSrcFreq = QSPI_GetSrcClkSetting(qspi);
u32Div = (qspi->CLKDIV & QSPI_CLKDIV_DIVIDER_Msk) >> QSPI_CLKDIV_DIVIDER_Pos;
return (u32ClkSrcFreq / (u32Div + 1U));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* On auxiliary interface connect/disconnect SDO and OCS internal pull-up.. */ | int32_t lsm6dso_aux_sdo_ocs_mode_get(lsm6dso_ctx_t *ctx, lsm6dso_ois_pu_dis_t *val) | /* On auxiliary interface connect/disconnect SDO and OCS internal pull-up.. */
int32_t lsm6dso_aux_sdo_ocs_mode_get(lsm6dso_ctx_t *ctx, lsm6dso_ois_pu_dis_t *val) | {
lsm6dso_pin_ctrl_t reg;
int32_t ret;
ret = lsm6dso_read_reg(ctx, LSM6DSO_PIN_CTRL, (uint8_t*)®, 1);
switch (reg.ois_pu_dis) {
case LSM6DSO_AUX_PULL_UP_DISC:
*val = LSM6DSO_AUX_PULL_UP_DISC;
break;
case LSM6DSO_AUX_PULL_UP_CONNECT:
*val = LSM6DSO_AUX_PULL_UP_CONNECT;
break;
... | alexander-g-dean/ESF | C++ | null | 41 |
/* Checks if itm is busy and provides a delay to flush the fifo.
This function disables the ARM ITM by resetting the TRCENA bit in the DEMCR register. */ | void am_hal_itm_not_busy(void) | /* Checks if itm is busy and provides a delay to flush the fifo.
This function disables the ARM ITM by resetting the TRCENA bit in the DEMCR register. */
void am_hal_itm_not_busy(void) | {
while (AM_REG(ITM, TCR) & AM_REG_ITM_TCR_BUSY(1));
am_hal_flash_delay(FLASH_CYCLES_US(50));
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* init the GPIO port of the SLCD and SLCD peripheral */ | void slcd_seg_config(void) | /* init the GPIO port of the SLCD and SLCD peripheral */
void slcd_seg_config(void) | {
uint16_t i;
slcd_gpio_config();
rcu_periph_clock_enable(RCU_SLCD);
for(i = 0;i < 500;i++);
slcd_clock_config(SLCD_PRESCALER_4,SLCD_DIVIDER_19);
slcd_bias_voltage_select(SLCD_BIAS_1_3);
slcd_duty_select(SLCD_DUTY_1_4);
slcd_voltage_source_select(SLCD_VOLTAGE_EXTERNAL);
slcd_pulse_on... | liuxuming/trochili | C++ | Apache License 2.0 | 132 |
/* We need a wrapper for zunzip() because the parameters are incompatible with the lzo decompressor. */ | static int gzip_decompress(const unsigned char *in, size_t in_len, unsigned char *out, size_t *out_len) | /* We need a wrapper for zunzip() because the parameters are incompatible with the lzo decompressor. */
static int gzip_decompress(const unsigned char *in, size_t in_len, unsigned char *out, size_t *out_len) | {
return zunzip(out, *out_len, (unsigned char *)in,
(unsigned long *)out_len, 0, 0);
} | 4ms/stm32mp1-baremetal | C++ | Other | 137 |
/* Receive a sequence of bytes from a SPI device.
All bytes sent out on SPI bus are sent as value 0. */ | status_code_t spi_read_packet(SPI_t *spi, uint8_t *data, size_t len) | /* Receive a sequence of bytes from a SPI device.
All bytes sent out on SPI bus are sent as value 0. */
status_code_t spi_read_packet(SPI_t *spi, uint8_t *data, size_t len) | {
while (len--) {
spi_write_single(spi,CONFIG_SPI_MASTER_DUMMY);
while (!spi_is_rx_full(spi)) {
}
spi_read_single(spi, data);
data++;
}
return STATUS_OK;
} | memfault/zero-to-main | C++ | null | 200 |
/* Returns positive length of the socket name string, or a negative errno value on error. */ | int svc_sock_names(struct svc_serv *serv, char *buf, const size_t buflen, const char *toclose) | /* Returns positive length of the socket name string, or a negative errno value on error. */
int svc_sock_names(struct svc_serv *serv, char *buf, const size_t buflen, const char *toclose) | {
struct svc_sock *svsk, *closesk = NULL;
int len = 0;
if (!serv)
return 0;
spin_lock_bh(&serv->sv_lock);
list_for_each_entry(svsk, &serv->sv_permsocks, sk_xprt.xpt_list) {
int onelen = svc_one_sock_name(svsk, buf + len, buflen - len);
if (onelen < 0) {
len = onelen;
break;
}
if (toclose && strcmp(... | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* This routine is called to set the configuration value Then each class should configure device itself. */ | USB_Result Standard_SetConfiguration(void) | /* This routine is called to set the configuration value Then each class should configure device itself. */
USB_Result Standard_SetConfiguration(void) | {
if ((pInformation->USBwValue0 <= Device_Table.TotalConfiguration) && (pInformation->USBwValue1 == 0)
&& (pInformation->USBwIndex == 0))
{
pInformation->CurrentConfiguration = pInformation->USBwValue0;
pUser_Standard_Requests->User_SetConfiguration();
return Success;
}
e... | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Enable or disable DMA Tx descriptor add CRC. */ | int32_t ETH_DMA_TxDescCrcCmd(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewState) | /* Enable or disable DMA Tx descriptor add CRC. */
int32_t ETH_DMA_TxDescCrcCmd(stc_eth_dma_desc_t *pstcTxDesc, en_functional_state_t enNewState) | {
int32_t i32Ret = LL_OK;
if (NULL == pstcTxDesc) {
i32Ret = LL_ERR_INVD_PARAM;
} else {
DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState));
if (DISABLE != enNewState) {
CLR_REG32_BIT(pstcTxDesc->u32ControlStatus, ETH_DMA_TXDESC_DCRC);
} else {
SET_REG32_BIT(... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Starts a timer.
This function starts a preconfigured timer */ | int tmrHw_startTimer(tmrHw_ID_t timerId) | /* Starts a timer.
This function starts a preconfigured timer */
int tmrHw_startTimer(tmrHw_ID_t timerId) | {
pTmrHw[timerId].Control |= tmrHw_CONTROL_TIMER_ENABLE;
return 0;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Enables the PWM dead band output and sets the dead band delays. */ | void PWMDeadBandEnable(uint32_t ui32Base, uint32_t ui32Gen, uint16_t ui16Rise, uint16_t ui16Fall) | /* Enables the PWM dead band output and sets the dead band delays. */
void PWMDeadBandEnable(uint32_t ui32Base, uint32_t ui32Gen, uint16_t ui16Rise, uint16_t ui16Fall) | {
ASSERT((ui32Base == PWM0_BASE) || (ui32Base == PWM1_BASE));
ASSERT(_PWMGenValid(ui32Gen));
ASSERT(ui16Rise < 4096);
ASSERT(ui16Fall < 4096);
ui32Gen = PWM_GEN_BADDR(ui32Base, ui32Gen);
HWREG(ui32Gen + PWM_O_X_DBRISE) = ui16Rise;
HWREG(ui32Gen + PWM_O_X_DBFALL) = ui16Fall;
HWREG(ui32Gen... | feaser/openblt | C++ | GNU General Public License v3.0 | 601 |
/* Resume the specified DMA Channel transfer (restoring its context). */ | void dmac_channel_resume(Dmac *p_dmac, uint32_t ul_num) | /* Resume the specified DMA Channel transfer (restoring its context). */
void dmac_channel_resume(Dmac *p_dmac, uint32_t ul_num) | {
Assert(p_dmac);
Assert(ul_num<=3);
p_dmac->DMAC_CHDR = DMAC_CHDR_RES0 << ul_num;
} | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* read the head block of the log and check the header */ | STATIC int xlog_header_check_mount(xfs_mount_t *mp, xlog_rec_header_t *head) | /* read the head block of the log and check the header */
STATIC int xlog_header_check_mount(xfs_mount_t *mp, xlog_rec_header_t *head) | {
ASSERT(be32_to_cpu(head->h_magicno) == XLOG_HEADER_MAGIC_NUM);
if (uuid_is_nil(&head->h_fs_uuid)) {
xlog_warn("XFS: nil uuid in log - IRIX style log");
} else if (unlikely(!uuid_equal(&mp->m_sb.sb_uuid, &head->h_fs_uuid))) {
xlog_warn("XFS: log has mismatched uuid - can't recover");
xlog_header_check_dump(mp... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Disable the memory bus request/grant signals on the SA1110 to ensure that we don't receive spurious memory requests. We set the MBGNT signal false to ensure the SA1111 doesn't own the SDRAM bus. */ | void __init sa1110_mb_disable(void) | /* Disable the memory bus request/grant signals on the SA1110 to ensure that we don't receive spurious memory requests. We set the MBGNT signal false to ensure the SA1111 doesn't own the SDRAM bus. */
void __init sa1110_mb_disable(void) | {
unsigned long flags;
local_irq_save(flags);
PGSR &= ~GPIO_MBGNT;
GPCR = GPIO_MBGNT;
GPDR = (GPDR & ~GPIO_MBREQ) | GPIO_MBGNT;
GAFR &= ~(GPIO_MBGNT | GPIO_MBREQ);
local_irq_restore(flags);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* __vxge_hw_blockpool_block_allocate - Allocates a block from block pool This function allocates a block from block pool or from the system */ | struct __vxge_hw_blockpool_entry* __vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *devh, u32 size) | /* __vxge_hw_blockpool_block_allocate - Allocates a block from block pool This function allocates a block from block pool or from the system */
struct __vxge_hw_blockpool_entry* __vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *devh, u32 size) | {
struct __vxge_hw_blockpool_entry *entry = NULL;
struct __vxge_hw_blockpool *blockpool;
blockpool = &devh->block_pool;
if (size == blockpool->block_size) {
if (!list_empty(&blockpool->free_block_list))
entry = (struct __vxge_hw_blockpool_entry *)
list_first_entry(&blockpool->free_block_list,
struct ... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Note that this will interrupt immediately if the interrupt is not masked and IRQs are not locked, and this interrupt has higher priority than a possibly currently running interrupt */ | void posix_sw_set_pending_IRQ(unsigned int IRQn) | /* Note that this will interrupt immediately if the interrupt is not masked and IRQs are not locked, and this interrupt has higher priority than a possibly currently running interrupt */
void posix_sw_set_pending_IRQ(unsigned int IRQn) | {
hw_irq_ctrl_raise_im_from_sw(CONFIG_NATIVE_SIMULATOR_MCU_N, IRQn);
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* buffer_icap_device_write - Transfer bytes from ICAP to the storage buffer. @drvdata: a pointer to the drvdata. @offset: The storage buffer start address. @count: The number of words (32 bit) to read from the device (ICAP). */ | static int buffer_icap_device_write(struct hwicap_drvdata *drvdata, u32 offset, u32 count) | /* buffer_icap_device_write - Transfer bytes from ICAP to the storage buffer. @drvdata: a pointer to the drvdata. @offset: The storage buffer start address. @count: The number of words (32 bit) to read from the device (ICAP). */
static int buffer_icap_device_write(struct hwicap_drvdata *drvdata, u32 offset, u32 count) | {
s32 retries = 0;
void __iomem *base_address = drvdata->base_address;
if (buffer_icap_busy(base_address))
return -EBUSY;
if ((offset + count) > XHI_MAX_BUFFER_INTS)
return -EINVAL;
buffer_icap_set_size(base_address, count << 2);
buffer_icap_set_offset(base_address, offset);
buffer_icap_set_rnc(base_address,... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* This routine treats TX interrupt. o if need call line discipline wakeup o call wake_up_interruptible */ | static void cpc_tty_tx_work(struct work_struct *work) | /* This routine treats TX interrupt. o if need call line discipline wakeup o call wake_up_interruptible */
static void cpc_tty_tx_work(struct work_struct *work) | {
st_cpc_tty_area *cpc_tty =
container_of(work, st_cpc_tty_area, tty_tx_work);
struct tty_struct *tty;
CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name);
if ((tty = cpc_tty->tty) == NULL) {
CPC_TTY_DBG("%s: the interface is not opened\n",cpc_tty->name);
return;
}
tty_wakeup(tty);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Gets the color ramps on behalf of fbcon */ | void radeon_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue, int regno) | /* Gets the color ramps on behalf of fbcon */
void radeon_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue, int regno) | {
struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
*red = radeon_crtc->lut_r[regno] << 6;
*green = radeon_crtc->lut_g[regno] << 6;
*blue = radeon_crtc->lut_b[regno] << 6;
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Obtain the mutex p. If some other thread already has the mutex, block until it can be obtained. */ | SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex *) | /* Obtain the mutex p. If some other thread already has the mutex, block until it can be obtained. */
SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex *) | {
if( p ){
sqlite3GlobalConfig.mutex.xMutexEnter(p);
}
} | DC-SWAT/DreamShell | C++ | null | 404 |
/* Called by the network layer to transmit the @skb. spin_lock_irqsave is required because tx and rx should be mutual exclusive. So while tx is in-progress, prevent IRQ interrupt from happenning. */ | static int ks_start_xmit(struct sk_buff *skb, struct net_device *netdev) | /* Called by the network layer to transmit the @skb. spin_lock_irqsave is required because tx and rx should be mutual exclusive. So while tx is in-progress, prevent IRQ interrupt from happenning. */
static int ks_start_xmit(struct sk_buff *skb, struct net_device *netdev) | {
int retv = NETDEV_TX_OK;
struct ks_net *ks = netdev_priv(netdev);
disable_irq(netdev->irq);
ks_disable_int(ks);
spin_lock(&ks->statelock);
if (likely(ks_tx_fifo_space(ks) >= skb->len + 12)) {
ks_write_qmu(ks, skb->data, skb->len);
dev_kfree_skb(skb);
} else
retv = NETDEV_TX_BUSY;
spin_unlock(&ks->statel... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* If any reserved bits in Address are set, then ASSERT(). If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). If OrData is larger th... | UINT16 EFIAPI S3PciSegmentBitFieldAndThenOr16(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData, IN UINT16 OrData) | /* If any reserved bits in Address are set, then ASSERT(). If StartBit is greater than 15, then ASSERT(). If EndBit is greater than 15, then ASSERT(). If EndBit is less than StartBit, then ASSERT(). If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). If OrData is larger th... | {
return InternalSavePciSegmentWrite16ValueToBootScript (Address, PciSegmentBitFieldAndThenOr16 (Address, StartBit, EndBit, AndData, OrData));
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Enable reverse output data.
Enables the reversal of the bit order of the output data. */ | void crc_reverse_output_enable() | /* Enable reverse output data.
Enables the reversal of the bit order of the output data. */
void crc_reverse_output_enable() | {
CRC_CR |= CRC_CR_REV_OUT;
} | libopencm3/libopencm3 | C++ | GNU General Public License v3.0 | 2,931 |
/* Forces the output 2 waveform to active or inactive level. */ | void TMR_ConfigForcedOC2(TMR_T *tmr, TMR_FORCED_ACTION_T forcesAction) | /* Forces the output 2 waveform to active or inactive level. */
void TMR_ConfigForcedOC2(TMR_T *tmr, TMR_FORCED_ACTION_T forcesAction) | {
tmr->CCM1_COMPARE_B.OC2MOD = forcesAction;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Sets the Smart Card number of retries in transmit and receive. */ | void USART_SetAutoRetryCount(USART_TypeDef *USARTx, uint8_t USART_AutoCount) | /* Sets the Smart Card number of retries in transmit and receive. */
void USART_SetAutoRetryCount(USART_TypeDef *USARTx, uint8_t USART_AutoCount) | {
assert_param(IS_USART_123_PERIPH(USARTx));
assert_param(IS_USART_AUTO_RETRY_COUNTER(USART_AutoCount));
USARTx->CR3 &= (uint32_t)~((uint32_t)USART_CR3_SCARCNT);
USARTx->CR3 |= (uint32_t)((uint32_t)USART_AutoCount << 0x11);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* The function number selects which function of a multi-function device (e.g., SCSI and Ethernet). */ | static unsigned long build_conf_addr(struct pci_controller *hose, u8 bus, unsigned int devfn, int where) | /* The function number selects which function of a multi-function device (e.g., SCSI and Ethernet). */
static unsigned long build_conf_addr(struct pci_controller *hose, u8 bus, unsigned int devfn, int where) | {
return (hose->config_space_base | (bus << 16) | (devfn << 8) | where);
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* find the continue 0xFF flash address to end address */ | uint32_t _fdb_continue_ff_addr(fdb_db_t db, uint32_t start, uint32_t end) | /* find the continue 0xFF flash address to end address */
uint32_t _fdb_continue_ff_addr(fdb_db_t db, uint32_t start, uint32_t end) | {
if (start + sizeof(buf) < end) {
read_size = sizeof(buf);
} else {
read_size = end - start;
}
_fdb_flash_read(db, start, (uint32_t*)buf, read_size);
for (i = 0; i < read_size; i++) {
if (last_data != FDB_BYTE_ERASED && buf[i] == FDB_BYTE_ERAS... | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* Send a zero probe segment. It can be used by keepalive and zero window probe. */ | INTN TcpSendZeroProbe(IN OUT TCP_CB *Tcb) | /* Send a zero probe segment. It can be used by keepalive and zero window probe. */
INTN TcpSendZeroProbe(IN OUT TCP_CB *Tcb) | {
NET_BUF *Nbuf;
TCP_SEG *Seg;
INTN Result;
Nbuf = NetbufAlloc (TCP_MAX_HEAD);
if (Nbuf == NULL) {
return -1;
}
NetbufReserve (Nbuf, TCP_MAX_HEAD);
Seg = TCPSEG_NETBUF (Nbuf);
Seg->Seq = Tcb->SndNxt - 1;
Seg->End = Tcb->SndNxt - 1;
Seg->Flag = TCP_FLG_ACK;
Result = TcpTransmitS... | tianocore/edk2 | C++ | Other | 4,240 |
/* Apply padding to the last block, currently in ctx->buf (with ctx->ptr bytes), and finalize OMAC computation. */ | static void do_pad(br_eax_context *ctx) | /* Apply padding to the last block, currently in ctx->buf (with ctx->ptr bytes), and finalize OMAC computation. */
static void do_pad(br_eax_context *ctx) | {
unsigned char *pad;
size_t ptr, u;
ptr = ctx->ptr;
if (ptr == 16) {
pad = ctx->L2;
} else {
ctx->buf[ptr ++] = 0x80;
memset(ctx->buf + ptr, 0x00, 16 - ptr);
pad = ctx->L4;
}
for (u = 0; u < sizeof ctx->buf; u ++) {
ctx->buf[u] ^= pad[u];
}
(*ctx->bctx)->mac(ctx->bctx, ctx->cbcmac, ctx->buf, sizeof ... | arendst/Tasmota | C++ | GNU General Public License v3.0 | 21,318 |
/* Clear the overflow condition on the ADC sample sequence. */ | void xADCOverflowClear(unsigned long ulBase) | /* Clear the overflow condition on the ADC sample sequence. */
void xADCOverflowClear(unsigned long ulBase) | {
unsigned long i;
unsigned long ulOverRunChannels;
volatile unsigned long ulDump;
xASSERT(ulBase == ADC_BASE);
ulOverRunChannels = (xHWREG(ulBase + ADC_SR) & ADC_SR_OVERRUN_M) >>
ADC_SR_OVERRUN_S;
for(i = 0; i < 8; i++)
{
if(ulOverRunChannels & (1 << i))
... | coocox/cox | C++ | Berkeley Software Distribution (BSD) | 104 |
/* If a host does all the power sequencing itself, ignore the initial MMC_POWER_UP stage. */ | static void mmc_power_up(struct mmc_host *host) | /* If a host does all the power sequencing itself, ignore the initial MMC_POWER_UP stage. */
static void mmc_power_up(struct mmc_host *host) | {
mmc_host_clk_hold(host);
mmc_mdelay(40);
mmc_mdelay(5);
HAL_SDC_PowerOn(host);
mmc_host_clk_release(host);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* If the label Label is already exists in the boot script table, then no new label is created, the position of the Label is returned in *Position and EFI_SUCCESS is returned. If the label Label does not already exist and CreateIfNotFound is TRUE, then it will be created before or after the specified position and EFI_S... | EFI_STATUS EFIAPI BootScriptLabel(IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This, IN BOOLEAN BeforeOrAfter, IN BOOLEAN CreateIfNotFound, IN OUT EFI_S3_BOOT_SCRIPT_POSITION *Position OPTIONAL, IN CONST CHAR8 *Label) | /* If the label Label is already exists in the boot script table, then no new label is created, the position of the Label is returned in *Position and EFI_SUCCESS is returned. If the label Label does not already exist and CreateIfNotFound is TRUE, then it will be created before or after the specified position and EFI_S... | {
return S3BootScriptLabel (BeforeOrAfter, CreateIfNotFound, (VOID **)Position, Label);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* brief Enable USB FS clock. Enable USB Full Speed clock. */ | bool CLOCK_EnableUsbfsClock(void) | /* brief Enable USB FS clock. Enable USB Full Speed clock. */
bool CLOCK_EnableUsbfsClock(void) | {
SYSCON->USB0CLKSEL = 0x3U;
CLOCK_SetClkDiv(kCLOCK_DivUsb0Clk, 1);
SYSCON->USB0CLKDIV &= (uint32_t) ~(SYSCON_USB0CLKDIV_HALT_MASK | SYSCON_USB0CLKDIV_RESET_MASK);
while ((SYSCON->USB0CLKDIV & SYSCON_SYSTICKCLKDIV_UNSTAB_MASK) != 0U)
{
}
return true;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | */ | static void dissect_pmip6_opt_mnlli(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset, guint optlen _U_, packet_info *pinfo _U_, proto_tree *opt_tree, proto_item *hdr_item _U_) | /* 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Length | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | */
static void dissect_pmip6_opt_mnlli(const mip6_opt *optp _U_, tvbuff_t *tvb, ... | {
offset++;
proto_tree_add_item(opt_tree, hf_mip6_opt_len, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_item(opt_tree, hf_mip6_opt_mnlli_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(opt_tree, hf_mip6_opt_mnlli_lli, tvb, offset, optlen-2-2, ENC_NA);
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* Request a local-reset. The some register (e.g for node configuration) can only be modified if RESET=1. Bit RESET forces several components to a reset state, see the reference manual for details. */ | void CAN_EnterLocalReset(CM_CAN_TypeDef *CANx) | /* Request a local-reset. The some register (e.g for node configuration) can only be modified if RESET=1. Bit RESET forces several components to a reset state, see the reference manual for details. */
void CAN_EnterLocalReset(CM_CAN_TypeDef *CANx) | {
DDL_ASSERT(IS_CAN_UNIT(CANx));
SET_REG8_BIT(CANx->CFG_STAT, CAN_CFG_STAT_RESET);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Called from parser to check if question matches particular service. */ | static bool _mdns_question_matches(mdns_parsed_question_t *question, uint16_t type, mdns_srv_item_t *service) | /* Called from parser to check if question matches particular service. */
static bool _mdns_question_matches(mdns_parsed_question_t *question, uint16_t type, mdns_srv_item_t *service) | {
if (question->type != type) {
return false;
}
if (type == MDNS_TYPE_A || type == MDNS_TYPE_AAAA) {
return true;
} else if (type == MDNS_TYPE_PTR || type == MDNS_TYPE_SDPTR) {
if (!strcasecmp(service->service->service, question->service)
&& !strcasecmp(service->servi... | retro-esp32/RetroESP32 | C++ | Creative Commons Attribution Share Alike 4.0 International | 581 |
/* Configure the RTC Alarm Subseconds value and mask. */ | ErrorStatus RTC_AlarmSubSecondConfig(uint16_t RTC_AlarmSubSecondValue, RTC_AlarmSubSecondMask_TypeDef RTC_AlarmSubSecondMask) | /* Configure the RTC Alarm Subseconds value and mask. */
ErrorStatus RTC_AlarmSubSecondConfig(uint16_t RTC_AlarmSubSecondValue, RTC_AlarmSubSecondMask_TypeDef RTC_AlarmSubSecondMask) | {
uint8_t alarmstatus = 0;
ErrorStatus status = ERROR;
assert_param(IS_RTC_ALARM_SS_VALUE(RTC_AlarmSubSecondValue));
assert_param(IS_RTC_ALARM_SS_MASK(RTC_AlarmSubSecondMask));
RTC_WriteProtectionCmd(DISABLE);
if ((RTC->ISR1 & RTC_ISR1_INITF) == RESET)
{
alarmstatus = (uint8_t)(RTC->CR2 | RTC_CR2_ALRA... | remotemcu/remcu-chip-sdks | C++ | null | 436 |
/* Returns: The number of times the packet has been sent previously */ | static unsigned dn_nsp_clone_and_send(struct sk_buff *skb, gfp_t gfp) | /* Returns: The number of times the packet has been sent previously */
static unsigned dn_nsp_clone_and_send(struct sk_buff *skb, gfp_t gfp) | {
struct dn_skb_cb *cb = DN_SKB_CB(skb);
struct sk_buff *skb2;
int ret = 0;
if ((skb2 = skb_clone(skb, gfp)) != NULL) {
ret = cb->xmit_count;
cb->xmit_count++;
cb->stamp = jiffies;
skb2->sk = skb->sk;
dn_nsp_send(skb2);
}
return ret;
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Configures the tim event to be generate by software. */ | void TIM_GenerateEvent(TIM_TypeDef *tim, TIMEGR_Typedef source) | /* Configures the tim event to be generate by software. */
void TIM_GenerateEvent(TIM_TypeDef *tim, TIMEGR_Typedef source) | {
WRITE_REG(tim->EGR, source);
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Print an error message to current monitor if we have one, else to stderr. Format arguments like sprintf(). The result should not contain newlines. Prepend the current location and append a newline. It's wrong to call this in a QMP monitor. Use qerror_report() there. */ | void error_report(const char *fmt,...) | /* Print an error message to current monitor if we have one, else to stderr. Format arguments like sprintf(). The result should not contain newlines. Prepend the current location and append a newline. It's wrong to call this in a QMP monitor. Use qerror_report() there. */
void error_report(const char *fmt,...) | {
va_list ap;
GTimeVal tv;
gchar *timestr;
if (enable_timestamp_msg) {
g_get_current_time(&tv);
timestr = g_time_val_to_iso8601(&tv);
error_printf("%s ", timestr);
g_free(timestr);
}
error_print_loc();
va_start(ap, fmt);
error_vprintf(fmt, ap);
va_end(... | ve3wwg/teensy3_qemu | C++ | Other | 15 |
/* This sets up the Interrupt Descriptor Table (IDT) entry for each hardware interrupt (except 128, which is used for system calls), and then tells the Linux infrastructure that each interrupt is controlled by our level-based lguest interrupt controller. */ | static void __init lguest_init_IRQ(void) | /* This sets up the Interrupt Descriptor Table (IDT) entry for each hardware interrupt (except 128, which is used for system calls), and then tells the Linux infrastructure that each interrupt is controlled by our level-based lguest interrupt controller. */
static void __init lguest_init_IRQ(void) | {
unsigned int i;
for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {
__get_cpu_var(vector_irq)[i] = i - FIRST_EXTERNAL_VECTOR;
if (i != SYSCALL_VECTOR)
set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]);
}
irq_ctx_init(smp_processor_id());
} | EmcraftSystems/linux-emcraft | C++ | Other | 266 |
/* Retrieve the TBSCertificate from one given X.509 certificate. */ | BOOLEAN EFIAPI X509GetTBSCert(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 **TBSCert, OUT UINTN *TBSCertSize) | /* Retrieve the TBSCertificate from one given X.509 certificate. */
BOOLEAN EFIAPI X509GetTBSCert(IN CONST UINT8 *Cert, IN UINTN CertSize, OUT UINT8 **TBSCert, OUT UINTN *TBSCertSize) | {
CALL_CRYPTO_SERVICE (X509GetTBSCert, (Cert, CertSize, TBSCert, TBSCertSize), FALSE);
} | tianocore/edk2 | C++ | Other | 4,240 |
/* Event handler for the library USB Configuration Changed event. */ | void EVENT_USB_Device_ConfigurationChanged(void) | /* Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void) | {
bool ConfigSuccess = true;
ConfigSuccess &= HID_Device_ConfigureEndpoints(&Generic_HID_Interface);
USB_Device_EnableSOFEvents();
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
} | prusa3d/Prusa-Firmware-Buddy | C++ | Other | 1,019 |
/* Allocate and initialize serio structure for subsequent registration with serio core. */ | static int __devinit rpckbd_probe(struct platform_device *dev) | /* Allocate and initialize serio structure for subsequent registration with serio core. */
static int __devinit rpckbd_probe(struct platform_device *dev) | {
struct serio *serio;
serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
if (!serio)
return -ENOMEM;
serio->id.type = SERIO_8042;
serio->write = rpckbd_write;
serio->open = rpckbd_open;
serio->close = rpckbd_close;
serio->dev.parent = &dev->dev;
strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio-... | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* Checks whether the specified CRS flag is set or not. */ | uint8_t CRS_ReadStatusFlag(CRS_FLAG_T flag) | /* Checks whether the specified CRS flag is set or not. */
uint8_t CRS_ReadStatusFlag(CRS_FLAG_T flag) | {
uint32_t status;
status = (uint32_t)(CRS->INTSTS & flag);
if (status == flag)
{
return SET;
}
return RESET;
} | pikasTech/PikaPython | C++ | MIT License | 1,403 |
/* ixgb_irq_enable - Enable default interrupt generation settings @adapter: board private structure */ | static void ixgb_irq_enable(struct ixgb_adapter *adapter) | /* ixgb_irq_enable - Enable default interrupt generation settings @adapter: board private structure */
static void ixgb_irq_enable(struct ixgb_adapter *adapter) | {
u32 val = IXGB_INT_RXT0 | IXGB_INT_RXDMT0 |
IXGB_INT_TXDW | IXGB_INT_LSC;
if (adapter->hw.subsystem_vendor_id == SUN_SUBVENDOR_ID)
val |= IXGB_INT_GPI0;
IXGB_WRITE_REG(&adapter->hw, IMS, val);
IXGB_WRITE_FLUSH(&adapter->hw);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* #GCharsetConverter is an implementation of #GConverter based on GIConv. */ | static void g_charset_converter_iface_init(GConverterIface *iface) | /* #GCharsetConverter is an implementation of #GConverter based on GIConv. */
static void g_charset_converter_iface_init(GConverterIface *iface) | {
iface->convert = g_charset_converter_convert;
iface->reset = g_charset_converter_reset;
} | seemoo-lab/nexmon | C++ | GNU General Public License v3.0 | 2,330 |
/* ADC MSP Initialization This function configures the hardware resources used in this example. */ | void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) | /* ADC MSP Initialization This function configures the hardware resources used in this example. */
void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc) | {
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hadc->Instance==ADC1)
{
__HAL_RCC_ADC_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
... | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* This is to be called when an item is unlocked that may have been in the AIL. It will wake up the first member of the AIL wait list if this item's unlocking might allow it to progress. If the item is in the AIL, then we need to get the AIL lock while doing our checking so we don't race with someone going to sleep wai... | void xfs_trans_unlocked_item(struct xfs_ail *ailp, xfs_log_item_t *lip) | /* This is to be called when an item is unlocked that may have been in the AIL. It will wake up the first member of the AIL wait list if this item's unlocking might allow it to progress. If the item is in the AIL, then we need to get the AIL lock while doing our checking so we don't race with someone going to sleep wai... | {
xfs_log_item_t *min_lip;
if (!(lip->li_flags & XFS_LI_IN_AIL) ||
XFS_FORCED_SHUTDOWN(ailp->xa_mount)) {
return;
}
min_lip = xfs_ail_min(ailp);
if (min_lip == lip)
xfs_log_move_tail(ailp->xa_mount, 1);
} | robutest/uclinux | C++ | GPL-2.0 | 60 |
/* The urc has the form +APP PDP: <index>,<state>. State can either be ACTIVE for activation or DEACTIVE if disabled. */ | MODEM_CMD_DEFINE(on_urc_app_pdp) | /* The urc has the form +APP PDP: <index>,<state>. State can either be ACTIVE for activation or DEACTIVE if disabled. */
MODEM_CMD_DEFINE(on_urc_app_pdp) | {
mdata.pdp_active = strcmp(argv[1], "ACTIVE") == 0;
LOG_INF("PDP context: %u", mdata.pdp_active);
k_sem_give(&mdata.sem_response);
return 0;
} | zephyrproject-rtos/zephyr | C++ | Apache License 2.0 | 9,573 |
/* Create the quant index table needed for the envelope. */ | static void decode_envelope(COOKContext *q, COOKSubpacket *p, int *quant_index_table) | /* Create the quant index table needed for the envelope. */
static void decode_envelope(COOKContext *q, COOKSubpacket *p, int *quant_index_table) | {
vlc_index=i;
if (i >= p->js_subband_start * 2) {
vlc_index-=p->js_subband_start;
} else {
vlc_index/=2;
if(vlc_index < 1) vlc_index = 1;
}
if (vlc_index>13) vlc_index = 13;
j = get_vlc2(&q->gb, q->envelope_quant_index[vlc_index-1].tab... | DC-SWAT/DreamShell | C++ | null | 404 |
/* USART check if Received Data Available.
Check if data buffer holds a valid received data word. */ | bool usart_is_recv_ready(uint32_t usart) | /* USART check if Received Data Available.
Check if data buffer holds a valid received data word. */
bool usart_is_recv_ready(uint32_t usart) | {
return (USART_ISR(usart) & USART_ISR_RXNE);
} | insane-adding-machines/unicore-mx | C++ | GNU General Public License v3.0 | 50 |
/* Deinitializes the USIx peripheral registers to their default reset values in USI UART mode. */ | void USI_UARTDeInit(USI_TypeDef *USIx) | /* Deinitializes the USIx peripheral registers to their default reset values in USI UART mode. */
void USI_UARTDeInit(USI_TypeDef *USIx) | {
assert_param(IS_ALL_USI_PERIPH(USIx));
USIx->SW_RESET &=(~USI_SW_RESET_RSTB);
USIx->SW_RESET |=USI_SW_RESET_RSTB;
USIx->USI_MODE_CTRL &= (~USI_SERIAL_MODE);
USIx->INTERRUPT_ALL_CLR = USI_INT_ALL_CLEAR;
USIx->INTERRUPT_ENABLE = 0x00000000;
} | alibaba/AliOS-Things | C++ | Apache License 2.0 | 4,536 |
/* This function wraps EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Write() service. It writes the PCI configuration register specified by Address with the value specified by Data. The width of data is specified by Width. Data is returned. */ | UINT32 SmmPciLibPciRootBridgeIoWriteWorker(IN UINTN Address, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT32 Data) | /* This function wraps EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Write() service. It writes the PCI configuration register specified by Address with the value specified by Data. The width of data is specified by Width. Data is returned. */
UINT32 SmmPciLibPciRootBridgeIoWriteWorker(IN UINTN Address, IN EFI_PCI_ROOT_BRIDGE_IO... | {
mSmmPciRootBridgeIo->Pci.Write (
mSmmPciRootBridgeIo,
Width,
PCI_TO_PCI_ROOT_BRIDGE_IO_ADDRESS (Address),
1,
&Data
);
return Data;
} | tianocore/edk2 | C++ | Other | 4,240 |
/* MSS_GPIO_enable_irq See "mss_gpio.h" for details of how to use this function. */ | void MSS_GPIO_enable_irq(mss_gpio_id_t port_id) | /* MSS_GPIO_enable_irq See "mss_gpio.h" for details of how to use this function. */
void MSS_GPIO_enable_irq(mss_gpio_id_t port_id) | {
uint32_t cfg_value;
uint32_t gpio_idx = (uint32_t)port_id;
ASSERT( gpio_idx < NB_OF_GPIO );
if ( gpio_idx < NB_OF_GPIO )
{
cfg_value = *(g_config_reg_lut[gpio_idx]);
*(g_config_reg_lut[gpio_idx]) = (cfg_value | GPIO_INT_ENABLE_MASK);
NVIC_EnableIRQ( g_gpio_irqn_lut[gpio_idx... | apopple/Pandaboard-FreeRTOS | C++ | null | 25 |
/* Returns information for an available text mode that the output device(s) supports. */ | EFI_STATUS EFIAPI ConsoleLoggerQueryMode(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber, OUT UINTN *Columns, OUT UINTN *Rows) | /* Returns information for an available text mode that the output device(s) supports. */
EFI_STATUS EFIAPI ConsoleLoggerQueryMode(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, IN UINTN ModeNumber, OUT UINTN *Columns, OUT UINTN *Rows) | {
CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
ConsoleInfo = CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS (This);
return (ConsoleInfo->OldConOut->QueryMode (
ConsoleInfo->OldConOut,
ModeNumber,
Columns,
... | tianocore/edk2 | C++ | Other | 4,240 |
/* Sets the RF Management configuration.
Needs the I2C Password presentation to be effective. */ | int32_t BSP_NFCTAG_WriteRFMngt(uint32_t Instance, const uint8_t Rfmngt) | /* Sets the RF Management configuration.
Needs the I2C Password presentation to be effective. */
int32_t BSP_NFCTAG_WriteRFMngt(uint32_t Instance, const uint8_t Rfmngt) | {
UNUSED(Instance);
return ST25DV_WriteRFMngt(&NfcTagObj, Rfmngt);
} | eclipse-threadx/getting-started | C++ | Other | 310 |
/* Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. */ | VOID* EFIAPI AllocateRuntimePool(IN UINTN AllocationSize) | /* Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. */
VOID* EFIAPI AllocateRuntim... | {
VOID *Buffer;
Buffer = InternalAllocatePool (EfiRuntimeServicesData, AllocationSize);
if (Buffer != NULL) {
MemoryProfileLibRecord (
(PHYSICAL_ADDRESS)(UINTN)RETURN_ADDRESS (0),
MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_POOL,
EfiRuntimeServicesData,
Buffer,
AllocationSize,
... | tianocore/edk2 | C++ | Other | 4,240 |
/* Write an output value to corresponding Port. Parameters: port: use to choose a I/O port among Port A, B, or C. output: value that will be written to the corresponding Port. return: SUCCESS */ | static int32_t gpio_write(void *port, uint32_t mask) | /* Write an output value to corresponding Port. Parameters: port: use to choose a I/O port among Port A, B, or C. output: value that will be written to the corresponding Port. return: SUCCESS */
static int32_t gpio_write(void *port, uint32_t mask) | {
dw_gpio_priv_t *gpio_priv = port;
uint32_t value = gpio_reg->SWPORT_DR;
value &= ~(mask);
value |= gpio_priv->value;
gpio_reg->SWPORT_DR = value;
return 0;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
/* Set the specified data holding register value for DAC channel1. */ | void DAC_SetChannel1Data(emDACALIGN_TypeDef alignement, u16 data) | /* Set the specified data holding register value for DAC channel1. */
void DAC_SetChannel1Data(emDACALIGN_TypeDef alignement, u16 data) | {
*((u32*)(DAC_BASE + DHR12R1_Offset + alignement)) = data;
} | RT-Thread/rt-thread | C++ | Apache License 2.0 | 9,535 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.