xref: /netbsd-src/sys/arch/hppa/stand/common/libsa.h (revision 6d3ceb1d619615401b17c9aa3e4bc674a1cb048b)
1 /*	$NetBSD: libsa.h,v 1.1 2014/02/24 07:23:43 skrll Exp $	*/
2 
3 /*	$OpenBSD: libsa.h,v 1.7 1999/12/23 04:07:47 mickey Exp $	*/
4 
5 /*
6  * Copyright (c) 1998-2004 Michael Shalayeff
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
22  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28  * THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #include <lib/libsa/stand.h>
32 #include <lib/libkern/libkern.h>
33 #include <dev/cons.h>
34 
35 #define	EXEC_ELF
36 /* #define	EXEC_ECOFF */
37 #define	EXEC_SOM
38 
39 #define	NENTS(a)	(sizeof(a) / sizeof(a[0]))
40 
41 typedef unsigned int btdev_t;
42 
43 extern	btdev_t bootdev;
44 
45 extern	struct consdev constab[];
46 extern	struct consdev *cn_tab;
47 int	cngetc(void);
48 int	tcngetc(void);
49 void	cnputc(int);
50 void	cninit(void);
51 int	tgetchar(void);
52 
53 void pdc_init(void);
54 struct pz_device;
55 struct pz_device *pdc_findev(int, int);
56 
57 int iodcstrategy(void *, int, daddr_t, size_t, void *, size_t *);
58 
59 int ctopen(struct open_file *, ...);
60 int ctclose(struct open_file *);
61 
62 int dkopen(struct open_file *, ...);
63 int dkclose(struct open_file *);
64 
65 int lfopen(struct open_file *, ...);
66 int lfstrategy(void *, int, daddr_t, size_t, void *, size_t *);
67 int lfclose(struct open_file *);
68 
69 void ite_probe(struct consdev *);
70 void ite_init(struct consdev *);
71 int ite_getc(dev_t);
72 void ite_putc(dev_t, int);
73 void ite_pollc(dev_t, int);
74 
75 void machdep(void);
76 void devboot(btdev_t, char *);
77 void fcacheall(void);
78 
79 int     lif_open(const char *, struct open_file *);
80 int     lif_close(struct open_file *);
81 int     lif_read(struct open_file *, void *, size_t, size_t *);
82 int     lif_write(struct open_file *, void *, size_t, size_t *);
83 off_t   lif_seek(struct open_file *, off_t, int);
84 int     lif_stat(struct open_file *, struct stat *);
85 int     lif_readdir(struct open_file *, char *);
86 
87 union x_header;
88 struct x_param;
89 int	som_probe(int, union x_header *);
90 int	som_load(int, struct x_param *);
91 int	som_ldsym(int, struct x_param *);
92 
93 extern int debug;
94 extern	char bootprog_name[], bootprog_rev[];
95