17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 528cdc3d7Sszhou * Common Development and Distribution License (the "License"). 628cdc3d7Sszhou * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 220d928757SGary Mills * Copyright (c) 2012 Gary Mills 23*2e6e9b6bSJohn Levon * Copyright 2020 Joyent, Inc. 240d928757SGary Mills * 2567ce1dadSJan Setje-Eilers * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 267c478bd9Sstevel@tonic-gate * Use is subject to license terms. 277c478bd9Sstevel@tonic-gate */ 287c478bd9Sstevel@tonic-gate 29ae115bc7Smrj /* 30ae115bc7Smrj * This file is shared between dboot and the kernel. 31ae115bc7Smrj */ 32ae115bc7Smrj 33ae115bc7Smrj #ifndef _BOOT_CONSOLE_H 34ae115bc7Smrj #define _BOOT_CONSOLE_H 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate #ifdef __cplusplus 377c478bd9Sstevel@tonic-gate extern "C" { 387c478bd9Sstevel@tonic-gate #endif 397c478bd9Sstevel@tonic-gate 40f289ce6eSToomas Soome #include <sys/bootinfo.h> 41f289ce6eSToomas Soome 427c478bd9Sstevel@tonic-gate #define CONS_INVALID -1 437c478bd9Sstevel@tonic-gate #define CONS_SCREEN_TEXT 0 440d928757SGary Mills #define CONS_TTY 1 450d928757SGary Mills #define CONS_XXX 2 /* Unused */ 46ae115bc7Smrj #define CONS_USBSER 3 47843e1988Sjohnlev #define CONS_HYPERVISOR 4 4867ce1dadSJan Setje-Eilers #define CONS_SCREEN_GRAPHICS 5 498e6d016fSToomas Soome #define CONS_FRAMEBUFFER 6 50843e1988Sjohnlev 51843e1988Sjohnlev #define CONS_MIN CONS_SCREEN_TEXT 528e6d016fSToomas Soome #define CONS_MAX CONS_FRAMEBUFFER 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate #define CONS_COLOR 7 557c478bd9Sstevel@tonic-gate 567c478bd9Sstevel@tonic-gate extern void kb_init(void); 577c478bd9Sstevel@tonic-gate extern int kb_getchar(void); 587c478bd9Sstevel@tonic-gate extern int kb_ischar(void); 597c478bd9Sstevel@tonic-gate 60f289ce6eSToomas Soome /* Read property from command line or environment. */ 61f289ce6eSToomas Soome extern const char *find_boot_prop(const char *); 62f289ce6eSToomas Soome 630d928757SGary Mills extern int boot_console_type(int *); 640d928757SGary Mills 65f289ce6eSToomas Soome extern void bcons_init(struct xboot_info *); 66ae115bc7Smrj extern void bcons_putchar(int); 67ae115bc7Smrj extern int bcons_getchar(void); 68ae115bc7Smrj extern int bcons_ischar(void); 69ae115bc7Smrj extern int bcons_gets(char *, int); 70ae115bc7Smrj 71843e1988Sjohnlev #if !defined(_BOOT) 72*2e6e9b6bSJohn Levon extern void bcons_post_bootenvrc(char *, char *, char *); 73843e1988Sjohnlev extern boolean_t bcons_hypervisor_redirect(void); 74843e1988Sjohnlev extern void bcons_device_change(int); 75843e1988Sjohnlev #endif /* !_BOOT */ 76843e1988Sjohnlev 777c478bd9Sstevel@tonic-gate #ifdef __cplusplus 787c478bd9Sstevel@tonic-gate } 797c478bd9Sstevel@tonic-gate #endif 807c478bd9Sstevel@tonic-gate 81ae115bc7Smrj #endif /* _BOOT_CONSOLE_H */ 82