Mercurial > ecos-v2_0-branch
annotate packages/language/c/libc/current/include/setjmp.inl @ 66:bf00f99aec69 ecos-sw-2000-02-02
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
| author | jlarmour |
|---|---|
| date | Wed, 02 Feb 2000 19:57:02 +0000 |
| parents | c38311975d4f |
| children |
| rev | line source |
|---|---|
| 0 | 1 #ifndef CYGONCE_LIBC_SETJMP_INL |
| 2 #define CYGONCE_LIBC_SETJMP_INL | |
| 3 //=========================================================================== | |
| 4 // | |
| 5 // setjmp.inl | |
| 6 // | |
| 7 // Inline functions for ANSI standard non-local jumps | |
| 8 // | |
| 9 //=========================================================================== | |
| 10 //####COPYRIGHTBEGIN#### | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
11 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
12 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
13 // The contents of this file are subject to the Red Hat eCos Public License |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
14 // Version 1.1 (the "License"); you may not use this file except in |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
15 // compliance with the License. You may obtain a copy of the License at |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
16 // http://www.redhat.com/ |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
17 // |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
18 // Software distributed under the License is distributed on an "AS IS" |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
19 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
20 // License for the specific language governing rights and limitations under |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
21 // the License. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
22 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
23 // The Original Code is eCos - Embedded Configurable Operating System, |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
24 // released September 30, 1998. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
25 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
26 // The Initial Developer of the Original Code is Red Hat. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
27 // Portions created by Red Hat are |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
28 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
29 // All Rights Reserved. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
30 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
31 // |
| 0 | 32 //####COPYRIGHTEND#### |
| 33 //=========================================================================== | |
| 34 //#####DESCRIPTIONBEGIN#### | |
| 35 // | |
| 2 | 36 // Author(s): jlarmour |
| 37 // Contributors: jlarmour | |
| 0 | 38 // Date: 1998-02-13 |
| 39 // Purpose: | |
| 40 // Description: Inline functions to implement ANSI standard non-local jumps as | |
| 41 // per ANSI para 7.6 | |
| 42 // Usage: Do not include this file, #include <setjmp.h> instead | |
| 43 // | |
| 44 //####DESCRIPTIONEND#### | |
| 45 // | |
| 46 //=========================================================================== | |
| 47 | |
| 48 // CONFIGURATION | |
| 49 | |
| 50 #include <pkgconf/libc.h> // Configuration header | |
| 51 | |
| 52 // Include the C library? | |
| 53 #ifdef CYGPKG_LIBC | |
| 54 | |
| 55 // INCLUDES | |
| 56 | |
| 57 #include <cyg/infra/cyg_type.h> // Common type definitions and support | |
| 58 #include <cyg/infra/cyg_trac.h> // Common tracing code | |
| 59 #include <cyg/infra/cyg_ass.h> // Common assertion code | |
| 60 #include <setjmp.h> // Header for this file, just in case | |
| 61 #include <cyg/hal/hal_arch.h> // HAL architecture specific implementation | |
| 62 | |
| 63 // INLINE FUNCTIONS | |
| 64 | |
| 65 CYGPRI_LIBC_INLINE void | |
| 66 longjmp( jmp_buf cyg_buf, int cyg_val) | |
| 67 { | |
| 68 CYG_REPORT_FUNCNAME( "longjmp" ); | |
| 69 CYG_REPORT_FUNCARG2( "&cyg_buf=%08x, cyg_val=%d", &cyg_buf, cyg_val ); | |
| 70 | |
| 71 // ANSI says that if we are passed cyg_val==0, then we change it to 1 | |
| 72 if (cyg_val == 0) | |
| 73 ++cyg_val; | |
| 74 | |
| 75 // we let the HAL do the work | |
| 76 | |
| 77 HAL_REORDER_BARRIER(); // prevent any chance of optimisation re-ordering | |
| 78 hal_longjmp( cyg_buf, cyg_val ); | |
| 79 HAL_REORDER_BARRIER(); // prevent any chance of optimisation re-ordering | |
| 80 | |
| 81 #ifdef CYGDBG_USE_ASSERTS | |
| 82 CYG_ASSERT( 0, "longjmp should not have reached this point!" ); | |
| 83 #else | |
| 84 for (;;) | |
| 85 CYG_EMPTY_STATEMENT; | |
| 86 #endif | |
| 87 } // longjmp() | |
| 88 | |
| 89 | |
| 90 #endif // ifdef CYGPKG_LIBC | |
| 91 | |
| 92 #endif // CYGONCE_LIBC_SETJMP_INL multiple inclusion protection | |
| 93 | |
| 94 // EOF setjmp.inl |
