コード例 #1
0
ファイル: vars.c プロジェクト: MarginC/kame
static int
Xtty()
{
    dev_t dev;

    if (cmd.argc != 2)
        printf(ttyname(0));
    else {
        dev = ttydev(cmd.argv[1]);
        if (dev == NODEV)
            printf("%s not a console device\n", cmd.argv[1]);
        else {
            printf("switching console to %s\n", cmd.argv[1]);
            if (cnset(dev))
                printf("%s console not present\n",
                       cmd.argv[1]);
        }
    }
    return 0;
}
コード例 #2
0
ファイル: machdep.c プロジェクト: avsm/openbsd-xen-sys
void
getbootinfo(char *bootinfo, int bootinfo_size)
{
	bootarg32_t *q;

#undef BOOTINFO_DEBUG
#ifdef BOOTINFO_DEBUG
	printf("bootargv:");
#endif

	for (q = (bootarg32_t *)bootinfo;
	    (q->ba_type != BOOTARG_END) &&
	    ((((char *)q) - bootinfo) < bootinfo_size);
	    q = (bootarg32_t *)(((char *)q) + q->ba_size)) {

		switch (q->ba_type) {
		case BOOTARG_MEMMAP:
			bios_memmap = (bios_memmap_t *)q->ba_arg;
#ifdef BOOTINFO_DEBUG
			printf(" memmap %p", bios_memmap);
#endif
			break;
		case BOOTARG_DISKINFO:
			bios_diskinfo = (bios_diskinfo_t *)q->ba_arg;
#ifdef BOOTINFO_DEBUG
			printf(" diskinfo %p", bios_diskinfo);
#endif
			break;
#if 0
#if NAPM > 0 || defined(DEBUG)
		case BOOTARG_APMINFO:
#ifdef BOOTINFO_DEBUG
			printf(" apminfo %p", q->ba_arg);
#endif
			apm = (bios_apminfo_t *)q->ba_arg;
			break;
#endif
#endif
		case BOOTARG_CKSUMLEN:
			bios_cksumlen = *(u_int32_t *)q->ba_arg;
#ifdef BOOTINFO_DEBUG
			printf(" cksumlen %d", bios_cksumlen);
#endif
			break;
#if 0
#if NPCI > 0
		case BOOTARG_PCIINFO:
			bios_pciinfo = (bios_pciinfo_t *)q->ba_arg;
#ifdef BOOTINFO_DEBUG
			printf(" pciinfo %p", bios_pciinfo);
#endif
			break;
#endif
#endif
		case BOOTARG_CONSDEV:
			if (q->ba_size >= sizeof(bios_consdev_t))
			{
				bios_consdev_t *cdp =
				    (bios_consdev_t*)q->ba_arg;
#include "com.h"
#if NCOM > 0
				extern int comdefaultrate; /* ic/com.c */
				comdefaultrate = cdp->conspeed;
#endif
#ifdef BOOTINFO_DEBUG
				printf(" console 0x%x:%d",
				    cdp->consdev, cdp->conspeed);
#endif
				cnset(cdp->consdev);
			}
			break;
#ifdef NFSCLIENT
		case BOOTARG_BOOTMAC:
			bios_bootmac = (bios_bootmac_t *)q->ba_arg;
			break;
#endif                 

		default:
#ifdef BOOTINFO_DEBUG
			printf(" unsupported arg (%d) %p", q->ba_type,
			    q->ba_arg);
#endif
			break;
		}
	}
#ifdef BOOTINFO_DEBUG
	printf("\n");
#endif
}