libski.h revision 83408
113901Salanb/*- 217408Salanb * Copyright (c) 2001 Doug Rabson 313901Salanb * All rights reserved. 413901Salanb * 513901Salanb * Redistribution and use in source and binary forms, with or without 613901Salanb * modification, are permitted provided that the following conditions 713901Salanb * are met: 813901Salanb * 1. Redistributions of source code must retain the above copyright 913901Salanb * notice, this list of conditions and the following disclaimer. 1013901Salanb * 2. Redistributions in binary form must reproduce the above copyright 1113901Salanb * notice, this list of conditions and the following disclaimer in the 1213901Salanb * documentation and/or other materials provided with the distribution. 1313901Salanb * 1413901Salanb * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1513901Salanb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1613901Salanb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1713901Salanb * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1813901Salanb * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1913901Salanb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2013901Salanb * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2113901Salanb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2213901Salanb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2313901Salanb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2413901Salanb * SUCH DAMAGE. 2516642Sredestad * 2616642Sredestad * $FreeBSD: head/sys/boot/ia64/ski/libski.h 83408 2001-09-13 12:49:02Z dfr $ 2713901Salanb */ 2813901Salanb 2916642Sredestad/* 3013901Salanb * SKI fully-qualified device descriptor 3113901Salanb */ 3217000Salanbstruct ski_devdesc { 3313901Salanb struct devsw *d_dev; 3416642Sredestad int d_type; 3516642Sredestad#define DEVT_NONE 0 3616642Sredestad#define DEVT_DISK 1 3717000Salanb#define DEVT_NET 2 3816642Sredestad union { 3916642Sredestad struct { 4016642Sredestad int unit; 4116642Sredestad int slice; 4216642Sredestad int partition; 4316642Sredestad } skidisk; 4416642Sredestad struct { 4516642Sredestad int unit; /* XXX net layer lives over these? */ 4616642Sredestad } netif; 4716642Sredestad } d_kind; 4816642Sredestad}; 4916642Sredestad 5016642Sredestadextern int ski_getdev(void **vdev, const char *devspec, const char **path); 5116642Sredestadextern char *ski_fmtdev(void *vdev); 5216642Sredestadextern int ski_setcurrdev(struct env_var *ev, int flags, void *value); 5316642Sredestad 5416642Sredestad#define MAXDEV 31 /* maximum number of distinct devices */ 5516642Sredestad 5616642Sredestadtypedef unsigned long physaddr_t; 5716642Sredestad 5816642Sredestad/* exported devices XXX rename? */ 5916642Sredestadextern struct devsw skifs_dev; 6016642Sredestadextern struct devsw ski_disk; 6116642Sredestadextern struct netif_driver ski_net; 6216642Sredestad 6316642Sredestad/* Wrapper over SKI filesystems. */ 6416642Sredestadextern struct fs_ops ski_fsops; 6516642Sredestad 6616642Sredestad/* this is in startup code */ 6716642Sredestadextern void delay(int); 6816642Sredestadextern void reboot(void); 6916642Sredestad 7013901Salanbextern ssize_t ski_copyin(const void *src, vm_offset_t dest, size_t len); 7117000Salanbextern ssize_t ski_copyout(const vm_offset_t src, void *dest, size_t len); 7216177Salanbextern ssize_t ski_readin(int fd, vm_offset_t dest, size_t len); 7316177Salanb 7413901Salanbextern int ski_boot(void); 7516642Sredestadextern int ski_autoload(void); 7616642Sredestad 7716642Sredestadstruct bootinfo; 7816642Sredestadstruct preloaded_file; 7916642Sredestadextern int bi_load(struct bootinfo *, struct preloaded_file *); 8016642Sredestad 8116937Salanb#define SSC_CONSOLE_INIT 20 8216937Salanb#define SSC_GETCHAR 21 8316937Salanb#define SSC_PUTCHAR 31 8416642Sredestad#define SSC_OPEN 50 8516642Sredestad#define SSC_CLOSE 51 8616937Salanb#define SSC_READ 52 8716937Salanb#define SSC_WRITE 53 8816937Salanb#define SSC_GET_COMPLETION 54 8916937Salanb#define SSC_WAIT_COMPLETION 55 9016937Salanb#define SSC_EXIT 66 9116642Sredestad#define SSC_LOAD_SYMBOLS 69 9216642Sredestad 9316642Sredestadu_int64_t ssc(u_int64_t in0, u_int64_t in1, u_int64_t in2, u_int64_t in3, 9416937Salanb int which); 9516642Sredestad