iPXE
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.

Macros

#define __KERNEL_STRICT_NAMES
#define MAP_FAILED   ( ( void * ) -1 )

Functions

 FILE_LICENCE (GPL2_OR_LATER)
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)

Variables

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

◆ __KERNEL_STRICT_NAMES

#define __KERNEL_STRICT_NAMES

Definition at line 42 of file linux_api.h.

◆ MAP_FAILED

#define MAP_FAILED   ( ( void * ) -1 )

Definition at line 49 of file linux_api.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER )

◆ linux_open()

int __asmcall linux_open ( const char * pathname,
int flags,
... )
extern

References __asmcall, and flags.

Referenced by tap_open().

◆ linux_close()

int __asmcall linux_close ( int fd)
extern

◆ linux_lseek()

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

References __asmcall, and offset.

◆ linux_read()

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

References __asmcall, and count.

Referenced by af_packet_nic_poll(), and tap_poll().

◆ linux_write()

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

References __asmcall, and count.

Referenced by tap_transmit().

◆ linux_fcntl()

int __asmcall linux_fcntl ( int fd,
int cmd,
... )
extern

References __asmcall, and cmd.

Referenced by af_packet_nic_open(), and tap_open().

◆ linux_ioctl()

int __asmcall linux_ioctl ( int fd,
unsigned long request,
... )
extern

◆ linux_fstat_size()

int __asmcall linux_fstat_size ( int fd,
size_t * size )
extern

References __asmcall, and size.

◆ linux_poll()

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

References __asmcall, and timeout().

Referenced by af_packet_nic_poll(), slirp_poll(), and tap_poll().

◆ linux_nanosleep()

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

References __asmcall.

◆ linux_usleep()

int __asmcall linux_usleep ( unsigned int usec)
extern

References __asmcall.

◆ linux_gettimeofday()

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

References __asmcall.

◆ linux_mmap()

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

References __asmcall, addr, flags, length, and offset.

◆ linux_mremap()

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

References __asmcall, and flags.

◆ linux_munmap()

int __asmcall linux_munmap ( void * addr,
size_t length )
extern

References __asmcall, addr, and length.

◆ linux_socket()

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

◆ linux_bind()

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

References __asmcall, and addr.

Referenced by af_packet_nic_open().

◆ 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 )
extern

References __asmcall, dest_addr, flags, and len.

Referenced by af_packet_nic_transmit().

◆ linux_strerror()

const char *__asmcall linux_strerror ( int linux_errno)
extern

◆ linux_slirp_new()

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

Referenced by slirp_probe().

◆ linux_slirp_cleanup()

void __asmcall linux_slirp_cleanup ( struct Slirp * slirp)
extern

References __asmcall.

Referenced by slirp_probe(), and slirp_remove().

◆ linux_slirp_input()

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

References __asmcall, and pkt_len.

Referenced by slirp_transmit().

◆ 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 )
extern

References __asmcall, and timeout().

Referenced by slirp_poll().

◆ 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 )
extern

References __asmcall.

Referenced by slirp_poll().

Variable Documentation

◆ linux_errno

◆ linux_argc

int linux_argc
extern

Definition at line 29 of file linux_args.c.

Referenced by linux_args_parse().

◆ linux_argv

char** linux_argv
extern

Definition at line 30 of file linux_args.c.

Referenced by linux_args_parse().