diff options
author | Yang Zhang <yang.z.zhang@intel.com> | 2015-08-28 09:58:54 +0800 |
---|---|---|
committer | Yang Zhang <yang.z.zhang@intel.com> | 2015-09-01 12:44:00 +0800 |
commit | e44e3482bdb4d0ebde2d8b41830ac2cdb07948fb (patch) | |
tree | 66b09f592c55df2878107a468a91d21506104d3f /qemu/roms/SLOF/clients/net-snk/include | |
parent | 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (diff) |
Add qemu 2.4.0
Change-Id: Ic99cbad4b61f8b127b7dc74d04576c0bcbaaf4f5
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Diffstat (limited to 'qemu/roms/SLOF/clients/net-snk/include')
-rw-r--r-- | qemu/roms/SLOF/clients/net-snk/include/crt0.h | 20 | ||||
-rw-r--r-- | qemu/roms/SLOF/clients/net-snk/include/fcntl.h | 25 | ||||
-rw-r--r-- | qemu/roms/SLOF/clients/net-snk/include/fileio.h | 31 | ||||
-rw-r--r-- | qemu/roms/SLOF/clients/net-snk/include/kernel.h | 33 | ||||
-rw-r--r-- | qemu/roms/SLOF/clients/net-snk/include/of.h | 70 | ||||
-rw-r--r-- | qemu/roms/SLOF/clients/net-snk/include/pci.h | 20 | ||||
-rw-r--r-- | qemu/roms/SLOF/clients/net-snk/include/rtas.h | 45 | ||||
-rw-r--r-- | qemu/roms/SLOF/clients/net-snk/include/sys/socket.h | 53 | ||||
-rw-r--r-- | qemu/roms/SLOF/clients/net-snk/include/time.h | 36 |
9 files changed, 333 insertions, 0 deletions
diff --git a/qemu/roms/SLOF/clients/net-snk/include/crt0.h b/qemu/roms/SLOF/clients/net-snk/include/crt0.h new file mode 100644 index 000000000..d8fce05c9 --- /dev/null +++ b/qemu/roms/SLOF/clients/net-snk/include/crt0.h @@ -0,0 +1,20 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + + +#ifndef _CRT0_H +#define _CRT0_H + +int gen_argv(const char *, int, char **); + + +#endif diff --git a/qemu/roms/SLOF/clients/net-snk/include/fcntl.h b/qemu/roms/SLOF/clients/net-snk/include/fcntl.h new file mode 100644 index 000000000..69de2cea3 --- /dev/null +++ b/qemu/roms/SLOF/clients/net-snk/include/fcntl.h @@ -0,0 +1,25 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + + +#ifndef _FCNTL_H +#define _FCNTL_H + +#define O_RDONLY 00 +#define O_WRONLY 01 +#define O_RDRW 02 + +#define SEEK_SET 0 +#define SEEK_CUR 1 +#define SEEK_END 2 + +#endif /* fcntl.h */ diff --git a/qemu/roms/SLOF/clients/net-snk/include/fileio.h b/qemu/roms/SLOF/clients/net-snk/include/fileio.h new file mode 100644 index 000000000..50f9650b2 --- /dev/null +++ b/qemu/roms/SLOF/clients/net-snk/include/fileio.h @@ -0,0 +1,31 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + +#ifndef FILEIO_H +#define FILEIO_H + +#include <of.h> + +#define FILEIO_TYPE_EMPTY 0 +#define FILEIO_TYPE_FILE 1 +#define FILEIO_TYPE_SOCKET 2 + +struct snk_fileio_type { + int type; + ihandle_t ih; +}; +typedef struct snk_fileio_type snk_fileio_t; + +#define FILEIO_MAX 32 +extern snk_fileio_t fd_array[FILEIO_MAX]; + +#endif diff --git a/qemu/roms/SLOF/clients/net-snk/include/kernel.h b/qemu/roms/SLOF/clients/net-snk/include/kernel.h new file mode 100644 index 000000000..4d6be2dc2 --- /dev/null +++ b/qemu/roms/SLOF/clients/net-snk/include/kernel.h @@ -0,0 +1,33 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + +#ifndef KERNEL_H +#define KERNEL_H + +#include <stddef.h> +#include <stdint.h> +#include <unistd.h> +#include <string.h> +#include <stdio.h> +#include <of.h> + +uint64_t get_time(void); +int getchar(void); + +void *malloc_aligned(size_t size, int align); + +int pre_open_ih(int fd, ihandle_t ih); + +void exception_forward(void); +void undo_exception(void); + +#endif diff --git a/qemu/roms/SLOF/clients/net-snk/include/of.h b/qemu/roms/SLOF/clients/net-snk/include/of.h new file mode 100644 index 000000000..22411ff98 --- /dev/null +++ b/qemu/roms/SLOF/clients/net-snk/include/of.h @@ -0,0 +1,70 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + +#ifndef OF_H +#define OF_H + +#include <stdint.h> +#include <stddef.h> + +#define p32 int +#define p32cast (int) (unsigned long) (void*) + +#define phandle_t p32 +#define ihandle_t p32 + +typedef struct +{ + unsigned int serv; + int nargs; + int nrets; + unsigned int args[16]; +} of_arg_t; + + +phandle_t of_finddevice (const char *); +phandle_t of_peer (phandle_t); +phandle_t of_child (phandle_t); +phandle_t of_parent (phandle_t); +phandle_t of_instance_to_package(ihandle_t ihandle); +int of_getprop (phandle_t, const char *, void *, int); +void * of_call_method_3 (const char *, ihandle_t, int); +int of_test(const char *name); +int of_interpret_1(void *s, void *ret); + +ihandle_t of_open (const char *); +void of_close(ihandle_t); +int of_read (ihandle_t , void*, int); +int of_write (ihandle_t, void*, int); +int of_seek (ihandle_t, int, int); + +void * of_claim(void *, unsigned int , unsigned int ); +void of_release(void *, unsigned int ); + +int of_yield(void); +void * of_set_callback(void *); + +unsigned int romfs_lookup(const char *, void **); +int vpd_read(unsigned int , unsigned int , char *); +int vpd_write(unsigned int , unsigned int , char *); +int write_mm_log(char *, unsigned int , unsigned short ); + +int of_get_mac(phandle_t device, char *mac); +uint64_t get_puid(phandle_t node); +void translate_address_dev(uint64_t *, phandle_t); +void translate_address(unsigned long *addr); + +int of_glue_init(unsigned int * timebase, + size_t _client_start, size_t _client_size); +void of_glue_release(void); + +#endif diff --git a/qemu/roms/SLOF/clients/net-snk/include/pci.h b/qemu/roms/SLOF/clients/net-snk/include/pci.h new file mode 100644 index 000000000..cf584c348 --- /dev/null +++ b/qemu/roms/SLOF/clients/net-snk/include/pci.h @@ -0,0 +1,20 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + + +#ifndef _PCI_H +#define _PCI_H + +unsigned int read_io(void *addr, size_t sz); +int write_io(void *addr, unsigned int value, size_t sz); + +#endif diff --git a/qemu/roms/SLOF/clients/net-snk/include/rtas.h b/qemu/roms/SLOF/clients/net-snk/include/rtas.h new file mode 100644 index 000000000..25cabf4d6 --- /dev/null +++ b/qemu/roms/SLOF/clients/net-snk/include/rtas.h @@ -0,0 +1,45 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + + +#ifndef RTAS_H +#define RTAS_H + +#include "of.h" + +typedef struct dtime { + unsigned int year; + unsigned int month; + unsigned int day; + unsigned int hour; + unsigned int minute; + unsigned int second; + unsigned int nano; +} dtime; + +typedef void (*thread_t) (int); + +int rtas_token(const char *); +int rtas_call(int, int, int, int *, ...); +void rtas_init(void); +int rtas_pci_config_read (long long, int, int, int, int); +int rtas_pci_config_write (long long, int, int, int, int, int); +int rtas_set_time_of_day(dtime *); +int rtas_get_time_of_day(dtime *); +int rtas_ibm_update_flash_64(long long, long long); +int rtas_ibm_update_flash_64_and_reboot(long long, long long); +int rtas_system_reboot(void); +int rtas_start_cpu (int, thread_t, int); +int rtas_stop_self (void); +int rtas_ibm_manage_flash(int); + +#endif diff --git a/qemu/roms/SLOF/clients/net-snk/include/sys/socket.h b/qemu/roms/SLOF/clients/net-snk/include/sys/socket.h new file mode 100644 index 000000000..e9175be37 --- /dev/null +++ b/qemu/roms/SLOF/clients/net-snk/include/sys/socket.h @@ -0,0 +1,53 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + + +#ifndef _SOCKET_H +#define _SOCKET_H +#include <stdint.h> + +#define AF_PACKET 0 +#define AF_INET 1 +#define AF_INET6 2 + +#define SOCK_RAW 0 +#define SOCK_PACKET 1 +#define SOCK_DGRAM 2 +#define SOCK_STREAM 3 + +#define INADDR_ANY 0xFFFFFFFF + +#define IPPROTO_UDP 1 + +#define ETH_ALEN 6 /**< HW address length */ + +struct sockaddr { + uint16_t tra_port; + + uint16_t ipv4_proto; + uint32_t ipv4_addr; + + // protocol field is only used by "connect"-handler + uint16_t llc_proto; + uint8_t mac_addr[ETH_ALEN]; +}; + +int socket(int, int, int, char *); +int sendto(int, const void *, int, int, const void *, int); +int send(int, const void *, int, int); +int recv(int, void *, int, int); + +#define htonl(x) x +#define htons(x) x + +#endif + diff --git a/qemu/roms/SLOF/clients/net-snk/include/time.h b/qemu/roms/SLOF/clients/net-snk/include/time.h new file mode 100644 index 000000000..14d1c4c57 --- /dev/null +++ b/qemu/roms/SLOF/clients/net-snk/include/time.h @@ -0,0 +1,36 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + + +#ifndef _TIME_H_ +#define _TIME_H_ + +typedef unsigned long clock_t; +typedef unsigned long time_t; + +time_t time(time_t *); + +extern unsigned long tb_freq; + +/* setup the timer to start counting from the given parameter */ +void set_timer(int); +/* read the current value from the decrementer */ +int get_timer(void); +/* get the number of ticks for which the decrementer needs 1 second */ +int get_sec_ticks(void); +/* get the number of ticks for which the decrementer needs 1 millisecond */ +int get_msec_ticks(void); + +#define TICKS_MSEC get_msec_ticks() +#define TICKS_SEC get_sec_ticks() + +#endif |