xref: /openbsd/sys/arch/hppa/stand/libsa/libsa.h (revision a4f11372)
1 /*	$OpenBSD: libsa.h,v 1.17 2023/02/23 19:48:22 miod Exp $	*/
2 
3 /*
4  * Copyright (c) 1998-2004 Michael Shalayeff
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
20  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
25  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26  * THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #include <lib/libsa/stand.h>
30 
31 #define	EXEC_ELF
32 #define	EXEC_SOM
33 
34 extern dev_t bootdev;
35 
36 void pdc_init(void);
37 struct pz_device;
38 struct pz_device *pdc_findev(int, int);
39 
40 int iodcstrategy(void *, int, daddr_t, size_t, void *, size_t *);
41 
42 int ctopen(struct open_file *, ...);
43 int ctclose(struct open_file *);
44 
45 int dkopen(struct open_file *, ...);
46 int dkclose(struct open_file *);
47 
48 int lfopen(struct open_file *, ...);
49 int lfstrategy(void *, int, daddr_t, size_t, void *, size_t *);
50 int lfclose(struct open_file *);
51 
52 void ite_probe(struct consdev *);
53 void ite_init(struct consdev *);
54 int ite_getc(dev_t);
55 void ite_putc(dev_t, int);
56 void ite_pollc(dev_t, int);
57 
58 void machdep(void);
59 void devboot(dev_t, char *);
60 void fcacheall(void);
61 void run_loadfile(uint64_t *marks, int howto);
62 
63 int lif_open(char *path, struct open_file *f);
64 int lif_close(struct open_file *f);
65 int lif_read(struct open_file *f, void *buf, size_t size, size_t *resid);
66 int lif_write(struct open_file *f, void *buf, size_t size, size_t *resid);
67 off_t lif_seek(struct open_file *f, off_t offset, int where);
68 int lif_stat(struct open_file *f, struct stat *sb);
69 int lif_readdir(struct open_file *f, char *name);
70 
71 union x_header;
72 struct x_param;
73 int som_probe(int, union x_header *);
74 int som_load(int, struct x_param *);
75 int som_ldsym(int, struct x_param *);
76 
77 extern int debug;
78 
79 #define	MACHINE_CMD	cmd_machine	/* we have hppa specific commands */
80