source: mainline/uspace/lib/c/include/loader/pcb.h@ 9bfa8c8

Last change on this file since 9bfa8c8 was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 * SPDX-FileCopyrightText: 2008 Jiri Svoboda
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7/** @addtogroup libc
8 * @{
9 */
10/** @file
11 * @brief Program Control Block interface.
12 */
13
14#ifndef _LIBC_PCB_H_
15#define _LIBC_PCB_H_
16
17#include <tls.h>
18
19typedef void (*entry_point_t)(void);
20
21struct pcb_inbox_entry {
22 char *name;
23 int file;
24};
25
26/** Program Control Block.
27 *
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.
31 *
32 */
33typedef struct {
34 /** Program entry point. */
35 entry_point_t entry;
36
37 /** Current working directory. */
38 char *cwd;
39
40 /** Number of command-line arguments. */
41 int argc;
42 /** Command-line arguments. */
43 char **argv;
44
45 /** List of inbox files. */
46 struct pcb_inbox_entry *inbox;
47 int inbox_entries;
48
49 /*
50 * ELF-specific data.
51 */
52
53 /** Pointer to ELF dynamic section of the program. */
54 void *dynamic;
55 /** Pointer to dynamic linker state structure (rtld_t). */
56 void *rtld_runtime;
57
58 /** Thread local storage for the main thread. */
59 tcb_t *tcb;
60} pcb_t;
61
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 */
66extern pcb_t *__pcb;
67
68#endif
69
70/**
71 * @}
72 */
Note: See TracBrowser for help on using the repository browser.