You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/04/17 13:08:25 UTC

[GitHub] [incubator-tvm] kparzysz-quic commented on a change in pull request #5353: [RUNTIME] FastRPC interface for Hexagon runtime

kparzysz-quic commented on a change in pull request #5353: [RUNTIME] FastRPC interface for Hexagon runtime
URL: https://github.com/apache/incubator-tvm/pull/5353#discussion_r410210028
 
 

 ##########
 File path: src/runtime/hexagon/target/fastrpc/src/tvm_remote_nd_imp.cc
 ##########
 @@ -0,0 +1,328 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+#include <assert.h>
+#include <dlfcn.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <vector>
+
+#define FARF_ERROR 1
+#include "AEEStdDef.h"
+#include "AEEStdErr.h"
+#include "HAP_farf.h"
+#include "HAP_mem.h"
+#include "HAP_perf.h"
+#include "qurt.h"
+#include "tvm_hvx.h"
+#include "tvm_remote_nd.h"
+
+struct msg_call {
+  uint32_t func_va;
+  uint32_t scalar_num;
+  uint32_t stack_num;
+  uint32_t data[];
+} __attribute__((packed));
+
+__attribute__((naked)) uint32_t launcher(volatile msg_call* mc,
+                                         uint64_t* pcc) {
+  __asm__(
+      "// This function is intentionally written to be readable,      \n"
+      "// rather than fast.                                           \n"
+      "// r0 = value of 'volatile msg_call *mc'                       \n"
+      "// r1 = address where to store the program cycle count         \n"
+      "{ memd(r29+#-16) = r21:20                                      \n"
 
 Review comment:
   This happens before any stack allocation (before the `allocframe` from the same packet), so the stack pointer hasn't been modified for the current function.  The `allocframe` will decrease the stack pointer by the requested 24 bytes, plus extra 8 for the FP/LR pair.  Between here and line 102, the stack pointer differs by 32.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services