blob: e28a188f68ca2fc75913482651b53d7c016a17be (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/*++
Copyright (c) 1995 FirePower Systems, Inc.
$RCSfile: vrcons.c $
$Revision: 1.6 $
$Date: 1996/02/17 00:34:54 $
$Locker: $
Copyright (c) 1994 FirmWorks, Mountain View CA USA. All rights reserved.
Module Name:
vrconsole.c
--*/
#include "veneer.h"
ihandle ConsoleIn = 0, ConsoleOut = 0;
/*
* Look up either the stdin or stdout and return an NT path to
* the device. The console argument should be either "stdin" or
* "stdout".
*/
PCHAR
VrFindConsolePath(char *console)
{
phandle chosen;
ihandle console_ih;
PCONFIGURATION_NODE node;
chosen = OFFinddevice("/chosen");
console_ih = get_int_prop(chosen, console);
if (console_ih == -1) {
return (NULL);
}
if (strcmp(console, "stdin") == 0) {
ConsoleIn = console_ih;
}
if (strcmp(console, "stdout") == 0) {
ConsoleOut = console_ih;
}
node = InstanceToNode(console_ih);
if (node == NULL) {
fatal("VrFindConsolePath: cannot locate %s node\n", console);
}
return (NodeToArcPath(node));
}
|