Macros | Functions | Variables
linux_api.h File Reference

Linux host API. More...

#include <stdint.h>
#include <linux/time.h>
#include <linux/mman.h>
#include <linux/fcntl.h>
#include <linux/ioctl.h>
#include <linux/poll.h>
#include <linux/fs.h>

Go to the source code of this file.


#define MAP_FAILED   ( ( void * ) -1 )


int __asmcall linux_open (const char *pathname, int flags,...)
int __asmcall linux_close (int fd)
off_t __asmcall linux_lseek (int fd, off_t offset, int whence)
ssize_t __asmcall linux_read (int fd, void *buf, size_t count)
ssize_t __asmcall linux_write (int fd, const void *buf, size_t count)
int __asmcall linux_fcntl (int fd, int cmd,...)
int __asmcall linux_ioctl (int fd, unsigned long request,...)
int __asmcall linux_fstat_size (int fd, size_t *size)
int __asmcall linux_poll (struct pollfd *fds, unsigned int nfds, int timeout)
int __asmcall linux_nanosleep (const struct timespec *req, struct timespec *rem)
int __asmcall linux_usleep (unsigned int usec)
int __asmcall linux_gettimeofday (struct timeval *tv, struct timezone *tz)
void *__asmcall linux_mmap (void *addr, size_t length, int prot, int flags, int fd, off_t offset)
void *__asmcall linux_mremap (void *old_address, size_t old_size, size_t new_size, int flags,...)
int __asmcall linux_munmap (void *addr, size_t length)
int __asmcall linux_socket (int domain, int type, int protocol)
int __asmcall linux_bind (int sockfd, const struct sockaddr *addr, size_t addrlen)
ssize_t __asmcall linux_sendto (int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, size_t addrlen)
const char *__asmcall linux_strerror (int linux_errno)
struct Slirp *__asmcall linux_slirp_new (const struct slirp_config *config, const struct slirp_callbacks *callbacks, void *opaque)
void __asmcall linux_slirp_cleanup (struct Slirp *slirp)
void __asmcall linux_slirp_input (struct Slirp *slirp, const uint8_t *pkt, int pkt_len)
void __asmcall linux_slirp_pollfds_fill (struct Slirp *slirp, uint32_t *timeout, int(__asmcall *add_poll)(int fd, int events, void *opaque), void *opaque)
void __asmcall linux_slirp_pollfds_poll (struct Slirp *slirp, int select_error, int(__asmcall *get_revents)(int idx, void *opaque), void *opaque)


int linux_errno
int linux_argc
char ** linux_argv

Detailed Description

Linux host API.

This file is included from both the iPXE build environment and the host build environment.

Definition in file linux_api.h.

Macro Definition Documentation



Definition at line 42 of file linux_api.h.


#define MAP_FAILED   ( ( void * ) -1 )

Definition at line 49 of file linux_api.h.

Function Documentation



◆ linux_open()

int __asmcall linux_open ( const char *  pathname,
int  flags,

◆ linux_close()

int __asmcall linux_close ( int  fd)

◆ linux_lseek()

off_t __asmcall linux_lseek ( int  fd,
off_t  offset,
int  whence 

◆ linux_read()

ssize_t __asmcall linux_read ( int  fd,
void *  buf,
size_t  count 

◆ linux_write()

ssize_t __asmcall linux_write ( int  fd,
const void *  buf,
size_t  count 

◆ linux_fcntl()

int __asmcall linux_fcntl ( int  fd,
int  cmd,

◆ linux_ioctl()

int __asmcall linux_ioctl ( int  fd,
unsigned long  request,

◆ linux_fstat_size()

int __asmcall linux_fstat_size ( int  fd,
size_t size 

◆ linux_poll()

int __asmcall linux_poll ( struct pollfd *  fds,
unsigned int  nfds,
int  timeout 

◆ linux_nanosleep()

int __asmcall linux_nanosleep ( const struct timespec *  req,
struct timespec *  rem 

◆ linux_usleep()

int __asmcall linux_usleep ( unsigned int  usec)

◆ linux_gettimeofday()

int __asmcall linux_gettimeofday ( struct timeval *  tv,
struct timezone *  tz 

◆ linux_mmap()

void* __asmcall linux_mmap ( void *  addr,
size_t  length,
int  prot,
int  flags,
int  fd,
off_t  offset 

◆ linux_mremap()

void* __asmcall linux_mremap ( void *  old_address,
size_t  old_size,
size_t  new_size,
int  flags,

◆ linux_munmap()

int __asmcall linux_munmap ( void *  addr,
size_t  length 

◆ linux_socket()

int __asmcall linux_socket ( int  domain,
int  type,
int  protocol 

◆ linux_bind()

int __asmcall linux_bind ( int  sockfd,
const struct sockaddr addr,
size_t  addrlen 

◆ linux_sendto()

ssize_t __asmcall linux_sendto ( int  sockfd,
const void *  buf,
size_t  len,
int  flags,
const struct sockaddr dest_addr,
size_t  addrlen 

◆ linux_strerror()

const char* __asmcall linux_strerror ( int  linux_errno)

◆ linux_slirp_new()

struct Slirp* __asmcall linux_slirp_new ( const struct slirp_config config,
const struct slirp_callbacks callbacks,
void *  opaque 

◆ linux_slirp_cleanup()

void __asmcall linux_slirp_cleanup ( struct Slirp *  slirp)

◆ linux_slirp_input()

void __asmcall linux_slirp_input ( struct Slirp *  slirp,
const uint8_t pkt,
int  pkt_len 

◆ linux_slirp_pollfds_fill()

void __asmcall linux_slirp_pollfds_fill ( struct Slirp *  slirp,
uint32_t timeout,
int(__asmcall *add_poll)(int fd, int events, void *opaque)  ,
void *  opaque 

◆ linux_slirp_pollfds_poll()

void __asmcall linux_slirp_pollfds_poll ( struct Slirp *  slirp,
int  select_error,
int(__asmcall *get_revents)(int idx, void *opaque)  ,
void *  opaque 

Variable Documentation

◆ linux_errno

int linux_errno

◆ linux_argc

int linux_argc

Definition at line 29 of file linux_args.c.

Referenced by linux_args_parse().

◆ linux_argv

char** linux_argv

Definition at line 30 of file linux_args.c.

Referenced by linux_args_parse().