diff options
Diffstat (limited to 'usr/src/uts/sparc/io/consplat.c')
-rw-r--r-- | usr/src/uts/sparc/io/consplat.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/usr/src/uts/sparc/io/consplat.c b/usr/src/uts/sparc/io/consplat.c index 5c4bf29453..6ca09e0b3a 100644 --- a/usr/src/uts/sparc/io/consplat.c +++ b/usr/src/uts/sparc/io/consplat.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -243,3 +243,29 @@ plat_tem_get_prom_pos(uint32_t *row, uint32_t *col) { prom_get_tem_pos(row, col); } + +/* + * Find the path of the virtual console (if available on the + * current architecture). + * + * Returns: -1 if not found, else actual path length. + */ +int +plat_virtual_console_path(char **bufp) +{ + pnode_t pnode; + int buflen; + static char buf[OBP_MAXPATHLEN]; + + pnode = prom_finddevice("/virtual-devices/console"); + + if (pnode == OBP_BADNODE) + return (-1); + + if ((buflen = prom_phandle_to_path(pnode, buf, sizeof (buf))) < 0) + return (-1); + + *bufp = buf; + + return (buflen); +} |