本文整理汇总了C++中cninit函数的典型用法代码示例。如果您正苦于以下问题:C++ cninit函数的具体用法?C++ cninit怎么用?C++ cninit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cninit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wscninit
void
wscninit(struct consdev *cp)
{
if ((*wsfbcninit)()) {
/*
* For some reason, the console initialization failed.
* Fallback to serial console, by re-electing a console.
*/
wscn_ignore = 1;
cninit();
return;
}
switch (vax_bustype) {
case VAX_VSBUS:
#if NDZKBD > 0
dzkbd_cnattach(0); /* Connect keyboard and screen together */
#endif
break;
case VAX_VXTBUS:
#if NQSCKBD > 0
qsckbd_cnattach(QSC_LINE_KEYBOARD);
#endif
break;
}
}
示例2: boot
void
boot(dev_t dev)
{
u_long marks[MARK_MAX];
char path[128];
pdc_init();
cninit();
devboot(dev, path);
strncpy(path + strlen(path), ":/bsd.rd", 9);
printf(">> OpenBSD/" MACHINE " CDBOOT 0.1\n"
"booting %s: ", path);
marks[MARK_START] = (u_long)DEFAULT_KERNEL_ADDRESS;
if (!loadfile(path, marks, LOAD_KERNEL)) {
marks[MARK_END] = ALIGN(marks[MARK_END] -
(u_long)DEFAULT_KERNEL_ADDRESS);
fcacheall();
__asm("mtctl %r0, %cr17");
__asm("mtctl %r0, %cr17");
(*(startfuncp)(marks[MARK_ENTRY]))((int)(long)pdc, 0, bootdev,
marks[MARK_END], BOOTARG_APIVER, BOOTARG_LEN,
(caddr_t)BOOTARG_OFF);
/* not reached */
}
}
示例3: machine_startup
/*
* Cpu initialization. Running virtual, but without MACH VM
* set up. First C routine called.
*/
void machine_startup()
{
/*
* Do basic VM initialization
*/
i386_init();
/*
* Initialize the console so we can print.
*/
cninit();
#if MACH_KDB
/*
* Initialize the kernel debugger.
*/
ddb_init();
/*
* Cause a breakpoint trap to the debugger before proceeding
* any further if RB_KDB (the '-d' switch to the boot program)
* was specified in the boot flags.
*/
if (boothowto & RB_KDB) {
Debugger();
}
#if 1 /* stan set to 0 [10-14-91] */
/*
* XXX Until bootcube or something else allows us to dynamically
* XXX provide boot options, always ask root and bootstrap names.
*/
boothowto |= RB_ASKNAME;
boothowto |= (RB_ASKNAME << RB_SHIFT);
#endif
#endif MACH_KDB
printf("EXPERIMENTAL ");
printf(version);
#if 0
{
int i;
db_printf("boot magic:\n");
for (i = 0; bootenv[i]; i++) {
db_printf("%d %x %s\n", i, bootenv[i], bootenv[i]);
}
}
#endif
machine_slot[0].is_cpu = TRUE;
machine_slot[0].running = TRUE;
machine_slot[0].cpu_type = CPU_TYPE_I386;
machine_slot[0].cpu_subtype = CPU_SUBTYPE_iPSC386;
/*
* Start the system.
*/
setup_main();
}
示例4: zs_attach
int
zs_attach(device_t dev)
{
struct device *child[ZS_NCHAN];
struct zs_softc *sc;
int i;
sc = device_get_softc(dev);
sc->sc_dev = dev;
for (i = 0; i < ZS_NCHAN; i++)
child[i] = device_add_child(dev, "zstty", -1);
bus_generic_attach(dev);
for (i = 0; i < ZS_NCHAN; i++)
sc->sc_child[i] = device_get_softc(child[i]);
swi_add(&tty_ithd, "tty:zs", zs_softintr, sc, SWI_TTY,
INTR_TYPE_TTY, &sc->sc_softih);
ZS_WRITE_REG(sc->sc_child[0], 2, sc->sc_child[0]->sc_creg[2]);
ZS_WRITE_REG(sc->sc_child[0], 9, sc->sc_child[0]->sc_creg[9]);
if (zstty_cons != NULL) {
DELAY(50000);
cninit();
}
EVENTHANDLER_REGISTER(shutdown_final, zs_shutdown, sc,
SHUTDOWN_PRI_DEFAULT);
return (0);
}
示例5: main
int
main()
{
const char *envvar;
cninit();
/*
* Figure out whether we are running on a Gdium system, which
* has an horribly castrated PMON. If we do, the best we can do
* is boot an initrd image.
*/
envvar = pmon_getenv("Version");
if (envvar != NULL && strncmp(envvar, "Gdium", 5) == 0)
is_gdium = 1;
/*
* Check if we have a valid initrd loaded.
*/
envvar = pmon_getenv("rd");
if (envvar != NULL && *envvar != '\0')
boot_rd = rd_isvalid();
if (boot_rd != 0)
bootprompt = 0;
boot(boot_rd);
return 0;
}
示例6: consinit
/*
* Console initialization: called early on from main,
* before vm init or cpu_startup. This system is able
* to use the console for output immediately (via PROM)
* but can not use it for input until after this point.
*/
void
consinit(void)
{
/*
* Switch from the PROM console (output only)
* to our own console driver.
*/
cninit();
#if NKSYMS || defined(DDB) || defined(LKM)
{
extern int nsym;
extern char *ssym, *esym;
ksyms_init(nsym, ssym, esym);
}
#endif /* DDB */
/*
* Now that the console can do input as well as
* output, consider stopping for a debugger.
*/
if (boothowto & RB_KDB) {
#ifdef KGDB
/* XXX - Ask on console for kgdb_dev? */
/* Note: this will just return if kgdb_dev==NODEV */
kgdb_connect(1);
#else /* KGDB */
/* Either DDB or no debugger (just PROM). */
Debugger();
#endif /* KGDB */
}
}
示例7: consinit
/*
* Console initialization: called early on from main, before vm init or startup.
* Do enough configuration to choose and initialize a console.
*/
void
consinit()
{
if (console_ok) {
return;
}
cninit();
console_ok = 1;
}
示例8: ofwoea_consinit
void
ofwoea_consinit(void)
{
static int initted = 0;
if (initted)
return;
initted = 1;
cninit();
}
示例9: consinit
/*
* consinit:
* initialize the system console.
*
* XXX - shouldn't deal with this initted thing, but then,
* it shouldn't be called from init386 either.
*/
void
consinit(void)
{
static int initted;
if (initted)
return;
initted = 1;
cninit();
}
示例10: consinit
void
consinit(void)
{
static int consinit_called = 0;
if (consinit_called != 0)
return;
consinit_called = 1;
/* No serial console for now ? hmm... should be in constab */
cninit();
}
示例11: consinit
void
consinit(void)
{
static int consinit_called = 0;
if (consinit_called != 0)
return;
consinit_called = 1;
if (bootinfo->bi_cnuse == BI_CNUSE_SERIAL) {
cninit();
}
}
示例12: consinit
/*
* Early console initialization: called early on from main, before vm init.
* We want to stick to the BUG routines for now, and we'll switch to the
* real console in cpu_startup().
*/
void
consinit()
{
cn_tab = NULL;
cninit();
#if defined(DDB)
db_machine_init();
ddb_init();
if (boothowto & RB_KDB)
Debugger();
#endif
}
示例13: platform_start
void
platform_start(__register_t a0, __register_t a1, __register_t a2,
__register_t a3)
{
vm_offset_t kernend;
uint64_t platform_counter_freq;
int argc = a0;
char **argv = (char **)a1;
char **envp = (char **)a2;
int i;
/* clear the BSS and SBSS segments */
kernend = (vm_offset_t)&end;
memset(&edata, 0, kernend - (vm_offset_t)(&edata));
mips_postboot_fixup();
mips_pcpu0_init();
/*
* XXXRW: Support for the gxemul real-time clock required in order to
* usefully determine our emulated timer frequency. Go with something
* classic as the default in the mean time.
*/
platform_counter_freq = MIPS_DEFAULT_HZ;
mips_timer_early_init(platform_counter_freq);
cninit();
printf("entry: platform_start()\n");
bootverbose = 1;
if (bootverbose) {
printf("cmd line: ");
for (i = 0; i < argc; i++)
printf("%s ", argv[i]);
printf("\n");
if (envp != NULL) {
printf("envp:\n");
for (i = 0; envp[i]; i += 2)
printf("\t%s = %s\n", envp[i], envp[i+1]);
} else {
printf("no envp.\n");
}
}
realmem = btoc(GXEMUL_MP_DEV_READ(GXEMUL_MP_DEV_MEMORY));
mips_init();
mips_timer_init_params(platform_counter_freq, 0);
}
示例14: platform_start
void
platform_start(__register_t a0, __register_t a1, __register_t a2,
__register_t a3)
{
vm_offset_t kernend;
uint64_t platform_counter_freq;
int argc = a0;
int32_t *argv = (int32_t*)a1;
int32_t *envp = (int32_t*)a2;
unsigned int memsize = a3;
int i;
/* clear the BSS and SBSS segments */
kernend = (vm_offset_t)&end;
memset(&edata, 0, kernend - (vm_offset_t)(&edata));
mips_postboot_fixup();
mips_pcpu0_init();
platform_counter_freq = malta_cpu_freq();
mips_timer_early_init(platform_counter_freq);
init_static_kenv(boot1_env, sizeof(boot1_env));
cninit();
printf("entry: platform_start()\n");
bootverbose = 1;
/*
* YAMON uses 32bit pointers to strings so
* convert them to proper type manually
*/
if (bootverbose) {
printf("cmd line: ");
for (i = 0; i < argc; i++)
printf("%s ", (char*)(intptr_t)argv[i]);
printf("\n");
printf("envp:\n");
for (i = 0; envp[i]; i += 2)
printf("\t%s = %s\n", (char*)(intptr_t)envp[i],
(char*)(intptr_t)envp[i+1]);
printf("memsize = %08x\n", memsize);
}
realmem = btoc(memsize);
mips_init();
mips_timer_init_params(platform_counter_freq, 0);
}
示例15: machdep
void
machdep()
{
pdc_init();
#ifdef notyet
debug_init();
#endif
cninit();
#ifdef PDCDEBUG
if (debug) {
printf("SSTOR:\n");
printf("pri_boot="); DEVPATH_PRINT(&sstor.ss_pri_boot);
printf("alt_boot="); DEVPATH_PRINT(&sstor.ss_alt_boot);
printf("console ="); DEVPATH_PRINT(&sstor.ss_console);
printf("keyboard="); DEVPATH_PRINT(&sstor.ss_keyboard);
printf("mem=%d, fn=%s, osver=%d\n"
"os={%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,\n"
"%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x}\n",
sstor.ss_fast_size, sstor.ss_filenames,
sstor.ss_os_version,
sstor.ss_os[0], sstor.ss_os[1], sstor.ss_os[2],
sstor.ss_os[3], sstor.ss_os[4], sstor.ss_os[5],
sstor.ss_os[6], sstor.ss_os[7], sstor.ss_os[8],
sstor.ss_os[9], sstor.ss_os[10], sstor.ss_os[11],
sstor.ss_os[12], sstor.ss_os[13], sstor.ss_os[14],
sstor.ss_os[15], sstor.ss_os[16], sstor.ss_os[17],
sstor.ss_os[18], sstor.ss_os[19], sstor.ss_os[20],
sstor.ss_os[21]);
printf("PAGE0:\n");
printf("ivec=%x, pf=%p[%u], toc=%p[%u], rendz=%p\n"
"mem: cont=%u, phys=%u, pdc_spa=%u, resv=%u, free=%x\n"
"cpu_hpa=%p, pdc=%p, imm_hpa=%p[%u,%u]\n"
"soft=%u, tic/10ms=%u\n",
PAGE0->ivec_special, PAGE0->ivec_mempf,
PAGE0->ivec_mempflen, PAGE0->ivec_toc,
PAGE0->ivec_toclen, PAGE0->ivec_rendz,
PAGE0->memc_cont, PAGE0->memc_phsize, PAGE0->memc_adsize,
PAGE0->memc_resv, PAGE0->mem_free, PAGE0->mem_hpa,
PAGE0->mem_pdc, PAGE0->imm_hpa, PAGE0->imm_spa_size,
PAGE0->imm_max_mem, PAGE0->imm_soft_boot,
PAGE0->mem_10msec);
printf("console: "); PZDEV_PRINT(&PAGE0->mem_cons);
printf("boot: "); PZDEV_PRINT(&PAGE0->mem_boot);
printf("keyboard: "); PZDEV_PRINT(&PAGE0->mem_kbd);
}
#endif
}