Skip to content

Commit 2279ce9

Browse files
committed
Add ASF headers and split host uTVM API defs
1 parent 1d60271 commit 2279ce9

File tree

5 files changed

+98
-7
lines changed

5 files changed

+98
-7
lines changed

src/runtime/micro/device/arm/stm32f746xx/utvm_init.s

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
20+
/*!
21+
* Copyright (c) 2019 by Contributors
22+
* \file utvm_init.s
23+
* \brief uTVM init definition for STM32F746XX-series boards
24+
*/
25+
1926
.syntax unified
2027
.cpu cortex-m7
2128
.fpu softvfp

src/runtime/micro/device/arm/stm32f746xx/utvm_timer.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
/*!
21+
* Copyright (c) 2019 by Contributors
22+
* \file utvm_timer.c
23+
* \brief uTVM timer API definitions for STM32F746XX-series boards
24+
*/
25+
126
#ifdef __cplusplus
227
extern "C" {
328
#endif
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
/*!
21+
* Copyright (c) 2019 by Contributors
22+
* \file utvm_init.c
23+
* \brief uTVM init definition for the host emulated device
24+
*/
25+
26+
#ifdef __cplusplus
27+
extern "C" {
28+
#endif
29+
30+
#include "utvm_runtime.h"
31+
32+
void UTVMInit() {
33+
// no init required for the host
34+
UTVMMain();
35+
}
36+
37+
#ifdef __cplusplus
38+
} // TVM_EXTERN_C
39+
#endif

src/runtime/micro/device/host/utvm_timer.c

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
/*!
21+
* Copyright (c) 2019 by Contributors
22+
* \file utvm_timer.c
23+
* \brief uTVM timer API stubs for the host emulated device
24+
*/
125

226
#ifdef __cplusplus
327
extern "C" {
@@ -7,10 +31,6 @@ extern "C" {
731

832
// TODO(weberlo): use this? https://stackoverflow.com/questions/5141960/get-the-current-time-in-c
933

10-
void UTVMInit() {
11-
UTVMMain();
12-
}
13-
1434
int32_t UTVMTimerStart() {
1535
return 0;
1636
}

src/runtime/micro/host_driven/utvm_runtime.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
* \file utvm_runtime.cc
2323
* \brief uTVM runtime
2424
*
25-
* All function calls go through `UTVMMain`, which reads from the current
26-
* `UTVMTask` and calls the appropriate function with the arguments from the
27-
* task.
25+
* All function calls go through the externally defined `UTVMInit`, which
26+
* performs device-specific setup, then calls `UTVMMain`. `UTVMMain` then
27+
* calls the function in `utvm_task` with the arguments from the task.
2828
*
2929
* Additionally included in this file are definitions for some of the most
3030
* common functions used in the C runtime API.

0 commit comments

Comments
 (0)