source: mainline/uspace/lib/c/arch/amd64/include/libarch/fibril.h@ d7f7a4a

Last change on this file since d7f7a4a was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 4 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: 721 bytes
Line 
1/*
2 * SPDX-FileCopyrightText: 2006 Ondrej Palkovsky
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7/** @addtogroup libcamd64
8 * @{
9 */
10/** @file
11 */
12
13#ifndef _LIBC_amd64_FIBRIL_H_
14#define _LIBC_amd64_FIBRIL_H_
15
16#include <libarch/fibril_context.h>
17
18/*
19 * According to ABI the stack MUST be aligned on
20 * 16-byte boundary. If it is not, the va_arg calling will
21 * panic sooner or later
22 */
23#define SP_DELTA 16
24
25#define context_set(c, _pc, stack, size, ptls) \
26 do { \
27 (c)->pc = (sysarg_t) (_pc); \
28 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
29 (c)->tls = (sysarg_t) (ptls); \
30 (c)->rbp = 0; \
31 } while (0)
32
33static inline uintptr_t _context_get_fp(context_t *ctx)
34{
35 return ctx->rbp;
36}
37
38#endif
39
40/** @}
41 */
Note: See TracBrowser for help on using the repository browser.