source:
mainline/uspace/lib/c/include/loader/pcb.h@
9bfa8c8
| Last change on this file since 9bfa8c8 was d7f7a4a, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 1.3 KB | |
| Rev | Line | |
|---|---|---|
| [c98e6ee] | 1 | /* |
| [d7f7a4a] | 2 | * SPDX-FileCopyrightText: 2008 Jiri Svoboda |
| [c98e6ee] | 3 | * |
| [d7f7a4a] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
| [c98e6ee] | 5 | */ |
| 6 | ||
| [b1834a01] | 7 | /** @addtogroup libc |
| [c98e6ee] | 8 | * @{ |
| 9 | */ | |
| 10 | /** @file | |
| 11 | * @brief Program Control Block interface. | |
| 12 | */ | |
| 13 | ||
| [4805495] | 14 | #ifndef _LIBC_PCB_H_ |
| 15 | #define _LIBC_PCB_H_ | |
| [c98e6ee] | 16 | |
| [40abf56a] | 17 | #include <tls.h> |
| [7ca51cc] | 18 | |
| [c98e6ee] | 19 | typedef void (*entry_point_t)(void); |
| 20 | ||
| [bb9ec2d] | 21 | struct pcb_inbox_entry { |
| 22 | char *name; | |
| 23 | int file; | |
| 24 | }; | |
| 25 | ||
| [45454e9b] | 26 | /** Program Control Block. |
| 27 | * | |
| [c98e6ee] | 28 | * Holds pointers to data passed from the program loader to the program |
| 29 | * and/or to the dynamic linker. This includes the program entry point, | |
| 30 | * arguments, environment variables etc. | |
| [76d0d284] | 31 | * |
| [c98e6ee] | 32 | */ |
| 33 | typedef struct { | |
| [49093a4] | 34 | /** Program entry point. */ |
| [c98e6ee] | 35 | entry_point_t entry; |
| [a35b458] | 36 | |
| [622cdbe] | 37 | /** Current working directory. */ |
| 38 | char *cwd; | |
| [a35b458] | 39 | |
| [49093a4] | 40 | /** Number of command-line arguments. */ |
| [c98e6ee] | 41 | int argc; |
| [49093a4] | 42 | /** Command-line arguments. */ |
| [c98e6ee] | 43 | char **argv; |
| [a35b458] | 44 | |
| [bb9ec2d] | 45 | /** List of inbox files. */ |
| 46 | struct pcb_inbox_entry *inbox; | |
| 47 | int inbox_entries; | |
| [a35b458] | 48 | |
| [c98e6ee] | 49 | /* |
| [49093a4] | 50 | * ELF-specific data. |
| [c98e6ee] | 51 | */ |
| [a35b458] | 52 | |
| [49093a4] | 53 | /** Pointer to ELF dynamic section of the program. */ |
| [c98e6ee] | 54 | void *dynamic; |
| [17341d4] | 55 | /** Pointer to dynamic linker state structure (rtld_t). */ |
| [1ea99cc] | 56 | void *rtld_runtime; |
| [40abf56a] | 57 | |
| 58 | /** Thread local storage for the main thread. */ | |
| 59 | tcb_t *tcb; | |
| [c98e6ee] | 60 | } pcb_t; |
| 61 | ||
| [49093a4] | 62 | /** |
| 63 | * A pointer to the program control block. Having received the PCB pointer, | |
| 64 | * the C library startup code stores it here for later use. | |
| 65 | */ | |
| [c98e6ee] | 66 | extern pcb_t *__pcb; |
| 67 | ||
| 68 | #endif | |
| 69 | ||
| 70 | /** | |
| 71 | * @} | |
| 72 | */ |
Note:
See TracBrowser
for help on using the repository browser.
