本文整理汇总了C++中profile_init函数的典型用法代码示例。如果您正苦于以下问题:C++ profile_init函数的具体用法?C++ profile_init怎么用?C++ profile_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了profile_init函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pa_log_debug
pa_bluetooth_backend *pa_bluetooth_native_backend_new(pa_core *c, pa_bluetooth_discovery *y, bool enable_hs_role) {
pa_bluetooth_backend *backend;
DBusError err;
pa_log_debug("Bluetooth Headset Backend API support using the native backend");
backend = pa_xnew0(pa_bluetooth_backend, 1);
backend->core = c;
dbus_error_init(&err);
if (!(backend->connection = pa_dbus_bus_get(c, DBUS_BUS_SYSTEM, &err))) {
pa_log("Failed to get D-Bus connection: %s", err.message);
dbus_error_free(&err);
pa_xfree(backend);
return NULL;
}
backend->discovery = y;
backend->enable_hs_role = enable_hs_role;
if (enable_hs_role)
profile_init(backend, PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY);
profile_init(backend, PA_BLUETOOTH_PROFILE_HEADSET_HEAD_UNIT);
return backend;
}
开发者ID:plbossart,项目名称:pulseaudio,代码行数:26,代码来源:backend-native.c
示例2: paths
/* Set the profile paths in the context. If secure is set to TRUE
then do not include user paths (from environment variables, etc).
If kdc is TRUE, include kdc.conf from whereever we expect to find
it. */
static krb5_error_code
os_init_paths(krb5_context ctx, krb5_boolean kdc)
{
krb5_error_code retval = 0;
profile_filespec_t *files = 0;
krb5_boolean secure = ctx->profile_secure;
#ifdef KRB5_DNS_LOOKUP
ctx->profile_in_memory = 0;
#endif /* KRB5_DNS_LOOKUP */
retval = os_get_default_config_files(&files, secure);
if (retval == 0 && kdc)
retval = add_kdc_config_file(&files);
if (!retval) {
retval = profile_init((const_profile_filespec_t *) files,
&ctx->profile);
#ifdef KRB5_DNS_LOOKUP
/* if none of the filenames can be opened use an empty profile */
if (retval == ENOENT) {
retval = profile_init(NULL, &ctx->profile);
if (!retval)
ctx->profile_in_memory = 1;
}
#endif /* KRB5_DNS_LOOKUP */
}
if (files)
free_filespecs(files);
if (retval)
ctx->profile = 0;
if (retval == ENOENT)
return KRB5_CONFIG_CANTOPEN;
if ((retval == PROF_SECTION_NOTOP) ||
(retval == PROF_SECTION_SYNTAX) ||
(retval == PROF_RELATION_SYNTAX) ||
(retval == PROF_EXTRA_CBRACE) ||
(retval == PROF_MISSING_OBRACE))
return KRB5_CONFIG_BADFORMAT;
return retval;
}
开发者ID:Brainiarc7,项目名称:pbis,代码行数:52,代码来源:init_os_ctx.c
示例3: main
int main (int argc, char **argv)
{
if (argc <= 1) {
_help_msg();
exit(0);
}
_set_options(argc, argv);
profile_init();
switch (params.mode) {
case SH5UTIL_MODE_MERGE:
info("Merging node-step files into %s",
params.output);
_merge_step_files();
break;
case SH5UTIL_MODE_EXTRACT:
info("Extracting job data from %s into %s\n",
params.input, params.output);
_extract_data();
break;
default:
error("Unknown type %d", params.mode);
break;
}
profile_fini();
xfree(params.dir);
xfree(params.node);
return 0;
}
开发者ID:jsollom,项目名称:slurm,代码行数:29,代码来源:sh5util.c
示例4: fit_init
void
fit_init(fitinfo *fit)
{
beam_init(&fit->beam);
pars_init(&fit->pars);
profile_init(&fit->p);
model_init(&fit->m);
interface_init(&fit->rm);
fit->m.rm = &fit->rm;
fit->capacity = -1;
fit->nQ = 0;
data_init(&fit->dataA);
data_init(&fit->dataB);
data_init(&fit->dataC);
data_init(&fit->dataD);
fit->worksize = 0;
fit->datatype = FIT_MAGNITUDE;
fit->weight = 1.;
fit->penalty = 0.;
/* Parameters to support incoherent sum of models */
fit->number_incoherent = 0;
fit->incoherent_models = NULL;
fit->incoherent_weights = NULL;
}
开发者ID:reflectometry,项目名称:garefl,代码行数:25,代码来源:fit.c
示例5: incoherent_unpolarized_theory
/* Incoherent sum of multiple models for unpolarized reflectometry */
static void incoherent_unpolarized_theory(fitinfo *fit)
{
Real total_weight; /* Total weight of all models */
int i, k;
profile p; /* Incoherent model profile */
Real *A, *B, *C, *D;
/* Make space for incoherent models. */
extend_work(fit,4*fit->nQ);
A = fit->work;
B = fit->work + fit->nQ;
C = fit->work + 2*fit->nQ;
D = fit->work + 3*fit->nQ;
/* Incoherent sum of the theory functions. */
profile_init(&p);
for (i=0; i < fit->number_incoherent; i++) {
profile_reset(&p);
model_profile(fit->incoherent_models[i], &p);
/* profile_print(&p,NULL); */
if (fit->m.is_magnetic) {
#ifdef HAVE_MAGNETIC
magnetic_reflectivity(p.n, p.d, p.rho,
p.mu,fit->beam.lambda, fit->beam.alignment,
p.P, p.expth,
fit->beam.Aguide, fit->nQ, fit->fitQ,
A, B, C, D);
for (k=0; k < fit->nQ; k++) {
A[k] = (A[k]+B[k]+C[k]+D[k])/2.;
}
#else
fprintf(stderr,"Need to configure with --enable-magnetic\n");
exit(1);
#endif
} else {
reflectivity(p.n, p.d, p.rho, p.mu, fit->beam.lambda,
fit->beam.alignment,
fit->nQ, fit->fitQ, A);
}
for (k=0; k < fit->nQ; k++) {
fit->fitA[k] += A[k] * fit->incoherent_weights[i];
}
}
profile_destroy(&p);
/* Incoherent sum of models requires relative model weighting.
* The base model is assumed to have weight 1. The remaining
* models can have their weights adjusted, with the result
* normalized by the total weight. */
total_weight = 1.;
for (i=0; i < fit->number_incoherent; i++) {
total_weight += fit->incoherent_weights[i];
}
for (k=0; k < fit->nQ; k++) {
fit->fitA[k] /= total_weight;
}
}
开发者ID:reflectometry,项目名称:garefl,代码行数:58,代码来源:fit.c
示例6: pa_bluetooth_native_backend_enable_hs_role
void pa_bluetooth_native_backend_enable_hs_role(pa_bluetooth_backend *native_backend, bool enable_hs_role) {
if (enable_hs_role == native_backend->enable_hs_role)
return;
if (enable_hs_role)
profile_init(native_backend, PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY);
else
profile_done(native_backend, PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY);
native_backend->enable_hs_role = enable_hs_role;
}
开发者ID:plbossart,项目名称:pulseaudio,代码行数:12,代码来源:backend-native.c
示例7: profile_init_path
errcode_t KRB5_CALLCONV
profile_init_path(const_profile_filespec_list_t filepath,
profile_t *ret_profile)
{
int n_entries, i;
unsigned int ent_len;
const char *s, *t;
profile_filespec_t *filenames;
errcode_t retval;
/* count the distinct filename components */
for(s = filepath, n_entries = 1; *s; s++) {
if (*s == ':')
n_entries++;
}
/* the array is NULL terminated */
filenames = (profile_filespec_t*) malloc((n_entries+1) * sizeof(char*));
if (filenames == 0)
return ENOMEM;
/* measure, copy, and skip each one */
for(s = filepath, i=0; ((t = strchr(s, ':')) != NULL) ||
((t=s+strlen(s)) != NULL); s=t+1, i++) {
ent_len = t-s;
filenames[i] = (char*) malloc(ent_len + 1);
if (filenames[i] == 0) {
/* if malloc fails, free the ones that worked */
while(--i >= 0) free(filenames[i]);
free(filenames);
return ENOMEM;
}
strncpy(filenames[i], s, ent_len);
filenames[i][ent_len] = 0;
if (*t == 0) {
i++;
break;
}
}
/* cap the array */
filenames[i] = 0;
retval = profile_init((const_profile_filespec_t *) filenames,
ret_profile);
/* count back down and free the entries */
while(--i >= 0) free(filenames[i]);
free(filenames);
return retval;
}
开发者ID:andreiw,项目名称:polaris,代码行数:51,代码来源:prof_init.c
示例8: setup
void setup (void)
{
dbug_init();
sock_init();
#if defined(USE_PROFILER)
if (!profile_enable)
{
profile_enable = 1;
if (!profile_init())
exit (-1);
}
#endif
}
开发者ID:ya-mouse,项目名称:dos-utils,代码行数:14,代码来源:eatsock.c
示例9: adev_open
static int adev_open(const hw_module_t* module, const char* name, hw_device_t** device)
{
if (strcmp(name, AUDIO_HARDWARE_INTERFACE) != 0)
return -EINVAL;
struct audio_device *adev = calloc(1, sizeof(struct audio_device));
if (!adev)
return -ENOMEM;
profile_init(&adev->out_profile, PCM_OUT);
profile_init(&adev->in_profile, PCM_IN);
adev->hw_device.common.tag = HARDWARE_DEVICE_TAG;
adev->hw_device.common.version = AUDIO_DEVICE_API_VERSION_2_0;
adev->hw_device.common.module = (struct hw_module_t *)module;
adev->hw_device.common.close = adev_close;
adev->hw_device.init_check = adev_init_check;
adev->hw_device.set_voice_volume = adev_set_voice_volume;
adev->hw_device.set_master_volume = adev_set_master_volume;
adev->hw_device.set_mode = adev_set_mode;
adev->hw_device.set_mic_mute = adev_set_mic_mute;
adev->hw_device.get_mic_mute = adev_get_mic_mute;
adev->hw_device.set_parameters = adev_set_parameters;
adev->hw_device.get_parameters = adev_get_parameters;
adev->hw_device.get_input_buffer_size = adev_get_input_buffer_size;
adev->hw_device.open_output_stream = adev_open_output_stream;
adev->hw_device.close_output_stream = adev_close_output_stream;
adev->hw_device.open_input_stream = adev_open_input_stream;
adev->hw_device.close_input_stream = adev_close_input_stream;
adev->hw_device.dump = adev_dump;
*device = &adev->hw_device.common;
return 0;
}
开发者ID:Fox-Heracles,项目名称:platform_hardware_libhardware,代码行数:36,代码来源:audio_hal.c
示例10: krb5_set_config_files
krb5_error_code
krb5_set_config_files(krb5_context ctx, const char **filenames)
{
krb5_error_code retval = 0;
profile_t profile;
retval = profile_init(filenames, &profile);
if (retval)
return retval;
if (ctx->profile)
profile_release(ctx->profile);
ctx->profile = profile;
return 0;
}
开发者ID:Brainiarc7,项目名称:pbis,代码行数:16,代码来源:init_os_ctx.c
示例11: incoherent_polarized_theory
/* Incoherent sum of multiple models for polarized reflectometry */
static void incoherent_polarized_theory(fitinfo *fit)
{
#ifdef HAVE_MAGNETIC
Real total_weight; /* Total weight of all models */
int i, k;
profile p; /* Incoherent model profile */
Real *A,*B,*C,*D;
/* Make space for incoherent models. */
extend_work(fit,4*fit->nQ);
A = fit->work;
B = fit->work + fit->nQ;
C = fit->work + 2*fit->nQ;
D = fit->work + 3*fit->nQ;
/* Incoherent sum of the theory functions. */
profile_init(&p);
for (i=0; i < fit->number_incoherent; i++) {
model_profile(fit->incoherent_models[i], &p);
magnetic_reflectivity(p.n, p.d, p.rho, p.mu, fit->beam.lambda,
fit->beam.alignment,
p.P, p.expth, fit->beam.Aguide, fit->nQ, fit->fitQ, A,B,C,D);
for (k=0; k < fit->nQ; k++) {
fit->fitA[k] += A[k] * fit->incoherent_weights[i];
fit->fitB[k] += B[k] * fit->incoherent_weights[i];
fit->fitC[k] += C[k] * fit->incoherent_weights[i];
fit->fitD[k] += D[k] * fit->incoherent_weights[i];
}
}
profile_destroy(&p);
/* Incoherent sum of models requires relative model weighting.
* The base model is assumed to have weight 1. The remaining
* models can have their weights adjusted, with the result
* normalized by the total weight. */
total_weight = 1.;
for (i=0; i < fit->number_incoherent; i++) {
total_weight += fit->incoherent_weights[i];
}
for (k=0; k < fit->nQ; k++) {
fit->fitA[k] /= total_weight;
fit->fitB[k] /= total_weight;
fit->fitC[k] /= total_weight;
fit->fitD[k] /= total_weight;
}
#endif
}
开发者ID:reflectometry,项目名称:garefl,代码行数:48,代码来源:fit.c
示例12: profile_copy
errcode_t KRB5_CALLCONV
profile_copy(profile_t old_profile, profile_t *new_profile)
{
size_t size, i;
const_profile_filespec_t *files;
prf_file_t file;
errcode_t err;
/* The fields we care about are read-only after creation, so
no locking is needed. */
COUNT_LINKED_LIST (size, prf_file_t, old_profile->first_file, next);
files = malloc ((size+1) * sizeof(*files));
if (files == NULL)
return ENOMEM;
for (i = 0, file = old_profile->first_file; i < size; i++, file = file->next)
files[i] = file->data->filespec;
files[size] = NULL;
err = profile_init (files, new_profile);
free (files);
return err;
}
开发者ID:aosm,项目名称:KerberosLibraries,代码行数:21,代码来源:prof_init.c
示例13: profiling_store
static ssize_t profiling_store(struct kobject *kobj,
struct kobj_attribute *attr,
const char *buf, size_t count)
{
int ret;
if (prof_on)
return -EEXIST;
/*
* This eventually calls into get_option() which
* has a ton of callers and is not const. It is
* easiest to cast it away here.
*/
profile_setup((char *)buf);
ret = profile_init();
if (ret)
return ret;
ret = create_proc_profile();
if (ret)
return ret;
return count;
}
开发者ID:alexax66,项目名称:CM13_kernel_serranodsxx,代码行数:22,代码来源:ksysfs.c
示例14: PRS
//.........这里部分代码省略.........
(ctx->options & E2F_OPT_COMPRESS_DIRS)) {
com_err(ctx->program_name, 0,
_("The -n and -D options are incompatible."));
fatal_error(ctx, 0);
}
if ((ctx->options & E2F_OPT_NO) && cflag) {
com_err(ctx->program_name, 0,
_("The -n and -c options are incompatible."));
fatal_error(ctx, 0);
}
if ((ctx->options & E2F_OPT_NO) && bad_blocks_file) {
com_err(ctx->program_name, 0,
_("The -n and -l/-L options are incompatible."));
fatal_error(ctx, 0);
}
if (ctx->options & E2F_OPT_NO)
ctx->options |= E2F_OPT_READONLY;
ctx->io_options = strchr(argv[optind], '?');
if (ctx->io_options)
*ctx->io_options++ = 0;
ctx->filesystem_name = blkid_get_devname(ctx->blkid, argv[optind], 0);
if (!ctx->filesystem_name) {
com_err(ctx->program_name, 0, _("Unable to resolve '%s'"),
argv[optind]);
fatal_error(ctx, 0);
}
if (extended_opts)
parse_extended_opts(ctx, extended_opts);
if ((cp = getenv("E2FSCK_CONFIG")) != NULL)
config_fn[0] = cp;
profile_set_syntax_err_cb(syntax_err_report);
profile_init(config_fn, &ctx->profile);
if (flush) {
fd = open(ctx->filesystem_name, O_RDONLY, 0);
if (fd < 0) {
com_err("open", errno,
_("while opening %s for flushing"),
ctx->filesystem_name);
fatal_error(ctx, 0);
}
if ((retval = ext2fs_sync_device(fd, 1))) {
com_err("ext2fs_sync_device", retval,
_("while trying to flush %s"),
ctx->filesystem_name);
fatal_error(ctx, 0);
}
close(fd);
}
if (cflag && bad_blocks_file) {
fprintf(stderr, _("The -c and the -l/-L options may "
"not be both used at the same time.\n"));
exit(FSCK_USAGE);
}
#ifdef HAVE_SIGNAL_H
/*
* Set up signal action
*/
memset(&sa, 0, sizeof(struct sigaction));
sa.sa_handler = signal_cancel;
sigaction(SIGINT, &sa, 0);
sigaction(SIGTERM, &sa, 0);
#ifdef SA_RESTART
sa.sa_flags = SA_RESTART;
开发者ID:xiejinfeng850414,项目名称:BananaPi-Android-4.2.2-Liab,代码行数:67,代码来源:unix.c
示例15: stage2_stat_init
/*-------------------------------------------------------------------------*/
void
stage2_stat_init(stage2_stat_t *stats)
{
memset(stats, 0, sizeof(stage2_stat_t));
profile_init(&stats->profile, PROF_MAX);
}
开发者ID:gpradel33,项目名称:Factorisation,代码行数:7,代码来源:stage2.c
示例16: start_kernel
asmlinkage void __init start_kernel(void)
{
char * command_line;
extern struct kernel_param __start___param[], __stop___param[];
#ifdef CONFIG_RTAI_RTSPMM
unsigned int indice_part;
/* Size of the needed memory block by the configuration */
unsigned long rt_mem_block_size = 0;
#endif
/*
* Interrupts are still disabled. Do necessary setups, then
* enable them
*/
lock_kernel();
page_address_init();
printk(linux_banner);
setup_arch(&command_line);
setup_per_cpu_areas();
/*
* Mark the boot cpu "online" so that it can call console drivers in
* printk() and can access its per-cpu storage.
*/
smp_prepare_boot_cpu();
/*
* Set up the scheduler prior starting any interrupts (such as the
* timer interrupt). Full topology setup happens at smp_init()
* time - but meanwhile we still have a functioning scheduler.
*/
sched_init();
/*
* Disable preemption - early bootup scheduling is extremely
* fragile until we cpu_idle() for the first time.
*/
preempt_disable();
build_all_zonelists();
page_alloc_init();
early_init_hardirqs();
printk("Kernel command line: %s\n", saved_command_line);
parse_early_param();
parse_args("Booting kernel", command_line, __start___param,
__stop___param - __start___param,
&unknown_bootoption);
sort_main_extable();
trap_init();
rcu_init();
init_IRQ();
pidhash_init();
init_timers();
softirq_init();
time_init();
/*
* HACK ALERT! This is early. We're enabling the console before
* we've done PCI setups etc, and console_init() must be aware of
* this. But we do want output early, in case something goes wrong.
*/
console_init();
if (panic_later)
panic(panic_later, panic_param);
#ifdef CONFIG_RTAI_RTSPMM
/* Allocate a big and continuous memory block for the module SPMM
included in the RTAI functionalities */
printk("--- Memory Allocation for the module rt_spmm ---\n");
/* WARNING
We need to add some space for the structures vrtxptext and vrtxpt and the partitions bitmap
that the module rt_spmm uses to handle the blocks in each partition */
/* for each defined partitions */
for(indice_part = 0; indice_part < RT_MAX_PART_NUM; indice_part ++)
{
if ((rt_partitions_table[indice_part].block_size != 0) &&
(rt_partitions_table[indice_part].num_of_blocks != 0))
{
rt_partitions_table[indice_part].part_size =
(rt_partitions_table[indice_part].block_size + XN_NBBY)
*rt_partitions_table[indice_part].num_of_blocks +
+ sizeof(vrtxptext_t)+sizeof(vrtxpt_t);
rt_mem_block_size += rt_partitions_table[indice_part].part_size;
}
}
#ifdef CONFIG_RTAI_PART_DMA
printk("Allocate memory in the low part of memory\n");
rt_mem_block_ptr=(void*)alloc_bootmem_low(rt_mem_block_size + PAGE_SIZE-1);
#else
printk("Allocate memory in the standard part of memory\n");
rt_mem_block_ptr=(void*)alloc_bootmem(rt_mem_block_size + PAGE_SIZE-1);
#endif /* CONFIG_PART_DMA */
printk("Needed Memory Size : %lu\n", rt_mem_block_size);
printk("Allocated Memory Size : %lu\n", rt_mem_block_size + PAGE_SIZE-1);
printk("Memory block address : 0x%x\n", (unsigned int)rt_mem_block_ptr);
printk("-----------------------------------------------\n");
#endif /* CONFIG_RTAI_RTSPMM */
profile_init();
local_irq_enable();
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start && !initrd_below_start_ok &&
initrd_start < min_low_pfn << PAGE_SHIFT) {
//.........这里部分代码省略.........
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:101,代码来源:main.c
示例17: _ev_debug_init
void
_ev_debug_init (void)
{
debug_init ();
profile_init ();
}
开发者ID:4eremuxa,项目名称:evince,代码行数:6,代码来源:ev-debug.c
示例18: start_kernel
asmlinkage void __init start_kernel(void)
{
char * command_line;
extern char saved_command_line[];
extern struct kernel_param __start___param[], __stop___param[];
#ifdef TARGET_OS2
LX_set_sysstate(LXSYSSTATE_KERNEL_BOOT_STARTED,0);
#endif
/*
* Interrupts are still disabled. Do necessary setups, then
* enable them
*/
lock_kernel();
page_address_init();
printk(linux_banner);
setup_arch(&command_line);
setup_per_cpu_areas();
/*
* Mark the boot cpu "online" so that it can call console drivers in
* printk() and can access its per-cpu storage.
*/
smp_prepare_boot_cpu();
build_all_zonelists();
page_alloc_init();
printk("Kernel command line: %s\n", saved_command_line);
#ifdef TARGET_OS2
parse_args("Booting kernel", command_line, __start___param,
0,
&unknown_bootoption);
#else
parse_args("Booting kernel", command_line, __start___param,
__stop___param - __start___param,
&unknown_bootoption);
#endif
sort_main_extable();
trap_init();
rcu_init();
init_IRQ();
pidhash_init();
sched_init();
softirq_init();
time_init();
/*
* HACK ALERT! This is early. We're enabling the console before
* we've done PCI setups etc, and console_init() must be aware of
* this. But we do want output early, in case something goes wrong.
*/
console_init();
if (panic_later)
panic(panic_later, panic_param);
profile_init();
local_irq_enable();
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start && !initrd_below_start_ok &&
initrd_start < min_low_pfn << PAGE_SHIFT) {
printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
"disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT);
initrd_start = 0;
}
#endif
mem_init();
kmem_cache_init();
if (late_time_init)
late_time_init();
calibrate_delay();
pidmap_init();
pgtable_cache_init();
pte_chain_init();
#ifdef CONFIG_X86
if (efi_enabled)
efi_enter_virtual_mode();
#endif
fork_init(num_physpages);
proc_caches_init();
buffer_init();
unnamed_dev_init();
security_scaffolding_startup();
vfs_caches_init(num_physpages);
radix_tree_init();
signals_init();
/* rootfs populating might need page-writeback */
page_writeback_init();
#ifdef CONFIG_PROC_FS
proc_root_init();
#endif
check_bugs();
printk("POSIX conformance testing by UNIFIX\n");
/*
* We count on the initial thread going ok
* Like idlers init is an unlocked kernel thread, which will
* make syscalls (and thus be locked).
*/
init_idle(current, smp_processor_id());
/* Do the rest non-__init'ed, we're now alive */
rest_init();
}
开发者ID:OS2World,项目名称:DRV-LXAPI32,代码行数:100,代码来源:oi_main.c
示例19: main
int main(int argc, char** argv)
{
int r;
unsigned int v;
unsigned long long ll;
int i;
#ifndef NO_PROFILE
struct profile_data pdf1, pdf2, pdf4, pdf5, pdf6, pdf8;
struct profile_data pdl1, pdl2, pdl4, pdl5, pdl6, pdl8;
#ifdef HAS_BIT_SCAN_ASM
struct profile_data pdf3, pdf7, pdl3, pdl7;
#endif
struct profile_data pdf_32, pdf_64, pdl_32, pdl_64;
struct profile_data pdf_long, pdl_long;
#endif /* NO_PROFILE */
profile_init(&pdf1, "first_debruijn32");
profile_init(&pdf2, "first_slow32");
#ifdef HAS_BIT_SCAN_ASM
profile_init(&pdf3, "first_asm32");
#endif
profile_init(&pdf4, "first_br32");
profile_init(&pdf5, "first_debruijn64");
profile_init(&pdf6, "first_slow64");
#ifdef HAS_BIT_SCAN_ASM
profile_init(&pdf7, "first_asm64");
#endif
profile_init(&pdf8, "first_br64");
profile_init(&pdl1, "last_debruijn32");
profile_init(&pdl2, "last_slow32");
#ifdef HAS_BIT_SCAN_ASM
profile_init(&pdl3, "last_asm32");
#endif
profile_init(&pdl4, "last_br32");
profile_init(&pdl5, "last_debruijn64");
profile_init(&pdl6, "last_slow64");
#ifdef HAS_BIT_SCAN_ASM
profile_init(&pdl7, "last_asm64");
#endif
profile_init(&pdl8, "last_br64");
profile_init(&pdf_32, "scan_forward32");
profile_init(&pdf_64, "scan_forward64");
profile_init(&pdl_32, "scan_reverse32");
profile_init(&pdl_64, "scan_reverse64");
profile_init(&pdf_long, "scan_forward_l");
profile_init(&pdl_long, "scan_reverse_l");
for (i=0; i<100; i++){
for (r=0; r<32; r++){
v=(1U<<r);
CHECK("first debruijn 32bit", r, v, bit_scan_forward_debruijn32, &pdf1);
CHECK("first slow 32bit", r, v, bit_scan_forward_slow32, &pdf2);
#ifdef HAS_BIT_SCAN_ASM
CHECK("first asm 32bit", r, v, bit_scan_forward_asm32, &pdf3);
#endif
CHECK("first br 32bit", r, v, bit_scan_forward_br32, &pdf4);
CHECK("scan_forward32", r, v, bit_scan_forward32, &pdf_32);
if (sizeof(long)<=4){
CHECK("scan_forward_l", r, v, bit_scan_forward, &pdf_long);
}
v+=(v-1);
CHECK("last debruijn 32bit", r, v, bit_scan_reverse_debruijn32, &pdl1);
CHECK("last slow 32bit", r, v, bit_scan_reverse_slow32, &pdl2);
#ifdef HAS_BIT_SCAN_ASM
CHECK("last asm 32bit", r, v, bit_scan_reverse_asm32, &pdl3);
#endif
CHECK("last br 32bit", r, v, bit_scan_reverse_br32, &pdl4);
CHECK("scan_reverse32", r, v, bit_scan_reverse32, &pdl_32);
if (sizeof(long)<=4){
CHECK("scan_reverse_l", r, v, bit_scan_reverse, &pdl_long);
}
}
for (r=0; r<64; r++){
ll=(1ULL<<r);
CHECK("first debruijn 64bit", r, ll, bit_scan_forward_debruijn64, &pdf5);
CHECK("first slow 64bit", r, ll, bit_scan_forward_slow64, &pdf6);
#ifdef HAS_BIT_SCAN_ASM
CHECK("first asm 64bit", r, ll, bit_scan_forward_asm64, &pdf7);
#endif
CHECK("first br 64bit", r, ll, bit_scan_forward_br64, &pdf8);
CHECK("scan_forward64", r, ll, bit_scan_forward64, &pdf_64);
if (sizeof(long)>4){
CHECK("scan_forward_l", r, ll, bit_scan_forward, &pdf_long);
}
ll+=ll-1;
CHECK("last debruijn 64bit", r, ll, bit_scan_reverse_debruijn64, &pdl5);
CHECK("last slow 64bit", r, ll, bit_scan_reverse_slow64, &pdl6);
#ifdef HAS_BIT_SCAN_ASM
CHECK("last asm 64bit", r, ll, bit_scan_reverse_asm64, &pdl7);
#endif
CHECK("last br 64bit", r, ll, bit_scan_reverse_br64, &pdl8);
CHECK("scan_reverse64", r, ll, bit_scan_reverse64, &pdl_64);
if (sizeof(long)>4){
CHECK("scan_reverse_l", r, ll, bit_scan_reverse, &pdl_long);
}
}
}
//.........这里部分代码省略.........
开发者ID:4N7HR4X,项目名称:kamailio,代码行数:101,代码来源:bit_scan_test.c
示例20: main
int
main(void)
{
#if WITH_SD
int r;
#endif /* WITH_SD */
msp430_cpu_init();
watchdog_stop();
/* Platform-specific initialization. */
msb_ports_init();
adc_init();
clock_init();
rtimer_init();
sht11_init();
leds_init();
leds_on(LEDS_ALL);
irq_init();
process_init();
/* serial interface */
rs232_set_input(serial_line_input_byte);
rs232_init();
serial_line_init();
uart_lock(UART_MODE_RS232);
uart_unlock(UART_MODE_RS232);
#if WITH_UIP
slip_arch_init(BAUD2UBR(115200));
#endif
#if WITH_SD
r = sd_initialize();
if(r < 0) {
printf("Failed to initialize the SD driver: %s\n", sd_error_string(r));
} else {
sd_offset_t capacity;
printf("The SD driver was successfully initialized\n");
capacity = sd_get_capacity();
if(capacity < 0) {
printf("Failed to get the SD card capacity: %s\n", sd_error_string(r));
} else {
printf("SD card capacity: %u MB\n",
(unsigned)(capacity / (1024UL * 1024)));
}
}
#endif
/* System services */
process_start(&etimer_process, NULL);
ctimer_init();
node_id_restore();
init_net();
energest_init();
#if PROFILE_CONF_ON
profile_init();
#endif /* PROFILE_CONF_ON */
leds_off(LEDS_ALL);
printf(CONTIKI_VERSION_STRING " started. Node id %u, using %s.\n",
node_id, rime_mac->name);
autostart_start(autostart_processes);
/*
* This is the scheduler loop.
*/
ENERGEST_ON(ENERGEST_TYPE_CPU);
while (1) {
int r;
#if PROFILE_CONF_ON
profile_episode_start();
#endif /* PROFILE_CONF_ON */
do {
/* Reset watchdog. */
watchdog_periodic();
r = process_run();
} while(r > 0);
#if PROFILE_CONF_ON
profile_episode_end();
#endif /* PROFILE_CONF_ON */
/*
* Idle processing.
*/
int s = splhigh(); /* Disable interrupts. */
if (process_nevents() != 0) {
splx(s); /* Re-enable interrupts. */
//.........这里部分代码省略.........
开发者ID:EDAyele,项目名称:ptunes,代码行数:101,代码来源:contiki-msb430-main.c
注:本文中的profile_init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论