~ubuntu-branches/ubuntu/trusty/virtualbox-lts-xenial/trusty-updates

« back to all changes in this revision

Viewing changes to src/VBox/Devices/PC/ipxe/src/include/linux_api.h

  • Committer: Package Import Robot
  • Author(s): Gianfranco Costamagna
  • Date: 2016-02-23 14:28:26 UTC
  • Revision ID: package-import@ubuntu.com-20160223142826-bdu69el2z6wa2a44
Tags: upstream-4.3.36-dfsg
Import upstream version 4.3.36-dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2010 Piotr Jaroszyński <p.jaroszynski@gmail.com>
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License as
 
6
 * published by the Free Software Foundation; either version 2 of the
 
7
 * License, or any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful, but
 
10
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 
17
 */
 
18
 
 
19
#ifndef _LINUX_API_H
 
20
#define _LINUX_API_H
 
21
 
 
22
/** * @file
 
23
 *
 
24
 * Linux API prototypes.
 
25
 * Most of the functions map directly to linux syscalls and are the equivalent
 
26
 * of POSIX functions with the linux_ prefix removed.
 
27
 */
 
28
 
 
29
FILE_LICENCE(GPL2_OR_LATER);
 
30
 
 
31
#include <bits/linux_api.h>
 
32
#include <bits/linux_api_platform.h>
 
33
 
 
34
#include <stdint.h>
 
35
 
 
36
#define __KERNEL_STRICT_NAMES
 
37
#include <linux/types.h>
 
38
#include <linux/posix_types.h>
 
39
typedef __kernel_pid_t pid_t;
 
40
typedef __kernel_suseconds_t suseconds_t;
 
41
typedef __kernel_loff_t loff_t;
 
42
#include <linux/time.h>
 
43
#include <linux/mman.h>
 
44
#include <linux/fcntl.h>
 
45
#include <linux/ioctl.h>
 
46
#include <linux/poll.h>
 
47
typedef unsigned long nfds_t;
 
48
typedef uint32_t useconds_t;
 
49
#define MAP_FAILED ( ( void * ) -1 )
 
50
 
 
51
extern long linux_syscall ( int number, ... );
 
52
 
 
53
extern int linux_open ( const char *pathname, int flags );
 
54
extern int linux_close ( int fd );
 
55
extern __kernel_ssize_t linux_read ( int fd, void *buf, __kernel_size_t count );
 
56
extern __kernel_ssize_t linux_write ( int fd, const void *buf,
 
57
                                      __kernel_size_t count );
 
58
extern int linux_fcntl ( int fd, int cmd, ... );
 
59
extern int linux_ioctl ( int fd, int request, ... );
 
60
extern int linux_poll ( struct pollfd *fds, nfds_t nfds, int timeout );
 
61
extern int linux_nanosleep ( const struct timespec *req, struct timespec *rem );
 
62
extern int linux_usleep ( useconds_t usec );
 
63
extern int linux_gettimeofday ( struct timeval *tv, struct timezone *tz );
 
64
extern void * linux_mmap ( void *addr, __kernel_size_t length, int prot,
 
65
                           int flags, int fd, off_t offset );
 
66
extern void * linux_mremap ( void *old_address, __kernel_size_t old_size,
 
67
                             __kernel_size_t new_size, int flags );
 
68
extern int linux_munmap ( void *addr, __kernel_size_t length );
 
69
 
 
70
extern const char * linux_strerror ( int errnum );
 
71
 
 
72
#endif /* _LINUX_API_H */