Merge branch 'master' into ohligs
Conflicts: .gitignore kernel/syscall.c kernel/tasks.c kernel/tests.c newlib/examples/Makefile
This commit is contained in:
commit
5c7e9f38ec
64 changed files with 2605 additions and 358 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -19,6 +19,8 @@ newlib/examples/jacobi
|
||||||
newlib/examples/echo
|
newlib/examples/echo
|
||||||
newlib/examples/tests
|
newlib/examples/tests
|
||||||
newlib/examples/mshell
|
newlib/examples/mshell
|
||||||
|
newlib/examples/server
|
||||||
|
newlib/examples/client
|
||||||
newlib/tmp/*
|
newlib/tmp/*
|
||||||
newlib/x86/*
|
newlib/x86/*
|
||||||
metalsvm.elf
|
metalsvm.elf
|
||||||
|
|
|
@ -2,7 +2,7 @@ TOPDIR = $(shell pwd)
|
||||||
ARCH = x86
|
ARCH = x86
|
||||||
NAME = metalsvm
|
NAME = metalsvm
|
||||||
LWIPDIRS = lwip/src/arch lwip/src/api lwip/src/core lwip/src/core/ipv4 lwip/src/netif
|
LWIPDIRS = lwip/src/arch lwip/src/api lwip/src/core lwip/src/core/ipv4 lwip/src/netif
|
||||||
DRIVERDIRS = drivers/net drivers/char drivers/stdin drivers/stdout drivers/stderr
|
DRIVERDIRS = drivers/net drivers/char drivers/stdin drivers/stdout drivers/stderr drivers/net_char
|
||||||
KERNDIRS = libkern kernel mm fs arch/$(ARCH)/kernel arch/$(ARCH)/mm arch/$(ARCH)/scc $(LWIPDIRS) $(DRIVERDIRS)
|
KERNDIRS = libkern kernel mm fs arch/$(ARCH)/kernel arch/$(ARCH)/mm arch/$(ARCH)/scc $(LWIPDIRS) $(DRIVERDIRS)
|
||||||
SUBDIRS = $(KERNDIRS)
|
SUBDIRS = $(KERNDIRS)
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,36 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -730,12 +730,6 @@ int arch_paging_init(void)
|
||||||
// map SCC's bootinfo
|
// map SCC's bootinfo
|
||||||
map_region(SCC_BOOTINFO, SCC_BOOTINFO, 1, MAP_KERNEL_SPACE);
|
map_region(SCC_BOOTINFO, SCC_BOOTINFO, 1, MAP_KERNEL_SPACE);
|
||||||
|
|
||||||
// map the initial ramdisk
|
|
||||||
npages = bootinfo->size >> PAGE_SHIFT;
|
|
||||||
if (bootinfo->size & (PAGE_SIZE-1))
|
|
||||||
npages++;
|
|
||||||
map_region(bootinfo->addr, bootinfo->addr, npages, MAP_KERNEL_SPACE);
|
|
||||||
|
|
||||||
// map SCC's configuration registers
|
// map SCC's configuration registers
|
||||||
viraddr = map_region(CRB_X0_Y0, CRB_X0_Y0, (CRB_OWN-CRB_X0_Y0+16*1024*1024) >> PAGE_SHIFT, MAP_KERNEL_SPACE|MAP_NO_CACHE);
|
viraddr = map_region(CRB_X0_Y0, CRB_X0_Y0, (CRB_OWN-CRB_X0_Y0+16*1024*1024) >> PAGE_SHIFT, MAP_KERNEL_SPACE|MAP_NO_CACHE);
|
||||||
kprintf("Map configuration registers at 0x%x\n", viraddr);
|
kprintf("Map configuration registers at 0x%x\n", viraddr);
|
||||||
|
@ -756,6 +750,15 @@ int arch_paging_init(void)
|
||||||
write_cr0(i);
|
write_cr0(i);
|
||||||
paging_enabled = 1;
|
paging_enabled = 1;
|
||||||
|
|
||||||
|
#ifdef CONFIG_ROCKCREEK
|
||||||
|
// map the initial ramdisk
|
||||||
|
npages = bootinfo->size >> PAGE_SHIFT;
|
||||||
|
if (bootinfo->size & (PAGE_SIZE-1))
|
||||||
|
npages++;
|
||||||
|
bootinfo->addr = map_region(0, bootinfo->addr, npages, MAP_KERNEL_SPACE);
|
||||||
|
kprintf("Map initrd at 0x%x (size %u bytes)\n", bootinfo->addr, bootinfo->size);
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* we turned on paging
|
* we turned on paging
|
||||||
* => now, we are able to register our task for Task State Switching
|
* => now, we are able to register our task for Task State Switching
|
||||||
|
|
143
drivers/net_char/net_char.c
Executable file
143
drivers/net_char/net_char.c
Executable file
|
@ -0,0 +1,143 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
* This file is part of MetalSVM.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <metalsvm/stdlib.h>
|
||||||
|
#include <metalsvm/string.h>
|
||||||
|
#include <metalsvm/stdio.h>
|
||||||
|
#include <metalsvm/errno.h>
|
||||||
|
#include <metalsvm/fs.h>
|
||||||
|
#include <metalsvm/spinlock.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_LWIP) && LWIP_SOCKET
|
||||||
|
#include <lwip/mem.h>
|
||||||
|
#include <lwip/raw.h>
|
||||||
|
#include <lwip/icmp.h>
|
||||||
|
#include <lwip/netif.h>
|
||||||
|
#include <lwip/sys.h>
|
||||||
|
#include <lwip/timers.h>
|
||||||
|
#include <lwip/inet_chksum.h>
|
||||||
|
#include <lwip/ip.h>
|
||||||
|
#include <lwip/sockets.h>
|
||||||
|
#include <lwip/inet.h>
|
||||||
|
#include <lwip/err.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Implementation of a simple stdout device */
|
||||||
|
|
||||||
|
static ssize_t net_stdout_read(fildes_t* file, uint8_t* buffer, size_t size)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
#if defined(CONFIG_LWIP) && LWIP_SOCKET
|
||||||
|
ret = lwip_read(file->offset, buffer, size);
|
||||||
|
if (ret < 0)
|
||||||
|
ret = -errno;
|
||||||
|
#else
|
||||||
|
ret = -EINVAL;
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ssize_t net_stdout_write(fildes_t* file, uint8_t* buffer, size_t size)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
#if defined(CONFIG_LWIP) && LWIP_SOCKET
|
||||||
|
ret = lwip_write(file->offset, buffer, size);
|
||||||
|
if (ret < 0)
|
||||||
|
ret = -errno;
|
||||||
|
#else
|
||||||
|
ret = -EINVAL;
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int net_stdout_open(fildes_t* file, const char* name)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int net_stdout_close(vfs_node_t* node) //////////////change this in File!!!
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
#if defined(CONFIG_LWIP) && LWIP_SOCKET
|
||||||
|
ret = lwip_close(file->offset);
|
||||||
|
if (ret < 0)
|
||||||
|
ret = -errno;
|
||||||
|
#else
|
||||||
|
ret = 0;
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int net_stdout_init(vfs_node_t* node, const char* name)
|
||||||
|
{
|
||||||
|
uint32_t i, j;
|
||||||
|
vfs_node_t* new_node;
|
||||||
|
dir_block_t* blockdir;
|
||||||
|
dirent_t* dirent;
|
||||||
|
block_list_t* blist;
|
||||||
|
|
||||||
|
if (BUILTIN_EXPECT(!node || !name, 0))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (BUILTIN_EXPECT(node->type != FS_DIRECTORY, 0))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (finddir_fs(node, name))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
new_node = kmalloc(sizeof(vfs_node_t));
|
||||||
|
if (BUILTIN_EXPECT(!new_node, 0))
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
memset(new_node, 0x00, sizeof(vfs_node_t));
|
||||||
|
new_node->type = FS_CHARDEVICE;
|
||||||
|
new_node->open = &net_stdout_open;
|
||||||
|
new_node->close = &net_stdout_close;
|
||||||
|
new_node->read = &net_stdout_read;
|
||||||
|
new_node->write = &net_stdout_write;
|
||||||
|
spinlock_init(&new_node->lock);
|
||||||
|
|
||||||
|
blist= &node->block_list;
|
||||||
|
do {
|
||||||
|
for(i=0; i<MAX_DATABLOCKS; i++) {
|
||||||
|
if (blist->data[i]) {
|
||||||
|
blockdir = (dir_block_t*) blist->data[i];
|
||||||
|
for(j=0; j<MAX_DIRENTRIES; j++) {
|
||||||
|
dirent = &blockdir->entries[j];
|
||||||
|
if (!dirent->vfs_node) {
|
||||||
|
dirent->vfs_node = new_node;
|
||||||
|
strncpy(dirent->name, name, MAX_FNAME);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!blist->next) {
|
||||||
|
blist->next = (block_list_t*) kmalloc(sizeof(block_list_t));
|
||||||
|
if (blist->next)
|
||||||
|
memset(blist->next, 0x00, sizeof(block_list_t));
|
||||||
|
}
|
||||||
|
|
||||||
|
} while(blist);
|
||||||
|
|
||||||
|
kfree(new_node, sizeof(vfs_node_t));
|
||||||
|
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
|
@ -1,20 +1,36 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,6 +66,14 @@ extern "C" {
|
||||||
#define __NR_wait 13
|
#define __NR_wait 13
|
||||||
#define __NR_execve 14
|
#define __NR_execve 14
|
||||||
#define __NR_times 15
|
#define __NR_times 15
|
||||||
|
#define __NR_accept 16
|
||||||
|
#define __NR_bind 17
|
||||||
|
#define __NR_closesocket 18
|
||||||
|
#define __NR_connect 19
|
||||||
|
#define __NR_listen 20
|
||||||
|
#define __NR_recv 21
|
||||||
|
#define __NR_send 22
|
||||||
|
#define __NR_socket 23
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,10 @@ typedef struct task {
|
||||||
uint32_t start_heap;
|
uint32_t start_heap;
|
||||||
/// End address of the heap
|
/// End address of the heap
|
||||||
uint32_t end_heap;
|
uint32_t end_heap;
|
||||||
|
#ifdef CONFIG_LWIP
|
||||||
|
/// LwIP error code
|
||||||
|
int lwip_err;
|
||||||
|
#endif
|
||||||
/// Mail inbox
|
/// Mail inbox
|
||||||
mailbox_wait_msg_t inbox;
|
mailbox_wait_msg_t inbox;
|
||||||
/// Mail outbox array
|
/// Mail outbox array
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
C_source := main.c tasks.c syscall.c tests.c echo.c ping.c init.c server.c client.c shell.c
|
C_source := main.c tasks.c syscall.c tests.c echo.c ping.c netio.c init.c server.c client.c shell.c
|
||||||
MODULE := kernel
|
MODULE := kernel
|
||||||
|
|
||||||
include $(TOPDIR)/Makefile.inc
|
include $(TOPDIR)/Makefile.inc
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
|
|
||||||
void echo_init(void);
|
void echo_init(void);
|
||||||
void ping_init(void);
|
void ping_init(void);
|
||||||
|
void netio_init(void);
|
||||||
int test_init(void);
|
int test_init(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -158,6 +159,7 @@ int network_init(void)
|
||||||
// start echo and ping server
|
// start echo and ping server
|
||||||
echo_init();
|
echo_init();
|
||||||
//ping_init();
|
//ping_init();
|
||||||
|
netio_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
62
kernel/netio.c
Normal file
62
kernel/netio.c
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
/*
|
||||||
|
* this example is derived from the netio example of the contrib-1.4.0
|
||||||
|
*
|
||||||
|
* see http://download.savannah.gnu.org/releases/lwip/
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <metalsvm/stddef.h>
|
||||||
|
#include <lwip/opt.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_LWIP)
|
||||||
|
|
||||||
|
#include <lwip/opt.h>
|
||||||
|
#include <lwip/tcp.h>
|
||||||
|
|
||||||
|
/* See http://www.nwlab.net/art/netio/netio.html to get the netio tool */
|
||||||
|
|
||||||
|
#if LWIP_TCP
|
||||||
|
static err_t netio_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
|
||||||
|
{
|
||||||
|
|
||||||
|
LWIP_UNUSED_ARG(arg);
|
||||||
|
|
||||||
|
if (err == ERR_OK && p != NULL) {
|
||||||
|
tcp_recved(pcb, p->tot_len);
|
||||||
|
pbuf_free(p);
|
||||||
|
} else {
|
||||||
|
pbuf_free(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (err == ERR_OK && p == NULL) {
|
||||||
|
tcp_arg(pcb, NULL);
|
||||||
|
tcp_sent(pcb, NULL);
|
||||||
|
tcp_recv(pcb, NULL);
|
||||||
|
tcp_close(pcb);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static err_t netio_accept(void *arg, struct tcp_pcb *pcb, err_t err)
|
||||||
|
{
|
||||||
|
LWIP_UNUSED_ARG(arg);
|
||||||
|
LWIP_UNUSED_ARG(err);
|
||||||
|
|
||||||
|
tcp_arg(pcb, NULL);
|
||||||
|
tcp_sent(pcb, NULL);
|
||||||
|
tcp_recv(pcb, netio_recv);
|
||||||
|
return ERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void netio_init(void)
|
||||||
|
{
|
||||||
|
struct tcp_pcb *pcb;
|
||||||
|
|
||||||
|
pcb = tcp_new();
|
||||||
|
tcp_bind(pcb, IP_ADDR_ANY, 18767);
|
||||||
|
pcb = tcp_listen(pcb);
|
||||||
|
tcp_accept(pcb, netio_accept);
|
||||||
|
}
|
||||||
|
#endif /* LWIP_TCP */
|
||||||
|
|
||||||
|
#endif
|
135
kernel/syscall.c
135
kernel/syscall.c
|
@ -25,6 +25,27 @@
|
||||||
#include <metalsvm/errno.h>
|
#include <metalsvm/errno.h>
|
||||||
#include <metalsvm/spinlock.h>
|
#include <metalsvm/spinlock.h>
|
||||||
#include <metalsvm/time.h>
|
#include <metalsvm/time.h>
|
||||||
|
#include <lwip/opt.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_LWIP) && LWIP_SOCKET
|
||||||
|
#include <lwip/mem.h>
|
||||||
|
#include <lwip/raw.h>
|
||||||
|
#include <lwip/icmp.h>
|
||||||
|
#include <lwip/netif.h>
|
||||||
|
#include <lwip/sys.h>
|
||||||
|
#include <lwip/timers.h>
|
||||||
|
#include <lwip/inet_chksum.h>
|
||||||
|
#include <lwip/ip.h>
|
||||||
|
#include <lwip/sockets.h>
|
||||||
|
#include <lwip/inet.h>
|
||||||
|
#include <lwip/err.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We set the a bit LWIP_FD_BIT to determine,
|
||||||
|
* if the descriptor belongs to LwIP or MetalSVM.
|
||||||
|
*/
|
||||||
|
#define LWIP_FD_BIT (1 << 28)
|
||||||
|
#endif
|
||||||
|
|
||||||
static int sys_open(const char* name, int flags, int mode)
|
static int sys_open(const char* name, int flags, int mode)
|
||||||
{
|
{
|
||||||
|
@ -53,6 +74,36 @@ static int sys_open(const char* name, int flags, int mode)
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_LWIP) && LWIP_SOCKET
|
||||||
|
static int sys_socket(int domain, int type, int protocol)
|
||||||
|
{
|
||||||
|
int fd, check;
|
||||||
|
fildes_t* file = NULL;
|
||||||
|
|
||||||
|
for (fd = 3; fd < NR_OPEN; fd++) {
|
||||||
|
if (per_core(current_task)->fildes_table[fd].node == NULL) {
|
||||||
|
file = &(per_core(current_task)->fildes_table[fd]);
|
||||||
|
file->offset = domain;
|
||||||
|
file->mode = type;
|
||||||
|
file->flags = protocol;
|
||||||
|
file->node = task_table[i].fildes_table[0].node = findnode_fs("/dev/net_char");
|
||||||
|
//check = open_fs(file, (char*) name); //////////////////////////////////////send to node!!!!TODO!!!
|
||||||
|
if (check < 0) {
|
||||||
|
/* lwip connection error! */
|
||||||
|
file->node = NULL;
|
||||||
|
return -errno;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fd >= NR_OPEN) {
|
||||||
|
return -EMFILE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int sys_close(int fd)
|
static int sys_close(int fd)
|
||||||
{
|
{
|
||||||
fildes_t* file = &(per_core(current_task)->fildes_table[fd]);
|
fildes_t* file = &(per_core(current_task)->fildes_table[fd]);
|
||||||
|
@ -211,6 +262,90 @@ int syscall_handler(uint32_t sys_nr, ...)
|
||||||
ret = sys_times(buffer, clock);
|
ret = sys_times(buffer, clock);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#if defined(CONFIG_LWIP) && LWIP_SOCKET
|
||||||
|
case __NR_closesocket: {
|
||||||
|
int fd = va_arg(vl, int);
|
||||||
|
|
||||||
|
if (BUILTIN_EXPECT(!(fd), 0)) {
|
||||||
|
ret = -ENOTSOCK;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = lwip_close(&(per_core(current_task)->fildes_table[fd]->offset));
|
||||||
|
if (ret < 0)
|
||||||
|
ret = -errno;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case __NR_socket: {
|
||||||
|
int domain = va_arg(vl, int);
|
||||||
|
int type = va_arg(vl, int);
|
||||||
|
int protocol = va_arg(vl, int);
|
||||||
|
|
||||||
|
ret = sys_socket(domain, type, protocol);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case __NR_connect: {
|
||||||
|
int fd = va_arg(vl, int);
|
||||||
|
const struct sockaddr* name = va_arg(vl, const struct sockaddr*);
|
||||||
|
socklen_t namelen = va_arg(vl, socklen_t);
|
||||||
|
|
||||||
|
if (BUILTIN_EXPECT(!(&(per_core(current_task)->fildes_table[fd]->offset)), 0)) {
|
||||||
|
ret = -ENOTSOCK;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = lwip_connect(&(per_core(current_task)->fildes_table[fd]->offset), name, namelen);
|
||||||
|
if (ret < 0)
|
||||||
|
ret = -errno;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case __NR_bind: {
|
||||||
|
int fd = va_arg(vl, int);
|
||||||
|
const struct sockaddr* name = va_arg(vl, const struct sockaddr*);
|
||||||
|
socklen_t namelen = va_arg(vl, socklen_t);
|
||||||
|
|
||||||
|
if (BUILTIN_EXPECT(!(&(per_core(current_task)->fildes_table[fd]->offset)), 0)) {
|
||||||
|
ret = -ENOTSOCK;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = lwip_bind(&(per_core(current_task)->fildes_table[fd]->offset), name, namelen);
|
||||||
|
if (ret < 0)
|
||||||
|
ret = -errno;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case __NR_listen:{
|
||||||
|
int fd = va_arg(vl, int);
|
||||||
|
int backlog = va_arg(vl, int);
|
||||||
|
|
||||||
|
if (BUILTIN_EXPECT(!(&(per_core(current_task)->fildes_table[fd]->offset)), 0)) {
|
||||||
|
ret = -ENOTSOCK;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = lwip_listen(&(per_core(current_task)->fildes_table[fd]->offset), backlog);
|
||||||
|
if (ret < 0)
|
||||||
|
ret = -errno;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case __NR_accept: {
|
||||||
|
int fd = va_arg(vl, int);
|
||||||
|
struct sockaddr* addr = va_arg(vl, struct sockaddr*);
|
||||||
|
socklen_t* addrlen = va_arg(vl, socklen_t*);
|
||||||
|
|
||||||
|
if (BUILTIN_EXPECT(!(&(per_core(current_task)->fildes_table[fd]->offset)), 0)) {
|
||||||
|
ret = -ENOTSOCK;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = lwip_accept(&(per_core(current_task)->fildes_table[fd]->offset), addr, addrlen);
|
||||||
|
if (ret >= 0)
|
||||||
|
ret |= LWIP_FD_BIT;
|
||||||
|
else
|
||||||
|
ret = -errno;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
kputs("invalid system call\n");
|
kputs("invalid system call\n");
|
||||||
ret = -ENOSYS;
|
ret = -ENOSYS;
|
||||||
|
|
|
@ -47,8 +47,8 @@
|
||||||
* A task's id will be its position in this array.
|
* A task's id will be its position in this array.
|
||||||
*/
|
*/
|
||||||
static task_t task_table[MAX_TASKS] = { \
|
static task_t task_table[MAX_TASKS] = { \
|
||||||
[0] = {0, TASK_IDLE, 0, 0, 0, ATOMIC_INIT(0), SPINLOCK_INIT, NULL, SPINLOCK_INIT, NULL, FS_INIT, 0, 0, 0}, \
|
[0] = {0, TASK_IDLE, 0, 0, 0, ATOMIC_INIT(0), SPINLOCK_INIT, NULL, SPINLOCK_INIT, NULL, FS_INIT, 0, 0, 0, 0}, \
|
||||||
[1 ... MAX_TASKS-1] = {0, TASK_INVALID, 0, 0, 0, ATOMIC_INIT(0), SPINLOCK_INIT, NULL, SPINLOCK_INIT, NULL, FS_INIT, 0, 0, 0}};
|
[1 ... MAX_TASKS-1] = {0, TASK_INVALID, 0, 0, 0, ATOMIC_INIT(0), SPINLOCK_INIT, NULL, SPINLOCK_INIT, NULL, FS_INIT, 0, 0, 0, 0}};
|
||||||
static spinlock_irqsave_t table_lock = SPINLOCK_IRQSAVE_INIT;
|
static spinlock_irqsave_t table_lock = SPINLOCK_IRQSAVE_INIT;
|
||||||
|
|
||||||
DEFINE_PER_CORE(task_t*, current_task, task_table+0);
|
DEFINE_PER_CORE(task_t*, current_task, task_table+0);
|
||||||
|
@ -246,6 +246,7 @@ static int create_task(tid_t* id, internal_entry_point_t ep, void* arg)
|
||||||
|
|
||||||
task_table[i].start_heap = 0;
|
task_table[i].start_heap = 0;
|
||||||
task_table[i].end_heap = 0;
|
task_table[i].end_heap = 0;
|
||||||
|
task_table[i].lwip_err = 0;
|
||||||
task_table[i].start_tick = get_clock_tick();
|
task_table[i].start_tick = get_clock_tick();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -315,6 +316,7 @@ int sys_fork(void)
|
||||||
task_table[i].start_tick = get_clock_tick();
|
task_table[i].start_tick = get_clock_tick();
|
||||||
task_table[i].start_heap = 0;
|
task_table[i].start_heap = 0;
|
||||||
task_table[i].end_heap = 0;
|
task_table[i].end_heap = 0;
|
||||||
|
task_table[i].lwip_err = 0;
|
||||||
|
|
||||||
ret = arch_fork(task_table+i);
|
ret = arch_fork(task_table+i);
|
||||||
|
|
||||||
|
@ -430,6 +432,7 @@ static int load_task(load_args_t* largs)
|
||||||
//TODO: init the hole fildes_t struct!
|
//TODO: init the hole fildes_t struct!
|
||||||
vfs_node_t* node;
|
vfs_node_t* node;
|
||||||
task_t* curr_task = per_core(current_task);
|
task_t* curr_task = per_core(current_task);
|
||||||
|
int err;
|
||||||
|
|
||||||
if (!largs)
|
if (!largs)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -438,7 +441,16 @@ static int load_task(load_args_t* largs)
|
||||||
if (!file->node)
|
if (!file->node)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
read_fs(file, (uint8_t*)&header, sizeof(elf_header_t));
|
read_fs(file, (uint8_t*)&header, sizeof(elf_header_t));
|
||||||
|
=======
|
||||||
|
err = read_fs(node, (uint8_t*)&header, sizeof(elf_header_t), 0);
|
||||||
|
if (err < 0) {
|
||||||
|
kprintf("read_fs failed: %d\n", err);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>>>>> master
|
||||||
if (BUILTIN_EXPECT(header.ident.magic != ELF_MAGIC, 0))
|
if (BUILTIN_EXPECT(header.ident.magic != ELF_MAGIC, 0))
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
|
@ -609,6 +621,12 @@ static int load_task(load_args_t* largs)
|
||||||
|
|
||||||
invalid:
|
invalid:
|
||||||
kprintf("Invalid executable!\n");
|
kprintf("Invalid executable!\n");
|
||||||
|
kprintf("magic number 0x%x\n", (uint32_t) header.ident.magic);
|
||||||
|
kprintf("header type 0x%x\n", (uint32_t) header.type);
|
||||||
|
kprintf("machine type 0x%x\n", (uint32_t) header.machine);
|
||||||
|
kprintf("elf ident class 0x%x\n", (uint32_t) header.ident._class);
|
||||||
|
kprintf("elf identdata !0x%x\n", header.ident.data);
|
||||||
|
kprintf("program entry point 0x%x\n", (size_t) header.entry);
|
||||||
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,6 +253,9 @@ void* client_task(void* e)
|
||||||
int test_init(void)
|
int test_init(void)
|
||||||
{
|
{
|
||||||
char* argv[] = {"/bin/mshell", NULL};
|
char* argv[] = {"/bin/mshell", NULL};
|
||||||
|
// char* argv[] = {"/bin/tests", NULL};
|
||||||
|
// char* server_argv[] = {"/bin/server", "6789", NULL};
|
||||||
|
// char* client_argv[] = {"/bin/client", "127.0.0.1", "6789", NULL};
|
||||||
|
|
||||||
//sem_init(&producing, 1);
|
//sem_init(&producing, 1);
|
||||||
//sem_init(&consuming, 0);
|
//sem_init(&consuming, 0);
|
||||||
|
@ -280,6 +283,9 @@ int test_init(void)
|
||||||
create_user_task(NULL, "/bin/mshell", argv);
|
create_user_task(NULL, "/bin/mshell", argv);
|
||||||
//create_user_task(NULL, "/bin/jacobi", argv);
|
//create_user_task(NULL, "/bin/jacobi", argv);
|
||||||
//create_user_task(NULL, "/bin/jacobi", argv);
|
//create_user_task(NULL, "/bin/jacobi", argv);
|
||||||
|
create_user_task(NULL, "/bin/server", server_argv);
|
||||||
|
//sleep(5);
|
||||||
|
//create_user_task(NULL, "/bin/client", client_argv);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,5 +81,5 @@ typedef size_t mem_ptr_t;
|
||||||
|
|
||||||
#define LWIP_PLATFORM_ASSERT(x) do {kprintf("Assertion \"%s\" failed at line %d in %s\n", \
|
#define LWIP_PLATFORM_ASSERT(x) do {kprintf("Assertion \"%s\" failed at line %d in %s\n", \
|
||||||
x, __LINE__, __FILE__); abort();} while(0)
|
x, __LINE__, __FILE__); abort();} while(0)
|
||||||
|
|
||||||
#endif /* __ARCH_CC_H__ */
|
#endif /* __ARCH_CC_H__ */
|
||||||
|
|
|
@ -43,4 +43,10 @@ static inline void sys_arch_unprotect(sys_prot_t pval)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* define errno to determine error code */
|
||||||
|
#ifdef CONFIG_LWIP
|
||||||
|
#define ERRNO
|
||||||
|
#define errno per_core(current_task)->lwip_err
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __ARCH_SYS_ARCH_H__ */
|
#endif /* __ARCH_SYS_ARCH_H__ */
|
||||||
|
|
|
@ -117,6 +117,10 @@
|
||||||
#define NETIF_DEBUG LWIP_DBG_ON
|
#define NETIF_DEBUG LWIP_DBG_ON
|
||||||
#define TIMERS_DEBUG LWIP_DBG_OFF
|
#define TIMERS_DEBUG LWIP_DBG_OFF
|
||||||
#define SOCKETS_DEBUG LWIP_DBG_OFF
|
#define SOCKETS_DEBUG LWIP_DBG_OFF
|
||||||
|
#define PBUF_DEBUG LWIP_DBG_OFF
|
||||||
|
|
||||||
|
// we need this feature to avoid memcpy operation between user- and kernel space
|
||||||
|
#define LWIP_TCPIP_CORE_LOCKING 1
|
||||||
|
|
||||||
//#define LWIP_TCPIP_THREAD_ALIVE() kputs("TCPIP thread is alive!\n")
|
//#define LWIP_TCPIP_THREAD_ALIVE() kputs("TCPIP thread is alive!\n")
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -16,13 +16,17 @@ TMP = $(TOPDIR)/tmp
|
||||||
OPT = --disable-shared --disable-multilib --enable-newlib-hw-fp
|
OPT = --disable-shared --disable-multilib --enable-newlib-hw-fp
|
||||||
|
|
||||||
default: $(ARCH)
|
default: $(ARCH)
|
||||||
$(MAKE) -C examples depend
|
$(MAKE) CFLAGS+="-nostdinc -Wall -fno-builtin -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C net depend
|
||||||
|
$(MAKE) CFLAGS+="-nostdinc -Wall -fno-builtin -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C net
|
||||||
|
$(MAKE) CFLAGS+="-nostdinc -Wall -fno-builtin -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C examples depend
|
||||||
$(MAKE) CFLAGS+="-nostdinc -Wall -fno-builtin -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C examples
|
$(MAKE) CFLAGS+="-nostdinc -Wall -fno-builtin -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C examples
|
||||||
|
|
||||||
$(ARCH):
|
$(ARCH):
|
||||||
$(RM) $(TMP)
|
$(RM) $(TMP)
|
||||||
$(MKDIR) $(TMP)
|
$(MKDIR) $(TMP)
|
||||||
$(CD) $(TMP); $(TOPDIR)/src/configure --target=$(TARGET) --prefix=$(TOPDIR)/$(ARCH) $(OPT) && make && make install
|
$(CD) $(TMP); $(TOPDIR)/src/configure --target=$(TARGET) --prefix=$(TOPDIR)/$(ARCH) $(OPT) && make && make install
|
||||||
|
$(MKDIR) $(NEWLIB)/include/netinet
|
||||||
|
$(MKDIR) $(NEWLIB)/include/arpa
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -C examples clean
|
$(MAKE) -C examples clean
|
||||||
|
|
|
@ -11,7 +11,7 @@ LDFLAGS =
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
all: hello tests jacobi mshell
|
all: hello tests jacobi mshell server client
|
||||||
|
|
||||||
jacobi: jacobi.o
|
jacobi: jacobi.o
|
||||||
$(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< -lm
|
$(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< -lm
|
||||||
|
@ -32,13 +32,25 @@ hello: hello.o
|
||||||
chmod a-x $@.sym
|
chmod a-x $@.sym
|
||||||
|
|
||||||
mshell: mshell.o
|
mshell: mshell.o
|
||||||
$(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $<
|
$(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $<
|
||||||
$(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym
|
$(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym
|
||||||
$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
|
$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
|
||||||
chmod a-x $@.sym
|
chmod a-x $@.sym
|
||||||
|
|
||||||
|
server: server.o
|
||||||
|
$(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< -lsocket
|
||||||
|
$(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym
|
||||||
|
$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
|
||||||
|
chmod a-x $@.sym
|
||||||
|
|
||||||
|
client: client.o
|
||||||
|
$(CC_FOR_TARGET) -T link.ld -o $@ $(LDFLAGS) $< -lsocket
|
||||||
|
$(OBJCOPY_FOR_TARGET) $(KEEP_DEBUG) $@ $@.sym
|
||||||
|
$(OBJCOPY_FOR_TARGET) $(STRIP_DEBUG) $@
|
||||||
|
chmod a-x $@.sym
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) hello hangman jacobi mshell tests *.sym *.o *~
|
$(RM) hello tests server client *.sym *.o *~
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
$(CC_FOR_TARGET) -MM $(CFLAGS) *.c > Makefile.dep
|
$(CC_FOR_TARGET) -MM $(CFLAGS) *.c > Makefile.dep
|
||||||
|
|
57
newlib/examples/client.c
Normal file
57
newlib/examples/client.c
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
/* derived form http://www.cs.put.poznan.pl/csobaniec/examples/sockets/client-tcp-simple.c */
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#undef errno
|
||||||
|
extern int errno;
|
||||||
|
|
||||||
|
#define MAX_BUF 100
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
int sockd;
|
||||||
|
int count;
|
||||||
|
struct sockaddr_in serv_name;
|
||||||
|
char buf[MAX_BUF];
|
||||||
|
int status;
|
||||||
|
|
||||||
|
if (argc < 3)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Usage: %s ip_address port_number\n", argv[0]);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
/* create a socket */
|
||||||
|
sockd = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
if (sockd == -1)
|
||||||
|
{
|
||||||
|
perror("Socket creation");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* server address */
|
||||||
|
serv_name.sin_family = AF_INET;
|
||||||
|
inet_aton(argv[1], &serv_name.sin_addr);
|
||||||
|
serv_name.sin_port = htons(atoi(argv[2]));
|
||||||
|
|
||||||
|
/* connect to the server */
|
||||||
|
status = connect(sockd, (struct sockaddr*)&serv_name, sizeof(serv_name));
|
||||||
|
if (status == -1)
|
||||||
|
{
|
||||||
|
perror("Connection error");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
count = read(sockd, buf, MAX_BUF);
|
||||||
|
write(1, buf, count);
|
||||||
|
|
||||||
|
close(sockd);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
72
newlib/examples/server.c
Normal file
72
newlib/examples/server.c
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
/* derived from http://www.cs.put.poznan.pl/csobaniec/examples/sockets/server-tcp-simple.c */
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#undef errno
|
||||||
|
extern int errno;
|
||||||
|
|
||||||
|
static char msg[] =" Hello from server!\n";
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
int sockd, sockd2;
|
||||||
|
unsigned int addrlen;
|
||||||
|
struct sockaddr_in my_name, peer_name;
|
||||||
|
int status;
|
||||||
|
|
||||||
|
/* create a socket */
|
||||||
|
sockd = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
if (sockd == -1)
|
||||||
|
{
|
||||||
|
perror("Socket creation error");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc < 2)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Usage: %s port_number\n", argv[0]);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* server address */
|
||||||
|
my_name.sin_family = AF_INET;
|
||||||
|
my_name.sin_addr.s_addr = INADDR_ANY;
|
||||||
|
my_name.sin_port = htons(atoi(argv[1]));
|
||||||
|
|
||||||
|
status = bind(sockd, (struct sockaddr*)&my_name, sizeof(my_name));
|
||||||
|
if (status == -1)
|
||||||
|
{
|
||||||
|
perror("Binding error");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
status = listen(sockd, 5);
|
||||||
|
if (status == -1)
|
||||||
|
{
|
||||||
|
perror("Listening error");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
/* wait for a connection */
|
||||||
|
addrlen = sizeof(peer_name);
|
||||||
|
sockd2 = accept(sockd, (struct sockaddr*)&peer_name, &addrlen);
|
||||||
|
if (sockd2 == -1)
|
||||||
|
{
|
||||||
|
perror("Wrong connection");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
write(sockd2, msg, strlen(msg)+1);
|
||||||
|
close(sockd2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
34
newlib/net/Makefile
Normal file
34
newlib/net/Makefile
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
ARCH = x86
|
||||||
|
NEWLIB = ../x86/i586-metalsvm-elf32
|
||||||
|
MAKE = make
|
||||||
|
STRIP_DEBUG = --strip-debug
|
||||||
|
KEEP_DEBUG = --only-keep-debug
|
||||||
|
LDFLAGS =
|
||||||
|
LIBNAME = libsocket.a
|
||||||
|
ARFLAGS = ruv
|
||||||
|
CP = cp
|
||||||
|
OBJS = accept.o bind.o closesocket.o connect.o listen.o recv.o send.o socket.o ip_addr.o
|
||||||
|
|
||||||
|
# other implicit rules
|
||||||
|
%.o : %.c
|
||||||
|
$(CC_FOR_TARGET) -c $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
default: all
|
||||||
|
|
||||||
|
all: $(LIBNAME)
|
||||||
|
|
||||||
|
$(LIBNAME): $(OBJS) socket.h
|
||||||
|
$(AR_FOR_TARGET) $(ARFLAGS) $@ $(OBJS)
|
||||||
|
$(CP) $@ $(NEWLIB)/lib
|
||||||
|
$(CP) socket.h $(NEWLIB)/include/sys
|
||||||
|
$(CP) in.h $(NEWLIB)/include/netinet
|
||||||
|
$(CP) inet.h $(NEWLIB)/include/arpa
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) $(LIBNAME) *.o *~
|
||||||
|
|
||||||
|
depend:
|
||||||
|
$(CC_FOR_TARGET) -MM $(CFLAGS) *.c > Makefile.dep
|
||||||
|
|
||||||
|
-include Makefile.dep
|
||||||
|
# DO NOT DELETE
|
|
@ -1,3 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, Carl-Benedikt Krueger, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
|
|
@ -1,3 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, Carl-Benedikt Krueger, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
|
|
@ -1,3 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, Carl-Benedikt Krueger, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
@ -15,11 +47,11 @@ _DEFUN (closesocket, (s),
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = SYSCALL1(__NR_closesocket, s);
|
ret = SYSCALL1(__NR_closesocket, s);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
errno = -ret;
|
errno = -ret;
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
26
newlib/net/config.h
Normal file
26
newlib/net/config.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
/* Name of package. */
|
||||||
|
#define PACKAGE libsocket
|
||||||
|
|
||||||
|
/* Version of package. */
|
||||||
|
#define VERSION 0.1
|
||||||
|
|
||||||
|
/* Missing syscall names */
|
||||||
|
#define MISSING_SYSCALL_NAMES 1
|
||||||
|
|
||||||
|
/* Using ELF format */
|
||||||
|
#define HAVE_ELF 1
|
||||||
|
|
||||||
|
/* Using GNU LD */
|
||||||
|
#define HAVE_GNU_LD 1
|
||||||
|
|
||||||
|
/* .previous directive allowed */
|
||||||
|
#define HAVE_ASM_PREVIOUS_DIRECTIVE 1
|
||||||
|
|
||||||
|
/* .pushsection/.popsection directives allowed */
|
||||||
|
#define HAVE_ASM_POPSECTION_DIRECTIVE 1
|
||||||
|
|
||||||
|
/* support for section attributes */
|
||||||
|
#define HAVE_SECTION_ATTRIBUTES 1
|
||||||
|
|
||||||
|
/* symbol prefix */
|
||||||
|
#define __SYMBOL_PREFIX ""
|
|
@ -1,3 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, Carl-Benedikt Krueger, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
|
76
newlib/net/in.h
Normal file
76
newlib/net/in.h
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The kernel of MetalSVM uses LwIP as lightweight TCP/IP stack.
|
||||||
|
* This header defines only a small wrapper to use LwIP functions
|
||||||
|
* from user space.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NETINET_IN_H__
|
||||||
|
#define __NETINET_IN_H__
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct in_addr {
|
||||||
|
uint32_t s_addr;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 255.255.255.255 */
|
||||||
|
#define IPADDR_NONE ((uint32_t)0xffffffffUL)
|
||||||
|
/** 127.0.0.1 */
|
||||||
|
#define IPADDR_LOOPBACK ((uint32_t)0x7f000001UL)
|
||||||
|
/** 0.0.0.0 */
|
||||||
|
#define IPADDR_ANY ((uint32_t)0x00000000UL)
|
||||||
|
/** 255.255.255.255 */
|
||||||
|
#define IPADDR_BROADCAST ((uint32_t)0xffffffffUL)
|
||||||
|
|
||||||
|
/** 255.255.255.255 */
|
||||||
|
#define INADDR_NONE IPADDR_NONE
|
||||||
|
/** 127.0.0.1 */
|
||||||
|
#define INADDR_LOOPBACK IPADDR_LOOPBACK
|
||||||
|
/** 0.0.0.0 */
|
||||||
|
#define INADDR_ANY IPADDR_ANY
|
||||||
|
/** 255.255.255.255 */
|
||||||
|
#define INADDR_BROADCAST IPADDR_BROADCAST
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __NETINET_IN_H__ */
|
109
newlib/net/inet.h
Normal file
109
newlib/net/inet.h
Normal file
|
@ -0,0 +1,109 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The kernel of MetalSVM uses LwIP as lightweight TCP/IP stack.
|
||||||
|
* This header defines only a small wrapper to use LwIP functions
|
||||||
|
* from user space.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ARPA_INET_H__
|
||||||
|
#define __ARPA_INET_H__
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is the aligned version of ip_addr_t,
|
||||||
|
* used as local variable, on the stack, etc.
|
||||||
|
*/
|
||||||
|
struct ip_addr {
|
||||||
|
uint32_t addr;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifndef LITTLE_ENDIAN
|
||||||
|
// Convert an uint16_t from host- to network byte order.
|
||||||
|
static inline uint16_t htons(uint16_t n)
|
||||||
|
{
|
||||||
|
return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert an uint16_t from network- to host byte order.
|
||||||
|
static inline uint16_t ntohs(uint16_t n)
|
||||||
|
{
|
||||||
|
return htons(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert an uint32_t from host- to network byte order.
|
||||||
|
static inline uint32_t htonl(uint32_t n)
|
||||||
|
{
|
||||||
|
return ((n & 0xff) << 24) | ((n & 0xff00) << 8) | ((n & 0xff0000UL) >> 8) |
|
||||||
|
((n & 0xff000000UL) >> 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert an uint32_t from network- to host byte order.
|
||||||
|
static inline uint32_t ntohl(uint32_t n)
|
||||||
|
{
|
||||||
|
return htonl(n);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#error currently not supported!!!
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/** ip_addr_t uses a struct for convenience only, so that the same defines can
|
||||||
|
* operate both on ip_addr_t as well as on ip_addr_p_t. */
|
||||||
|
typedef struct ip_addr ip_addr_t;
|
||||||
|
//typedef struct ip_addr_packed ip_addr_p_t;
|
||||||
|
|
||||||
|
uint32_t ipaddr_addr(const char *cp);
|
||||||
|
int ipaddr_aton(const char *cp, ip_addr_t *addr);
|
||||||
|
/** returns ptr to static buffer; not reentrant! */
|
||||||
|
char *ipaddr_ntoa(const ip_addr_t *addr);
|
||||||
|
char *ipaddr_ntoa_r(const ip_addr_t *addr, char *buf, int buflen);
|
||||||
|
|
||||||
|
/* directly map this to the lwip internal functions */
|
||||||
|
#define inet_addr(cp) ipaddr_addr(cp)
|
||||||
|
#define inet_aton(cp, addr) ipaddr_aton(cp, (ip_addr_t*)addr)
|
||||||
|
#define inet_ntoa(addr) ipaddr_ntoa((ip_addr_t*)&(addr))
|
||||||
|
#define inet_ntoa_r(addr, buf, buflen) ipaddr_ntoa_r((ip_addr_t*)&(addr), buf, buflen)
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __NETINET_IN_H__ */
|
336
newlib/net/ip_addr.c
Normal file
336
newlib/net/ip_addr.c
Normal file
|
@ -0,0 +1,336 @@
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* This is the IPv4 address tools implementation.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
* are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
* 3. The name of the author may not be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||||
|
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||||
|
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||||
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||||
|
* OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* This file is part of the lwIP TCP/IP stack.
|
||||||
|
*
|
||||||
|
* Author: Adam Dunkels <adam@sics.se>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* LwIP backports of helper function for user-space applications
|
||||||
|
*/
|
||||||
|
#include "inet.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
/* Define generic types used in lwIP */
|
||||||
|
typedef uint8_t u8_t;
|
||||||
|
typedef int8_t s8_t;
|
||||||
|
typedef uint16_t u16_t;
|
||||||
|
typedef int16_t s16_t;
|
||||||
|
typedef uint32_t u32_t;
|
||||||
|
typedef int32_t s32_t;
|
||||||
|
|
||||||
|
#define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \
|
||||||
|
fprintf(stderr, message); } while(0)
|
||||||
|
|
||||||
|
/** IPv4 only: set the IP address given as an u32_t */
|
||||||
|
#define ip4_addr_set_u32(dest_ipaddr, src_u32) ((dest_ipaddr)->addr = (src_u32))
|
||||||
|
/** IPv4 only: get the IP address as an u32_t */
|
||||||
|
#define ip4_addr_get_u32(src_ipaddr) ((src_ipaddr)->addr)
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
#include "lwip/opt.h"
|
||||||
|
#include "lwip/ip_addr.h"
|
||||||
|
#include "lwip/netif.h"
|
||||||
|
|
||||||
|
/* used by IP_ADDR_ANY and IP_ADDR_BROADCAST in ip_addr.h */
|
||||||
|
const ip_addr_t ip_addr_any = { IPADDR_ANY };
|
||||||
|
const ip_addr_t ip_addr_broadcast = { IPADDR_BROADCAST };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if an address is a broadcast address on a network interface
|
||||||
|
*
|
||||||
|
* @param addr address to be checked
|
||||||
|
* @param netif the network interface against which the address is checked
|
||||||
|
* @return returns non-zero if the address is a broadcast address
|
||||||
|
*/
|
||||||
|
u8_t
|
||||||
|
ip4_addr_isbroadcast(u32_t addr, const struct netif *netif)
|
||||||
|
{
|
||||||
|
ip_addr_t ipaddr;
|
||||||
|
ip4_addr_set_u32(&ipaddr, addr);
|
||||||
|
|
||||||
|
/* all ones (broadcast) or all zeroes (old skool broadcast) */
|
||||||
|
if ((~addr == IPADDR_ANY) ||
|
||||||
|
(addr == IPADDR_ANY)) {
|
||||||
|
return 1;
|
||||||
|
/* no broadcast support on this network interface? */
|
||||||
|
} else if ((netif->flags & NETIF_FLAG_BROADCAST) == 0) {
|
||||||
|
/* the given address cannot be a broadcast address
|
||||||
|
* nor can we check against any broadcast addresses */
|
||||||
|
return 0;
|
||||||
|
/* address matches network interface address exactly? => no broadcast */
|
||||||
|
} else if (addr == ip4_addr_get_u32(&netif->ip_addr)) {
|
||||||
|
return 0;
|
||||||
|
/* on the same (sub) network... */
|
||||||
|
} else if (ip_addr_netcmp(&ipaddr, &(netif->ip_addr), &(netif->netmask))
|
||||||
|
/* ...and host identifier bits are all ones? =>... */
|
||||||
|
&& ((addr & ~ip4_addr_get_u32(&netif->netmask)) ==
|
||||||
|
(IPADDR_BROADCAST & ~ip4_addr_get_u32(&netif->netmask)))) {
|
||||||
|
/* => network broadcast address */
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Checks if a netmask is valid (starting with ones, then only zeros)
|
||||||
|
*
|
||||||
|
* @param netmask the IPv4 netmask to check (in network byte order!)
|
||||||
|
* @return 1 if the netmask is valid, 0 if it is not
|
||||||
|
*/
|
||||||
|
u8_t
|
||||||
|
ip4_addr_netmask_valid(u32_t netmask)
|
||||||
|
{
|
||||||
|
u32_t mask;
|
||||||
|
u32_t nm_hostorder = lwip_htonl(netmask);
|
||||||
|
|
||||||
|
/* first, check for the first zero */
|
||||||
|
for (mask = 1UL << 31 ; mask != 0; mask >>= 1) {
|
||||||
|
if ((nm_hostorder & mask) == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* then check that there is no one */
|
||||||
|
for (; mask != 0; mask >>= 1) {
|
||||||
|
if ((nm_hostorder & mask) != 0) {
|
||||||
|
/* there is a one after the first zero -> invalid */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* no one after the first zero -> valid */
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Here for now until needed in other places in lwIP */
|
||||||
|
#ifndef isprint
|
||||||
|
#define in_range(c, lo, up) ((u8_t)c >= lo && (u8_t)c <= up)
|
||||||
|
#define isprint(c) in_range(c, 0x20, 0x7f)
|
||||||
|
#define isdigit(c) in_range(c, '0', '9')
|
||||||
|
#define isxdigit(c) (isdigit(c) || in_range(c, 'a', 'f') || in_range(c, 'A', 'F'))
|
||||||
|
#define islower(c) in_range(c, 'a', 'z')
|
||||||
|
#define isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ascii internet address interpretation routine.
|
||||||
|
* The value returned is in network order.
|
||||||
|
*
|
||||||
|
* @param cp IP address in ascii represenation (e.g. "127.0.0.1")
|
||||||
|
* @return ip address in network order
|
||||||
|
*/
|
||||||
|
u32_t
|
||||||
|
ipaddr_addr(const char *cp)
|
||||||
|
{
|
||||||
|
ip_addr_t val;
|
||||||
|
|
||||||
|
if (ipaddr_aton(cp, &val)) {
|
||||||
|
return ip4_addr_get_u32(&val);
|
||||||
|
}
|
||||||
|
return (IPADDR_NONE);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether "cp" is a valid ascii representation
|
||||||
|
* of an Internet address and convert to a binary address.
|
||||||
|
* Returns 1 if the address is valid, 0 if not.
|
||||||
|
* This replaces inet_addr, the return value from which
|
||||||
|
* cannot distinguish between failure and a local broadcast address.
|
||||||
|
*
|
||||||
|
* @param cp IP address in ascii represenation (e.g. "127.0.0.1")
|
||||||
|
* @param addr pointer to which to save the ip address in network order
|
||||||
|
* @return 1 if cp could be converted to addr, 0 on failure
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
ipaddr_aton(const char *cp, ip_addr_t *addr)
|
||||||
|
{
|
||||||
|
u32_t val;
|
||||||
|
u8_t base;
|
||||||
|
char c;
|
||||||
|
u32_t parts[4];
|
||||||
|
u32_t *pp = parts;
|
||||||
|
|
||||||
|
c = *cp;
|
||||||
|
for (;;) {
|
||||||
|
/*
|
||||||
|
* Collect number up to ``.''.
|
||||||
|
* Values are specified as for C:
|
||||||
|
* 0x=hex, 0=octal, 1-9=decimal.
|
||||||
|
*/
|
||||||
|
if (!isdigit(c))
|
||||||
|
return (0);
|
||||||
|
val = 0;
|
||||||
|
base = 10;
|
||||||
|
if (c == '0') {
|
||||||
|
c = *++cp;
|
||||||
|
if (c == 'x' || c == 'X') {
|
||||||
|
base = 16;
|
||||||
|
c = *++cp;
|
||||||
|
} else
|
||||||
|
base = 8;
|
||||||
|
}
|
||||||
|
for (;;) {
|
||||||
|
if (isdigit(c)) {
|
||||||
|
val = (val * base) + (int)(c - '0');
|
||||||
|
c = *++cp;
|
||||||
|
} else if (base == 16 && isxdigit(c)) {
|
||||||
|
val = (val << 4) | (int)(c + 10 - (islower(c) ? 'a' : 'A'));
|
||||||
|
c = *++cp;
|
||||||
|
} else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (c == '.') {
|
||||||
|
/*
|
||||||
|
* Internet format:
|
||||||
|
* a.b.c.d
|
||||||
|
* a.b.c (with c treated as 16 bits)
|
||||||
|
* a.b (with b treated as 24 bits)
|
||||||
|
*/
|
||||||
|
if (pp >= parts + 3) {
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
*pp++ = val;
|
||||||
|
c = *++cp;
|
||||||
|
} else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Check for trailing characters.
|
||||||
|
*/
|
||||||
|
if (c != '\0' && !isspace(c)) {
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Concoct the address according to
|
||||||
|
* the number of parts specified.
|
||||||
|
*/
|
||||||
|
switch (pp - parts + 1) {
|
||||||
|
|
||||||
|
case 0:
|
||||||
|
return (0); /* initial nondigit */
|
||||||
|
|
||||||
|
case 1: /* a -- 32 bits */
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2: /* a.b -- 8.24 bits */
|
||||||
|
if (val > 0xffffffUL) {
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
val |= parts[0] << 24;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3: /* a.b.c -- 8.8.16 bits */
|
||||||
|
if (val > 0xffff) {
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
val |= (parts[0] << 24) | (parts[1] << 16);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 4: /* a.b.c.d -- 8.8.8.8 bits */
|
||||||
|
if (val > 0xff) {
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LWIP_ASSERT("unhandled", 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (addr) {
|
||||||
|
ip4_addr_set_u32(addr, htonl(val));
|
||||||
|
}
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert numeric IP address into decimal dotted ASCII representation.
|
||||||
|
* returns ptr to static buffer; not reentrant!
|
||||||
|
*
|
||||||
|
* @param addr ip address in network order to convert
|
||||||
|
* @return pointer to a global static (!) buffer that holds the ASCII
|
||||||
|
* represenation of addr
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
ipaddr_ntoa(const ip_addr_t *addr)
|
||||||
|
{
|
||||||
|
static char str[16];
|
||||||
|
return ipaddr_ntoa_r(addr, str, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Same as ipaddr_ntoa, but reentrant since a user-supplied buffer is used.
|
||||||
|
*
|
||||||
|
* @param addr ip address in network order to convert
|
||||||
|
* @param buf target buffer where the string is stored
|
||||||
|
* @param buflen length of buf
|
||||||
|
* @return either pointer to buf which now holds the ASCII
|
||||||
|
* representation of addr or NULL if buf was too small
|
||||||
|
*/
|
||||||
|
char *ipaddr_ntoa_r(const ip_addr_t *addr, char *buf, int buflen)
|
||||||
|
{
|
||||||
|
u32_t s_addr;
|
||||||
|
char inv[3];
|
||||||
|
char *rp;
|
||||||
|
u8_t *ap;
|
||||||
|
u8_t rem;
|
||||||
|
u8_t n;
|
||||||
|
u8_t i;
|
||||||
|
int len = 0;
|
||||||
|
|
||||||
|
s_addr = ip4_addr_get_u32(addr);
|
||||||
|
|
||||||
|
rp = buf;
|
||||||
|
ap = (u8_t *)&s_addr;
|
||||||
|
for(n = 0; n < 4; n++) {
|
||||||
|
i = 0;
|
||||||
|
do {
|
||||||
|
rem = *ap % (u8_t)10;
|
||||||
|
*ap /= (u8_t)10;
|
||||||
|
inv[i++] = '0' + rem;
|
||||||
|
} while(*ap);
|
||||||
|
while(i--) {
|
||||||
|
if (len++ >= buflen) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
*rp++ = inv[i];
|
||||||
|
}
|
||||||
|
if (len++ >= buflen) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
*rp++ = '.';
|
||||||
|
ap++;
|
||||||
|
}
|
||||||
|
*--rp = 0;
|
||||||
|
return buf;
|
||||||
|
}
|
|
@ -1,3 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, Carl-Benedikt Krueger, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
|
|
@ -1,3 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, Carl-Benedikt Krueger, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
|
|
@ -1,3 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, Carl-Benedikt Krueger, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
|
|
@ -1,3 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, Carl-Benedikt Krueger, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <_ansi.h>
|
#include <_ansi.h>
|
||||||
|
|
323
newlib/net/socket.h
Normal file
323
newlib/net/socket.h
Normal file
|
@ -0,0 +1,323 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University
|
||||||
|
*
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The kernel of MetalSVM uses LwIP as lightweight TCP/IP stack.
|
||||||
|
* This header defines only a small wrapper to use LwIP functions
|
||||||
|
* from user space.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __SOCKET_H__
|
||||||
|
#define __SOCKET_H__
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct sockaddr_in {
|
||||||
|
uint8_t sin_len;
|
||||||
|
uint8_t sin_family;
|
||||||
|
uint16_t sin_port;
|
||||||
|
struct in_addr sin_addr;
|
||||||
|
char sin_zero[8];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct sockaddr {
|
||||||
|
uint8_t sa_len;
|
||||||
|
uint8_t sa_family;
|
||||||
|
char sa_data[14];
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifndef socklen_t
|
||||||
|
# define socklen_t uint32_t
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Socket protocol types (TCP/UDP/RAW) */
|
||||||
|
#define SOCK_STREAM 1
|
||||||
|
#define SOCK_DGRAM 2
|
||||||
|
#define SOCK_RAW 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Option flags per-socket. These must match the SOF_ flags in ip.h (checked in init.c)
|
||||||
|
*/
|
||||||
|
#define SO_DEBUG 0x0001 /* Unimplemented: turn on debugging info recording */
|
||||||
|
#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */
|
||||||
|
#define SO_REUSEADDR 0x0004 /* Allow local address reuse */
|
||||||
|
#define SO_KEEPALIVE 0x0008 /* keep connections alive */
|
||||||
|
#define SO_DONTROUTE 0x0010 /* Unimplemented: just use interface addresses */
|
||||||
|
#define SO_BROADCAST 0x0020 /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */
|
||||||
|
#define SO_USELOOPBACK 0x0040 /* Unimplemented: bypass hardware when possible */
|
||||||
|
#define SO_LINGER 0x0080 /* linger on close if data present */
|
||||||
|
#define SO_OOBINLINE 0x0100 /* Unimplemented: leave received OOB data in line */
|
||||||
|
#define SO_REUSEPORT 0x0200 /* Unimplemented: allow local address & port reuse */
|
||||||
|
|
||||||
|
#define SO_DONTLINGER ((int)(~SO_LINGER))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Additional options, not kept in so_options.
|
||||||
|
*/
|
||||||
|
#define SO_SNDBUF 0x1001 /* Unimplemented: send buffer size */
|
||||||
|
#define SO_RCVBUF 0x1002 /* receive buffer size */
|
||||||
|
#define SO_SNDLOWAT 0x1003 /* Unimplemented: send low-water mark */
|
||||||
|
#define SO_RCVLOWAT 0x1004 /* Unimplemented: receive low-water mark */
|
||||||
|
#define SO_SNDTIMEO 0x1005 /* Unimplemented: send timeout */
|
||||||
|
#define SO_RCVTIMEO 0x1006 /* receive timeout */
|
||||||
|
#define SO_ERROR 0x1007 /* get error status and clear */
|
||||||
|
#define SO_TYPE 0x1008 /* get socket type */
|
||||||
|
#define SO_CONTIMEO 0x1009 /* Unimplemented: connect timeout */
|
||||||
|
#define SO_NO_CHECK 0x100a /* don't create UDP checksum */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Structure used for manipulating linger option.
|
||||||
|
*/
|
||||||
|
struct linger {
|
||||||
|
int l_onoff; /* option on/off */
|
||||||
|
int l_linger; /* linger time */
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Level number for (get/set)sockopt() to apply to socket itself.
|
||||||
|
*/
|
||||||
|
#define SOL_SOCKET 0xfff /* options for socket level */
|
||||||
|
|
||||||
|
|
||||||
|
#define AF_UNSPEC 0
|
||||||
|
#define AF_INET 2
|
||||||
|
#define PF_INET AF_INET
|
||||||
|
#define PF_UNSPEC AF_UNSPEC
|
||||||
|
|
||||||
|
#define IPPROTO_IP 0
|
||||||
|
#define IPPROTO_TCP 6
|
||||||
|
#define IPPROTO_UDP 17
|
||||||
|
#define IPPROTO_UDPLITE 136
|
||||||
|
|
||||||
|
/* Flags we can use with send and recv. */
|
||||||
|
#define MSG_PEEK 0x01 /* Peeks at an incoming message */
|
||||||
|
#define MSG_WAITALL 0x02 /* Unimplemented: Requests that the function block until the full amount of data requested can be returned */
|
||||||
|
#define MSG_OOB 0x04 /* Unimplemented: Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */
|
||||||
|
#define MSG_DONTWAIT 0x08 /* Nonblocking i/o for this operation only */
|
||||||
|
#define MSG_MORE 0x10 /* Sender will send more */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Options for level IPPROTO_IP
|
||||||
|
*/
|
||||||
|
#define IP_TOS 1
|
||||||
|
#define IP_TTL 2
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Options for level IPPROTO_TCP
|
||||||
|
*/
|
||||||
|
#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
|
||||||
|
#define TCP_KEEPALIVE 0x02 /* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */
|
||||||
|
#define TCP_KEEPIDLE 0x03 /* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */
|
||||||
|
#define TCP_KEEPINTVL 0x04 /* set pcb->keep_intvl - Use seconds for get/setsockopt */
|
||||||
|
#define TCP_KEEPCNT 0x05 /* set pcb->keep_cnt - Use number of probes sent for get/setsockopt */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Options for level IPPROTO_UDPLITE
|
||||||
|
*/
|
||||||
|
#define UDPLITE_SEND_CSCOV 0x01 /* sender checksum coverage */
|
||||||
|
#define UDPLITE_RECV_CSCOV 0x02 /* minimal receiver checksum coverage */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Options and types for UDP multicast traffic handling
|
||||||
|
*/
|
||||||
|
#define IP_ADD_MEMBERSHIP 3
|
||||||
|
#define IP_DROP_MEMBERSHIP 4
|
||||||
|
#define IP_MULTICAST_TTL 5
|
||||||
|
#define IP_MULTICAST_IF 6
|
||||||
|
#define IP_MULTICAST_LOOP 7
|
||||||
|
|
||||||
|
typedef struct ip_mreq {
|
||||||
|
struct in_addr imr_multiaddr; /* IP multicast address of group */
|
||||||
|
struct in_addr imr_interface; /* local IP address of interface */
|
||||||
|
} ip_mreq;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The Type of Service provides an indication of the abstract
|
||||||
|
* parameters of the quality of service desired. These parameters are
|
||||||
|
* to be used to guide the selection of the actual service parameters
|
||||||
|
* when transmitting a datagram through a particular network. Several
|
||||||
|
* networks offer service precedence, which somehow treats high
|
||||||
|
* precedence traffic as more important than other traffic (generally
|
||||||
|
* by accepting only traffic above a certain precedence at time of high
|
||||||
|
* load). The major choice is a three way tradeoff between low-delay,
|
||||||
|
* high-reliability, and high-throughput.
|
||||||
|
* The use of the Delay, Throughput, and Reliability indications may
|
||||||
|
* increase the cost (in some sense) of the service. In many networks
|
||||||
|
* better performance for one of these parameters is coupled with worse
|
||||||
|
* performance on another. Except for very unusual cases at most two
|
||||||
|
* of these three indications should be set.
|
||||||
|
*/
|
||||||
|
#define IPTOS_TOS_MASK 0x1E
|
||||||
|
#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
|
||||||
|
#define IPTOS_LOWDELAY 0x10
|
||||||
|
#define IPTOS_THROUGHPUT 0x08
|
||||||
|
#define IPTOS_RELIABILITY 0x04
|
||||||
|
#define IPTOS_LOWCOST 0x02
|
||||||
|
#define IPTOS_MINCOST IPTOS_LOWCOST
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The Network Control precedence designation is intended to be used
|
||||||
|
* within a network only. The actual use and control of that
|
||||||
|
* designation is up to each network. The Internetwork Control
|
||||||
|
* designation is intended for use by gateway control originators only.
|
||||||
|
* If the actual use of these precedence designations is of concern to
|
||||||
|
* a particular network, it is the responsibility of that network to
|
||||||
|
* control the access to, and use of, those precedence designations.
|
||||||
|
*/
|
||||||
|
#define IPTOS_PREC_MASK 0xe0
|
||||||
|
#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK)
|
||||||
|
#define IPTOS_PREC_NETCONTROL 0xe0
|
||||||
|
#define IPTOS_PREC_INTERNETCONTROL 0xc0
|
||||||
|
#define IPTOS_PREC_CRITIC_ECP 0xa0
|
||||||
|
#define IPTOS_PREC_FLASHOVERRIDE 0x80
|
||||||
|
#define IPTOS_PREC_FLASH 0x60
|
||||||
|
#define IPTOS_PREC_IMMEDIATE 0x40
|
||||||
|
#define IPTOS_PREC_PRIORITY 0x20
|
||||||
|
#define IPTOS_PREC_ROUTINE 0x00
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Commands for ioctlsocket(), taken from the BSD file fcntl.h.
|
||||||
|
* lwip_ioctl only supports FIONREAD and FIONBIO, for now
|
||||||
|
*
|
||||||
|
* Ioctl's have the command encoded in the lower word,
|
||||||
|
* and the size of any in or out parameters in the upper
|
||||||
|
* word. The high 2 bits of the upper word are used
|
||||||
|
* to encode the in/out status of the parameter; for now
|
||||||
|
* we restrict parameters to at most 128 bytes.
|
||||||
|
*/
|
||||||
|
#if !defined(FIONREAD) || !defined(FIONBIO)
|
||||||
|
#define IOCPARM_MASK 0x7fU /* parameters must be < 128 bytes */
|
||||||
|
#define IOC_VOID 0x20000000UL /* no parameters */
|
||||||
|
#define IOC_OUT 0x40000000UL /* copy out parameters */
|
||||||
|
#define IOC_IN 0x80000000UL /* copy in parameters */
|
||||||
|
#define IOC_INOUT (IOC_IN|IOC_OUT)
|
||||||
|
/* 0x20000000 distinguishes new &
|
||||||
|
old ioctl's */
|
||||||
|
#define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
|
||||||
|
|
||||||
|
#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
|
||||||
|
|
||||||
|
#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
|
||||||
|
#endif /* !defined(FIONREAD) || !defined(FIONBIO) */
|
||||||
|
|
||||||
|
#ifndef FIONREAD
|
||||||
|
#define FIONREAD _IOR('f', 127, unsigned long) /* get # bytes to read */
|
||||||
|
#endif
|
||||||
|
#ifndef FIONBIO
|
||||||
|
#define FIONBIO _IOW('f', 126, unsigned long) /* set/clear non-blocking i/o */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Socket I/O Controls: unimplemented */
|
||||||
|
#ifndef SIOCSHIWAT
|
||||||
|
#define SIOCSHIWAT _IOW('s', 0, unsigned long) /* set high watermark */
|
||||||
|
#define SIOCGHIWAT _IOR('s', 1, unsigned long) /* get high watermark */
|
||||||
|
#define SIOCSLOWAT _IOW('s', 2, unsigned long) /* set low watermark */
|
||||||
|
#define SIOCGLOWAT _IOR('s', 3, unsigned long) /* get low watermark */
|
||||||
|
#define SIOCATMARK _IOR('s', 7, unsigned long) /* at oob mark? */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* commands for fnctl */
|
||||||
|
#ifndef F_GETFL
|
||||||
|
#define F_GETFL 3
|
||||||
|
#endif
|
||||||
|
#ifndef F_SETFL
|
||||||
|
#define F_SETFL 4
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* File status flags and file access modes for fnctl,
|
||||||
|
these are bits in an int. */
|
||||||
|
#ifndef O_NONBLOCK
|
||||||
|
#define O_NONBLOCK 1 /* nonblocking I/O */
|
||||||
|
#endif
|
||||||
|
#ifndef O_NDELAY
|
||||||
|
#define O_NDELAY 1 /* same as O_NONBLOCK, for compatibility */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SHUT_RD
|
||||||
|
#define SHUT_RD 0
|
||||||
|
#define SHUT_WR 1
|
||||||
|
#define SHUT_RDWR 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* FD_SET used for lwip_select */
|
||||||
|
#ifndef FD_SET
|
||||||
|
#undef FD_SETSIZE
|
||||||
|
/* Make FD_SETSIZE match NUM_SOCKETS in socket.c */
|
||||||
|
#define FD_SETSIZE MEMP_NUM_NETCONN
|
||||||
|
#define FD_SET(n, p) ((p)->fd_bits[(n)/8] |= (1 << ((n) & 7)))
|
||||||
|
#define FD_CLR(n, p) ((p)->fd_bits[(n)/8] &= ~(1 << ((n) & 7)))
|
||||||
|
#define FD_ISSET(n,p) ((p)->fd_bits[(n)/8] & (1 << ((n) & 7)))
|
||||||
|
#define FD_ZERO(p) memset((void*)(p),0,sizeof(*(p)))
|
||||||
|
|
||||||
|
typedef struct fd_set {
|
||||||
|
unsigned char fd_bits [(FD_SETSIZE+7)/8];
|
||||||
|
} fd_set;
|
||||||
|
|
||||||
|
#endif /* FD_SET */
|
||||||
|
|
||||||
|
int accept(int s, struct sockaddr *addr, socklen_t *addrlen);
|
||||||
|
int bind(int s, const struct sockaddr *name, socklen_t namelen);
|
||||||
|
int getpeername (int s, struct sockaddr *name, socklen_t *namelen);
|
||||||
|
int getsockname (int s, struct sockaddr *name, socklen_t *namelen);
|
||||||
|
int getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen);
|
||||||
|
int setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen);
|
||||||
|
int connect(int s, const struct sockaddr *name, socklen_t namelen);
|
||||||
|
int listen(int s, int backlog);
|
||||||
|
int recv(int s, void *mem, size_t len, int flags);
|
||||||
|
int recvfrom(int s, void *mem, size_t len, int flags,
|
||||||
|
struct sockaddr *from, socklen_t *fromlen);
|
||||||
|
int send(int s, const void *dataptr, size_t size, int flags);
|
||||||
|
int sendto(int s, const void *dataptr, size_t size, int flags,
|
||||||
|
const struct sockaddr *to, socklen_t tolen);
|
||||||
|
int socket(int domain, int type, int protocol);
|
||||||
|
//int select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
|
||||||
|
// struct timeval *timeout);
|
||||||
|
//int ioctl(int s, long cmd, void *argp);
|
||||||
|
//int fcntl(int s, int cmd, int val);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __SOCKET_H__ */
|
|
@ -1,20 +1,36 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* Standard x86 syscalls for user programs running under MetalSVM
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __SYSCALL_H__
|
#ifndef __SYSCALL_H__
|
||||||
|
@ -39,6 +55,14 @@ extern "C" {
|
||||||
#define __NR_wait 13
|
#define __NR_wait 13
|
||||||
#define __NR_execve 14
|
#define __NR_execve 14
|
||||||
#define __NR_times 15
|
#define __NR_times 15
|
||||||
|
#define __NR_accept 16
|
||||||
|
#define __NR_bind 17
|
||||||
|
#define __NR_closesocket 18
|
||||||
|
#define __NR_connect 19
|
||||||
|
#define __NR_listen 20
|
||||||
|
#define __NR_recv 21
|
||||||
|
#define __NR_send 22
|
||||||
|
#define __NR_socket 23
|
||||||
|
|
||||||
#define _STR(token) #token
|
#define _STR(token) #token
|
||||||
#define _SYSCALLSTR(x) "int $" _STR(x) " "
|
#define _SYSCALLSTR(x) "int $" _STR(x) " "
|
||||||
|
|
44
newlib/net/warning.h
Normal file
44
newlib/net/warning.h
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
#ifndef __WARNING_H__
|
||||||
|
#define __WARNING_H__
|
||||||
|
|
||||||
|
#ifdef HAVE_GNU_LD
|
||||||
|
# ifdef HAVE_ELF
|
||||||
|
|
||||||
|
/* We want the .gnu.warning.SYMBOL section to be unallocated. */
|
||||||
|
# ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
|
||||||
|
# define __make_section_unallocated(section_string) \
|
||||||
|
asm(".section " section_string "\n .previous");
|
||||||
|
# elif defined (HAVE_ASM_POPSECTION_DIRECTIVE)
|
||||||
|
# define __make_section_unallocated(section_string) \
|
||||||
|
asm(".pushsection " section_string "\n .popsection");
|
||||||
|
# else
|
||||||
|
# define __make_section_unallocated(section_string)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifdef HAVE_SECTION_ATTRIBUTES
|
||||||
|
# define link_warning(symbol, msg) \
|
||||||
|
static const char __evoke_link_warning_##symbol[] \
|
||||||
|
__attribute__ ((section (".gnu.warning." __SYMBOL_PREFIX #symbol), \
|
||||||
|
__used__)) = msg;
|
||||||
|
# else
|
||||||
|
# define link_warning(symbol, msg)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#else /* !ELF */
|
||||||
|
|
||||||
|
# define link_warning(symbol, msg) \
|
||||||
|
asm(".stabs \"" msg "\",30,0,0,0\n" \
|
||||||
|
".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
|
||||||
|
# endif
|
||||||
|
#else /* !GNULD */
|
||||||
|
/* We will never be heard; they will all die horribly. */
|
||||||
|
# define link_warning(symbol, msg)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* A canned warning for sysdeps/stub functions.
|
||||||
|
The GNU linker prepends a "warning: " string. */
|
||||||
|
#define stub_warning(name) \
|
||||||
|
link_warning (name, \
|
||||||
|
#name " is not implemented and will always fail")
|
||||||
|
|
||||||
|
#endif /* __WARNING_H__ */
|
|
@ -1,20 +1,36 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,20 +1,35 @@
|
||||||
;
|
; Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
; Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
; RWTH Aachen University
|
||||||
; RWTH Aachen University
|
;
|
||||||
;
|
; All rights reserved.
|
||||||
; Licensed under the Apache License, Version 2.0 (the "License");
|
;
|
||||||
; you may not use this file except in compliance with the License.
|
; Redistribution and use in source and binary forms, with or without
|
||||||
; You may obtain a copy of the License at
|
; modification, are permitted provided that the following conditions are met:
|
||||||
;
|
; 1. Redistributions of source code must retain the above copyright
|
||||||
; http://www.apache.org/licenses/LICENSE-2.0
|
; notice, this list of conditions and the following disclaimer.
|
||||||
;
|
; 2. Redistributions in binary form must reproduce the above copyright
|
||||||
; Unless required by applicable law or agreed to in writing, software
|
; notice, this list of conditions and the following disclaimer in the
|
||||||
; distributed under the License is distributed on an "AS IS" BASIS,
|
; documentation and/or other materials provided with the distribution.
|
||||||
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
; 3. All advertising materials mentioning features or use of this software
|
||||||
; See the License for the specific language governing permissions and
|
; must display the following acknowledgement:
|
||||||
; limitations under the License.
|
; This product includes software developed by the Chair for Operating Systems,
|
||||||
;
|
; RWTH Aachen University.
|
||||||
; This file is part of MetalSVM.
|
; 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
; nor the names of its contributors may be used to endorse or promote products
|
||||||
|
; derived from this software without specific prior written permission.
|
||||||
|
;
|
||||||
|
; THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
|
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
; DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
|
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
;
|
||||||
|
; This file is part of MetalSVM.
|
||||||
|
|
||||||
[BITS 32]
|
[BITS 32]
|
||||||
SECTION .text
|
SECTION .text
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,20 +1,36 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* Standard x86 syscalls for user programs running under MetalSVM
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __SYSCALL_H__
|
#ifndef __SYSCALL_H__
|
||||||
|
@ -39,6 +55,14 @@ extern "C" {
|
||||||
#define __NR_wait 13
|
#define __NR_wait 13
|
||||||
#define __NR_execve 14
|
#define __NR_execve 14
|
||||||
#define __NR_times 15
|
#define __NR_times 15
|
||||||
|
#define __NR_accept 16
|
||||||
|
#define __NR_bind 17
|
||||||
|
#define __NR_closesocket 18
|
||||||
|
#define __NR_connect 19
|
||||||
|
#define __NR_listen 20
|
||||||
|
#define __NR_recv 21
|
||||||
|
#define __NR_send 22
|
||||||
|
#define __NR_socket 23
|
||||||
|
|
||||||
#define _STR(token) #token
|
#define _STR(token) #token
|
||||||
#define _SYSCALLSTR(x) "int $" _STR(x) " "
|
#define _SYSCALLSTR(x) "int $" _STR(x) " "
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,18 +1,34 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
* Copyright (c) 2011, Stefan Lankes, Chair for Operating Systems,
|
||||||
* RWTH Aachen University
|
* RWTH Aachen University
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* All rights reserved.
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
|
* must display the following acknowledgement:
|
||||||
|
* This product includes software developed by the Chair for Operating Systems,
|
||||||
|
* RWTH Aachen University.
|
||||||
|
* 4. Neither the name of the Chair for Operating Systems, RWTH Aachen University
|
||||||
|
* nor the names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* See the License for the specific language governing permissions and
|
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||||
* limitations under the License.
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* This file is part of MetalSVM.
|
* This file is part of MetalSVM.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,3 +9,13 @@ if [ $SIZE -ne 0 ]; then
|
||||||
else
|
else
|
||||||
echo not patching $NAME
|
echo not patching $NAME
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
NAME=initrd.img
|
||||||
|
SIZE=`ls -ld "$NAME" | awk '{print $5 % 64}'`
|
||||||
|
if [ $SIZE -ne 0 ]; then
|
||||||
|
echo "$NAME: patching $SIZE Zero-Bytes"
|
||||||
|
dd if=/dev/zero of=zero.bin bs=1 count=$SIZE
|
||||||
|
cat zero.bin >> $NAME
|
||||||
|
else
|
||||||
|
echo not patching $NAME
|
||||||
|
fi;
|
||||||
|
|
Loading…
Add table
Reference in a new issue