• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
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 #ifdef JERRY_IAR_JUPITER
17 
18 #include "jerryscript.h"
19 #include "jmem.h"
20 #include "config-jupiter.h"
21 
22 uint8_t* input_buffer;
23 uint8_t* snapshot_buffer;
24 uint8_t* bms_context_and_heap;
25 uint8_t* js_context_and_heap;
26 
JerryPsRamMemInit()27 void JerryPsRamMemInit()
28 {
29   // memory for js task
30   js_context_and_heap = OhosMalloc(MEM_TYPE_JERRY_LSRAM, JS_TASK_CONTEXT_AND_HEAP_SIZE_BYTE);
31 }
32 
JerryBmsPsRamMemInit()33 void JerryBmsPsRamMemInit()
34 {
35   // memory for input_js file, snapshot file and bms task
36   input_buffer = OhosMalloc(MEM_TYPE_JERRY_LSRAM, INPUTJS_BUFFER_SIZE);
37   snapshot_buffer = OhosMalloc(MEM_TYPE_JERRY_LSRAM, SNAPSHOT_BUFFER_SIZE);
38   bms_context_and_heap = OhosMalloc(MEM_TYPE_JERRY_LSRAM, BMS_TASK_CONTEXT_AND_HEAP_SIZE * CONVERTION_RATIO);
39 }
40 
41 #endif // JERRY_IAR_JUPITER
42