From b50c3f11e86b4585b0e88cf314f6dd01d82db80e Mon Sep 17 00:00:00 2001 From: wanggang Date: Tue, 23 Mar 2021 16:32:37 +0800 Subject: [PATCH] Description:fill up adapter file with copyright info Team:PDU_DRV Feature or Bugfix:Bugfix Binary Source:No PrivateCode(Yes/No):No Change-Id: I87a1d1ded82ae3cb1a0c0e860669f38338af5f80 ChangeID:13384388 --- jerry-core/api/jerryscript_adapter.c | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 jerry-core/api/jerryscript_adapter.c diff --git a/jerry-core/api/jerryscript_adapter.c b/jerry-core/api/jerryscript_adapter.c new file mode 100644 index 00000000..7d34bf1b --- /dev/null +++ b/jerry-core/api/jerryscript_adapter.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed 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. + */ + +#ifdef JERRY_IAR_JUPITER + +#include "jerryscript.h" +#include "jmem.h" +#include "config-jupiter.h" + +uint8_t* input_buffer; +uint8_t* snapshot_buffer; +uint8_t* bms_context_and_heap; +uint8_t* js_context_and_heap; + +void JerryPsRamMemInit() +{ + // memory for input_js file and snapshot file + input_buffer = OhosMalloc(MEM_TYPE_JERRY_LSRAM, INPUTJS_BUFFER_SIZE); + snapshot_buffer = OhosMalloc(MEM_TYPE_JERRY_LSRAM, SNAPSHOT_BUFFER_SIZE); + bms_context_and_heap = OhosMalloc(MEM_TYPE_JERRY_LSRAM, BMS_TASK_CONTEXT_AND_HEAP_SIZE * CONVERTION_RATIO); + js_context_and_heap = OhosMalloc(MEM_TYPE_JERRY_LSRAM, JS_TASK_CONTEXT_AND_HEAP_SIZE_BYTE); +} + +#endif // JERRY_IAR_JUPITER -- Gitee