-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LibOS] Move Linux ABI headers to a separate directory (part 1)
Signed-off-by: Michał Kowalczyk <mkow@invisiblethingslab.com>
- Loading branch information
Showing
13 changed files
with
220 additions
and
160 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
/* Copyright (C) 2023 Intel Corporation | ||
* Michał Kowalczyk <mkow@invisiblethingslab.com> | ||
*/ | ||
#pragma once | ||
|
||
/* Types and structures used by various Linux ABIs (e.g. syscalls). */ | ||
/* These need to be binary-identical with the ones used by Linux. */ | ||
|
||
#define SIGS_CNT 64 | ||
#define SIGRTMIN 32 | ||
|
||
typedef struct { | ||
unsigned long __val[SIGS_CNT / (8 * sizeof(unsigned long))]; | ||
} __sigset_t; | ||
|
||
#define RED_ZONE_SIZE 128 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
/* Copyright (C) 2023 Intel Corporation | ||
* Michał Kowalczyk <mkow@invisiblethingslab.com> | ||
*/ | ||
#pragma once | ||
|
||
/* Types and structures used by various Linux ABIs (e.g. syscalls). */ | ||
/* These need to be binary-identical with the ones used by Linux. */ | ||
|
||
#include <stdint.h> | ||
|
||
struct linux_dirent64 { | ||
uint64_t d_ino; /* Inode number */ | ||
uint64_t d_off; /* Offset to next linux_dirent */ | ||
unsigned short int d_reclen; /* Length of this linux_dirent */ | ||
unsigned char d_type; | ||
char d_name[]; /* File name (null-terminated) */ | ||
}; | ||
|
||
struct linux_dirent { | ||
unsigned long d_ino; /* Inode number */ | ||
unsigned long d_off; /* Offset to next linux_dirent */ | ||
unsigned short int d_reclen; /* Length of this linux_dirent */ | ||
char d_name[]; /* File name (null-terminated) */ | ||
}; | ||
|
||
struct linux_dirent_tail { | ||
char pad; | ||
unsigned char d_type; | ||
}; | ||
|
||
#define LINUX_DT_UNKNOWN 0 | ||
#define LINUX_DT_FIFO 1 | ||
#define LINUX_DT_CHR 2 | ||
#define LINUX_DT_DIR 4 | ||
#define LINUX_DT_BLK 6 | ||
#define LINUX_DT_REG 8 | ||
#define LINUX_DT_LNK 10 | ||
#define LINUX_DT_SOCK 12 | ||
#define LINUX_DT_WHT 14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
/* Copyright (C) 2023 Intel Corporation | ||
* Michał Kowalczyk <mkow@invisiblethingslab.com> | ||
*/ | ||
#pragma once | ||
|
||
/* Types and structures used by various Linux ABIs (e.g. syscalls). */ | ||
/* These need to be binary-identical with the ones used by Linux. */ | ||
|
||
#include <stdint.h> | ||
|
||
#include "linux_abi/time.h" | ||
|
||
struct __kernel_rusage { | ||
struct __kernel_timeval ru_utime; /* user time used */ | ||
struct __kernel_timeval ru_stime; /* system time used */ | ||
long ru_maxrss; /* maximum resident set size */ | ||
long ru_ixrss; /* integral shared memory size */ | ||
long ru_idrss; /* integral unshared data size */ | ||
long ru_isrss; /* integral unshared stack size */ | ||
long ru_minflt; /* page reclaims */ | ||
long ru_majflt; /* page faults */ | ||
long ru_nswap; /* swaps */ | ||
long ru_inblock; /* block input operations */ | ||
long ru_oublock; /* block output operations */ | ||
long ru_msgsnd; /* messages sent */ | ||
long ru_msgrcv; /* messages received */ | ||
long ru_nsignals; /* signals received */ | ||
long ru_nvcsw; /* voluntary context switches */ | ||
long ru_nivcsw; /* involuntary " */ | ||
}; | ||
|
||
struct __kernel_rlimit { | ||
unsigned long rlim_cur, rlim_max; | ||
}; | ||
|
||
struct __kernel_rlimit64 { | ||
uint64_t rlim_cur, rlim_max; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
/* Copyright (C) 2023 Intel Corporation | ||
* Michał Kowalczyk <mkow@invisiblethingslab.com> | ||
*/ | ||
#pragma once | ||
|
||
/* Types and structures used by various Linux ABIs (e.g. syscalls). */ | ||
/* These need to be binary-identical with the ones used by Linux. */ | ||
|
||
struct __kernel_sched_param { | ||
int __sched_priority; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
/* Copyright (C) 2023 Intel Corporation | ||
* Michał Kowalczyk <mkow@invisiblethingslab.com> | ||
*/ | ||
#pragma once | ||
|
||
/* Types and structures used by various Linux ABIs (e.g. syscalls). */ | ||
/* These need to be binary-identical with the ones used by Linux. */ | ||
|
||
// TODO: remove all of these includes and make this header libc-independent. | ||
#include <asm/siginfo.h> | ||
#include <asm/signal.h> | ||
|
||
#include "linux_abi/signals_arch.h" | ||
|
||
struct __kernel_sigaction { | ||
__sighandler_t k_sa_handler; | ||
unsigned long sa_flags; | ||
void (*sa_restorer)(void); | ||
__sigset_t sa_mask; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
/* Copyright (C) 2023 Intel Corporation | ||
* Michał Kowalczyk <mkow@invisiblethingslab.com> | ||
*/ | ||
#pragma once | ||
|
||
/* Types and structures used by various Linux ABIs (e.g. syscalls). */ | ||
/* These need to be binary-identical with the ones used by Linux. */ | ||
|
||
// TODO: remove all of these includes and make this header libc-independent. | ||
#include <linux/times.h> | ||
#include <linux/timex.h> | ||
#include <linux/utime.h> | ||
|
||
typedef __kernel_time_t time_t; | ||
|
||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) | ||
struct __kernel_timespec { | ||
__kernel_time_t tv_sec; /* seconds */ | ||
long tv_nsec; /* nanoseconds */ | ||
}; | ||
#endif | ||
|
||
struct __kernel_timeval { | ||
__kernel_time_t tv_sec; /* seconds */ | ||
__kernel_suseconds_t tv_usec; /* microsecond */ | ||
}; | ||
|
||
struct __kernel_itimerval { | ||
struct __kernel_timeval it_interval; /* time interval */ | ||
struct __kernel_timeval it_value; /* current value */ | ||
}; | ||
|
||
struct __kernel_timezone { | ||
int tz_minuteswest; /* minutes west of Greenwich */ | ||
int tz_dsttime; /* type of dst correction */ | ||
}; |
Oops, something went wrong.