host_syscall.h revision 329183
1177595Sweongyo/*-
2177595Sweongyo * Copyright (C) 2014 Nathan Whitehorn
3177595Sweongyo * All rights reserved.
4177595Sweongyo *
5177595Sweongyo * Redistribution and use in source and binary forms, with or without
6177595Sweongyo * modification, are permitted provided that the following conditions
7177595Sweongyo * are met:
8177595Sweongyo * 1. Redistributions of source code must retain the above copyright
9177595Sweongyo *    notice, this list of conditions and the following disclaimer.
10177595Sweongyo * 2. Redistributions in binary form must reproduce the above copyright
11177595Sweongyo *    notice, this list of conditions and the following disclaimer in the
12177595Sweongyo *    documentation and/or other materials provided with the distribution.
13177595Sweongyo *
14177595Sweongyo * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15177595Sweongyo * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16177595Sweongyo * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17177595Sweongyo * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18177595Sweongyo * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19177595Sweongyo * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20177595Sweongyo * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21177595Sweongyo * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22177595Sweongyo * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23177595Sweongyo * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24177595Sweongyo *
25177595Sweongyo * $FreeBSD: stable/11/stand/powerpc/kboot/host_syscall.h 329183 2018-02-12 20:51:28Z kevans $
26177595Sweongyo */
27177595Sweongyo
28177595Sweongyo#ifndef _HOST_SYSCALL_H
29177595Sweongyo#define _HOST_SYSCALL_H
30177595Sweongyo
31177595Sweongyo#include <stand.h>
32177595Sweongyo
33177595Sweongyossize_t host_read(int fd, void *buf, size_t nbyte);
34177595Sweongyossize_t host_write(int fd, const void *buf, size_t nbyte);
35177595Sweongyossize_t host_seek(int fd, int64_t offset, int whence);
36177595Sweongyoint host_open(const char *path, int flags, int mode);
37178354Ssamssize_t host_llseek(int fd, int32_t offset_high, int32_t offset_lo, uint64_t *result, int whence);
38178354Ssamint host_close(int fd);
39177595Sweongyovoid *host_mmap(void *addr, size_t len, int prot, int flags, int fd, int);
40177595Sweongyo#define host_getmem(size) host_mmap(0, size, 3 /* RW */, 0x22 /* ANON */, -1, 0);
41177595Sweongyostruct old_utsname {
42177595Sweongyo	char sysname[65];
43177595Sweongyo	char nodename[65];
44177595Sweongyo	char release[65];
45177595Sweongyo	char version[65];
46177595Sweongyo	char machine[65];
47177595Sweongyo};
48177595Sweongyoint host_uname(struct old_utsname *);
49177595Sweongyostruct host_timeval {
50177595Sweongyo	int tv_sec;
51257176Sglebius	int tv_usec;
52177595Sweongyo};
53177595Sweongyoint host_gettimeofday(struct host_timeval *a, void *b);
54177595Sweongyoint host_select(int nfds, long *readfds, long *writefds, long *exceptfds,
55177595Sweongyo    struct host_timeval *timeout);
56177595Sweongyoint kexec_load(uint32_t start, int nsegs, uint32_t segs);
57177595Sweongyoint host_reboot(int, int, int, uint32_t);
58177595Sweongyoint host_getdents(int fd, void *dirp, int count);
59177595Sweongyo
60177595Sweongyo#endif
61177595Sweongyo