forked from apache/nuttx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: liwenxiang1 <[email protected]>
- Loading branch information
Showing
50 changed files
with
1,450 additions
and
281 deletions.
There are no files selected for viewing
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
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,106 @@ | ||
/**************************************************************************** | ||
* arch/x86_64/include/setjmp.h | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. The | ||
* ASF licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
****************************************************************************/ | ||
|
||
#ifndef __ARCH_X86_64_INCLUDE_SETJUMP_H | ||
#define __ARCH_X86_64_INCLUDE_SETJUMP_H | ||
|
||
/**************************************************************************** | ||
* Included Files | ||
****************************************************************************/ | ||
|
||
#include <nuttx/config.h> | ||
#include <nuttx/compiler.h> | ||
|
||
/**************************************************************************** | ||
* Pre-processor Definitions | ||
****************************************************************************/ | ||
|
||
/* Storage order: %rbx, %rsp, %rbp, %r12, %r13, %r14, %r15, %rip */ | ||
|
||
# define XCPTCONTEXT_REGS 9 | ||
# define XCPTCONTEXT_SIZE (8 * XCPTCONTEXT_REGS) | ||
|
||
# ifdef __ASSEMBLY__ | ||
|
||
# define JB_RBX (0*8) | ||
# define JB_RSP (1*8) | ||
# define JB_RBP (2*8) | ||
# define JB_R12 (3*8) | ||
# define JB_R13 (4*8) | ||
# define JB_R14 (5*8) | ||
# define JB_R15 (6*8) | ||
# define JB_RIP (7*8) | ||
# define JB_FLAG (8*8) | ||
|
||
# else | ||
|
||
# define JB_RBX (0) | ||
# define JB_RSP (1) | ||
# define JB_RBP (2) | ||
# define JB_R12 (3) | ||
# define JB_R13 (4) | ||
# define JB_R14 (5) | ||
# define JB_R15 (6) | ||
# define JB_RIP (7) | ||
# define JB_FLAG (8) | ||
|
||
# endif /* __ASSEMBLY__ */ | ||
|
||
/* Compatibility definitions */ | ||
|
||
# define JB_FP JB_RBP | ||
# define JB_SP JB_RSP | ||
# define JB_PC JB_RIP | ||
|
||
/**************************************************************************** | ||
* Public Types | ||
****************************************************************************/ | ||
|
||
#ifndef __ASSEMBLY__ | ||
|
||
typedef unsigned long xcpt_reg_t; | ||
typedef xcpt_reg_t jmp_buf[XCPTCONTEXT_REGS]; | ||
|
||
#endif | ||
|
||
/**************************************************************************** | ||
* Public Function Prototypes | ||
****************************************************************************/ | ||
|
||
#ifndef __ASSEMBLY__ | ||
|
||
#ifdef __cplusplus | ||
#define EXTERN extern "C" | ||
extern "C" | ||
{ | ||
#else | ||
#define EXTERN extern | ||
#endif | ||
|
||
int setjmp(jmp_buf env); | ||
void longjmp(jmp_buf env, int val) noreturn_function; | ||
|
||
#undef EXTERN | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* !__ASSEMBLY__ */ | ||
#endif /* __ARCH_X86_64_INCLUDE_SETJUMP_H */ |
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
Oops, something went wrong.