File tree Expand file tree Collapse file tree 4 files changed +90
-27
lines changed
targets/tizenrt-artik05x/apps/jerryscript Expand file tree Collapse file tree 4 files changed +90
-27
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ EXTRA_LIBS += libjerry-core.a libjerry-libm.a
100
100
LINKLIBS =$(EXTRA_LIBS )
101
101
102
102
103
- ASRCS =
103
+ ASRCS = setjmp.S
104
104
CSRCS =
105
105
MAINSRC = jerry_main.c
106
106
Original file line number Diff line number Diff line change 16
16
#include <stdio.h>
17
17
#include <string.h>
18
18
#include <stdlib.h>
19
- #include <setjmp.h>
20
19
21
20
#include "jerryscript.h"
22
21
#include "jerryscript-ext/handler.h"
23
22
#include "jerryscript-port.h"
24
23
#include "jmem.h"
24
+ #include "setjmp.h"
25
25
26
26
#include <apps/shell/tash.h> // To register tash command
27
27
@@ -546,28 +546,3 @@ jerry_register_cmd (void) {
546
546
tash_cmdlist_install (tash_cmds );
547
547
return 0 ;
548
548
}
549
-
550
- /**
551
- * Compiler built-in setjmp function.
552
- *
553
- * @return 0 when called the first time
554
- * 1 when returns from a longjmp call
555
- */
556
- int
557
- setjmp (jmp_buf buf )
558
- {
559
- return __builtin_setjmp (buf );
560
- } /* setjmp */
561
-
562
- /**
563
- * Compiler built-in longjmp function.
564
- *
565
- * Note:
566
- * ignores value argument
567
- */
568
- void
569
- longjmp (jmp_buf buf , int value )
570
- {
571
- /* Must be called with 1. */
572
- __builtin_longjmp (buf , 1 );
573
- } /* longjmp */
Original file line number Diff line number Diff line change
1
+ / * Copyright JS Foundation and other contributors , http:// js .foundation
2
+ *
3
+ * Licensed under the Apache License , Version 2 . 0 (the "License" ) ;
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE - 2 . 0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing , software
10
+ * distributed under the License is distributed on an "AS IS" BASIS
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ * /
15
+
16
+ .syntax unified
17
+
18
+ .macro func _name
19
+ . global \_name
20
+ .type \_name , %function
21
+ \_name:
22
+ .endm
23
+ .macro endfunc _name
24
+ .size \_name , . - \_name
25
+ .endm
26
+
27
+ / **
28
+ * setjmp (jmp_buf env)
29
+ *
30
+ * See also:
31
+ * longjmp
32
+ *
33
+ * @return 0 - if returns from direct call ,
34
+ * nonzero - if returns after longjmp.
35
+ * /
36
+ func setjmp
37
+ stmia r0! , {r4 - r11 , lr}
38
+ str sp , [ r0 ], # 4
39
+ mov r0 , # 0
40
+ bx lr
41
+ endfunc setjmp
42
+
43
+ / **
44
+ * longjmp (jmp_buf env , int val)
45
+ *
46
+ * Note:
47
+ * if val is not 0 , then it would be returned from setjmp ,
48
+ * otherwise - 0 would be returned.
49
+ *
50
+ * See also:
51
+ * setjmp
52
+ * /
53
+ func longjmp
54
+ ldmia r0! , {r4 - r11 , lr}
55
+ ldr sp , [ r0 ]
56
+ add r0 , r0 , # 4
57
+ mov r0 , r1
58
+ cmp r0 , # 0
59
+ bne 1f
60
+ mov r0 , # 1
61
+ 1 :
62
+ bx lr
63
+ endfunc longjmp
Original file line number Diff line number Diff line change
1
+ /* Copyright JS Foundation and other contributors, http://js.foundation
2
+ *
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ #ifndef SETJMP_H
16
+ #define SETJMP_H
17
+
18
+ #include <stdint.h>
19
+
20
+ typedef uint64_t jmp_buf [14 ];
21
+
22
+ int setjmp (jmp_buf env );
23
+ void longjmp (jmp_buf env , int val );
24
+
25
+ #endif /* !SETJMP_H */
You can’t perform that action at this time.
0 commit comments