Esempio n. 1
0
int vmm_printchars(struct vmm_chardev *cdev, char *ch, u32 num_ch, bool block)
{
	int i, rc;

	if (!ch || !num_ch) {
		return VMM_EFAIL;
	}

	if (stdio_init_done) {
		if (cdev) {
			rc = vmm_chardev_dowrite(cdev, (u8 *)ch, num_ch,
						 block) ? VMM_OK : VMM_EFAIL;
		} else {
			for (i = 0; i < num_ch; i++) {
				while ((rc = arch_defterm_putc((u8)ch[i])) && block);
			}
		}
	} else {
		for (i = 0; i < num_ch; i++) {
#if defined(ARCH_HAS_DEFTERM_EARLY_PRINT)
			arch_defterm_early_putc(ch[i]);
#else
			if (stdio_early_count < EARLY_BUF_SZ) {
				stdio_early_buffer[stdio_early_count] = ch[i];
				stdio_early_count++;
			}
#endif
		}
		rc = VMM_OK;
	}

	return rc;
}
Esempio n. 2
0
int vmm_printchars(struct vmm_chardev *cdev, char *ch, u32 num_ch, bool block)
{
	int i, rc;

	if (!ch || !num_ch) {
		return VMM_EFAIL;
	}

	if (stdio_init_done) {
		if (cdev) {
			rc = vmm_chardev_dowrite(cdev, (u8 *)ch, num_ch, NULL,
						 block) ? VMM_OK : VMM_EFAIL;
		} else {
			for (i = 0; i < num_ch; i++) {
				while ((rc = arch_defterm_putc((u8)ch[i])) && block);
			}
		}
	} else {
		for (i = 0; i < num_ch; i++) {
			arch_defterm_early_putc(ch[i]);
		}
		rc = VMM_OK;
	}

	return rc;
}
Esempio n. 3
0
void __init cpu_init(void)
{
#if defined(CONFIG_SMP)
	u32 cpu = vmm_smp_processor_id();

#if defined(ARCH_HAS_DEFTERM_EARLY_PRINT)
    arch_defterm_early_putc('0'+cpu);
#endif

	if (!cpu) { /* Primary CPU */
		vmm_init();
	} else { /* Secondary CPUs */
		vmm_init_secondary();
	}
#else
	/* Initialize VMM (APIs only available after this) */
	vmm_init();
#endif

	/* We will never come back here. */
	vmm_hang();
}