1276331Snwhitehorn/*- 2276410Snwhitehorn * Copyright (C) 2014 Nathan Whitehorn 3276331Snwhitehorn * All rights reserved. 4276331Snwhitehorn * 5276331Snwhitehorn * Redistribution and use in source and binary forms, with or without 6276331Snwhitehorn * modification, are permitted provided that the following conditions 7276331Snwhitehorn * are met: 8276331Snwhitehorn * 1. Redistributions of source code must retain the above copyright 9276331Snwhitehorn * notice, this list of conditions and the following disclaimer. 10276331Snwhitehorn * 2. Redistributions in binary form must reproduce the above copyright 11276331Snwhitehorn * notice, this list of conditions and the following disclaimer in the 12276331Snwhitehorn * documentation and/or other materials provided with the distribution. 13276331Snwhitehorn * 14276331Snwhitehorn * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15276331Snwhitehorn * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16276331Snwhitehorn * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17276331Snwhitehorn * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18276331Snwhitehorn * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19276331Snwhitehorn * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 20276331Snwhitehorn * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21276331Snwhitehorn * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22276331Snwhitehorn * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23276331Snwhitehorn * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24276331Snwhitehorn * 25276331Snwhitehorn * $FreeBSD: stable/11/stand/powerpc/kboot/host_syscall.h 329183 2018-02-12 20:51:28Z kevans $ 26276331Snwhitehorn */ 27276331Snwhitehorn 28276331Snwhitehorn#ifndef _HOST_SYSCALL_H 29276331Snwhitehorn#define _HOST_SYSCALL_H 30276331Snwhitehorn 31276331Snwhitehorn#include <stand.h> 32276331Snwhitehorn 33276331Snwhitehornssize_t host_read(int fd, void *buf, size_t nbyte); 34276331Snwhitehornssize_t host_write(int fd, const void *buf, size_t nbyte); 35278020Snwhitehornssize_t host_seek(int fd, int64_t offset, int whence); 36329175Skevansint host_open(const char *path, int flags, int mode); 37329183Skevansssize_t host_llseek(int fd, int32_t offset_high, int32_t offset_lo, uint64_t *result, int whence); 38276331Snwhitehornint host_close(int fd); 39276410Snwhitehornvoid *host_mmap(void *addr, size_t len, int prot, int flags, int fd, int); 40276410Snwhitehorn#define host_getmem(size) host_mmap(0, size, 3 /* RW */, 0x22 /* ANON */, -1, 0); 41329183Skevansstruct old_utsname { 42329183Skevans char sysname[65]; 43329183Skevans char nodename[65]; 44329183Skevans char release[65]; 45329183Skevans char version[65]; 46329183Skevans char machine[65]; 47329183Skevans}; 48329183Skevansint host_uname(struct old_utsname *); 49276380Snwhitehornstruct host_timeval { 50276380Snwhitehorn int tv_sec; 51276380Snwhitehorn int tv_usec; 52276380Snwhitehorn}; 53276380Snwhitehornint host_gettimeofday(struct host_timeval *a, void *b); 54276380Snwhitehornint host_select(int nfds, long *readfds, long *writefds, long *exceptfds, 55276380Snwhitehorn struct host_timeval *timeout); 56329183Skevansint kexec_load(uint32_t start, int nsegs, uint32_t segs); 57329183Skevansint host_reboot(int, int, int, uint32_t); 58276506Snwhitehornint host_getdents(int fd, void *dirp, int count); 59276331Snwhitehorn 60276331Snwhitehorn#endif 61