From 020325d1996ed6d55350c40e835f4151021cc49a Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Thu, 31 Jul 2014 22:23:05 +0400 Subject: [PATCH] __HOST -> __TARGET_HOST_X64 --- Makefile.mk | 2 +- src/libcoreint/opcodes.c | 4 ++-- src/libjsparser/lexer.c | 10 +++++----- src/libjsparser/parser.c | 6 +++--- src/libperipherals/actuators.c | 10 +++++----- src/libperipherals/common-io.c | 2 +- src/main.c | 6 +++--- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Makefile.mk b/Makefile.mk index 46e648489..951fa048c 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -237,7 +237,7 @@ ifeq ($(OPTION_NDEBUG),enable) endif ifeq ($(OPTION_MCU),disable) - DEFINES_JERRY += -D__HOST -DJERRY_SOURCE_BUFFER_SIZE=$$((1024*1024)) + DEFINES_JERRY += -D__TARGET_HOST_x64 -DJERRY_SOURCE_BUFFER_SIZE=$$((1024*1024)) CFLAGS_COMMON += -fno-stack-protector ifeq ($(OPTION_MUSL),enable) diff --git a/src/libcoreint/opcodes.c b/src/libcoreint/opcodes.c index 8d8e7e507..5b07038c3 100644 --- a/src/libcoreint/opcodes.c +++ b/src/libcoreint/opcodes.c @@ -388,7 +388,7 @@ opfunc_call_1 (OPCODE opdata __unused, struct __int_data *int_data) ecma_completion_value_t ret_value; ret_value = ecma_make_empty_completion_value (); -#ifdef __HOST +#ifdef __TARGET_HOST_x64 __printf ("%d::op_call_1:idx:%d:%d\t", int_data->pos, opdata.data.call_1.name_lit_idx, @@ -400,7 +400,7 @@ opfunc_call_1 (OPCODE opdata __unused, struct __int_data *int_data) string_literal_copy str_value; init_string_literal_copy( opdata.data.call_1.name_lit_idx, &str_value); -#ifdef __HOST +#ifdef __TARGET_HOST_x64 __printf("%s\n", str_value.str_p); #endif diff --git a/src/libjsparser/lexer.c b/src/libjsparser/lexer.c index 580daa717..8419bc210 100644 --- a/src/libjsparser/lexer.c +++ b/src/libjsparser/lexer.c @@ -96,7 +96,7 @@ increase_strings_cache (void) strings_cache_size = new_cache_size; } -#ifdef __HOST +#ifdef __TARGET_HOST_x64 static void dump_current_line (void) { @@ -897,20 +897,20 @@ lexer_next_token_private (void) token lexer_next_token (void) { -#ifdef __HOST +#ifdef __TARGET_HOST_x64 if (buffer == buffer_start) dump_current_line (); -#endif /* __HOST */ +#endif /* __TARGET_HOST_x64 */ token tok = lexer_next_token_private (); -#ifdef __HOST +#ifdef __TARGET_HOST_x64 if (tok.type == TOK_NEWLINE) { dump_current_line (); return tok; } -#endif /* __HOST */ +#endif /* __TARGET_HOST_x64 */ return tok; } diff --git a/src/libjsparser/parser.c b/src/libjsparser/parser.c index 292da0d19..01355e501 100644 --- a/src/libjsparser/parser.c +++ b/src/libjsparser/parser.c @@ -68,7 +68,7 @@ assert_keyword (keyword kw) { if (tok.type != TOK_KEYWORD || tok.data.kw != kw) { -#ifdef __HOST +#ifdef __TARGET_HOST_x64 __printf ("assert_keyword: %d\n", kw); #endif JERRY_UNREACHABLE (); @@ -86,7 +86,7 @@ current_token_must_be(token_type tt) { if (tok.type != tt) { -#ifdef __HOST +#ifdef __TARGET_HOST_x64 __printf ("current_token_must_be: %d\n", tt); #endif parser_fatal (ERR_PARSER); @@ -107,7 +107,7 @@ next_token_must_be (token_type tt) tok = lexer_next_token (); if (tok.type != tt) { -#ifdef __HOST +#ifdef __TARGET_HOST_x64 __printf ("next_token_must_be: %d\n", tt); #endif parser_fatal (ERR_PARSER); diff --git a/src/libperipherals/actuators.c b/src/libperipherals/actuators.c index 22ccd6c09..4faffc3d8 100644 --- a/src/libperipherals/actuators.c +++ b/src/libperipherals/actuators.c @@ -29,7 +29,7 @@ void led_toggle (uint32_t led_id) { -#ifdef __HOST +#ifdef __TARGET_HOST_x64 __printf ("led_toggle: %d\n", led_id); #endif @@ -42,7 +42,7 @@ led_toggle (uint32_t led_id) void led_on (uint32_t led_id) { -#ifdef __HOST +#ifdef __TARGET_HOST_x64 __printf ("led_on: %d\n", led_id); #endif @@ -55,7 +55,7 @@ led_on (uint32_t led_id) void led_off (uint32_t led_id) { -#ifdef __HOST +#ifdef __TARGET_HOST_x64 __printf ("led_off: %d\n", led_id); #endif @@ -67,7 +67,7 @@ led_off (uint32_t led_id) void led_blink_once (uint32_t led_id) { -#ifdef __HOST +#ifdef __TARGET_HOST_x64 __printf ("led_blink_once: %d\n", led_id); #endif @@ -93,4 +93,4 @@ void initialize_leds() GPIO_WriteBit(GPIOD, GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15, Bit_RESET); } -#endif \ No newline at end of file +#endif diff --git a/src/libperipherals/common-io.c b/src/libperipherals/common-io.c index 68db2ae4f..d52c45dab 100644 --- a/src/libperipherals/common-io.c +++ b/src/libperipherals/common-io.c @@ -60,7 +60,7 @@ analog_write (uint32_t arg1 __unused, uint32_t arg2 __unused) void wait_ms (uint32_t time_ms) { -#ifdef __HOST +#ifdef __TARGET_HOST_x64 // 1 millisecond = 1,000,000 Nanoseconds #define NANO_SECOND_MULTIPLIER 1000000 __printf ("wait_ms: %d\n", time_ms); diff --git a/src/main.c b/src/main.c index 4464d40fe..5ce0a4f8a 100644 --- a/src/main.c +++ b/src/main.c @@ -61,7 +61,7 @@ parser_run (const char *script_source, size_t script_source_size, bool is_show_o optimizer_run_passes ((OPCODE *) opcodes); -#ifdef __HOST +#ifdef __TARGET_HOST_x64 serializer_print_opcodes (); #endif @@ -87,12 +87,12 @@ jerry_run (const char *script_source, size_t script_source_size, bool is_parse_o init_int (opcodes); -#ifdef __HOST +#ifdef __TARGET_HOST_x64 run_int (); #endif } /* jerry_run */ -#ifdef __HOST +#ifdef __TARGET_HOST_x64 static uint8_t source_buffer[ JERRY_SOURCE_BUFFER_SIZE ]; static const char*