sparrow-kata-full/apps/rust/libkata/arch/riscv32/crt0.S
Sam Leffler cc8e4c65e6 apps/rust: remove debug code that passes a0-a3 to main
Change-Id: I9f86d15e2415d04611bc0533003ed3c6c258442b
GitOrigin-RevId: 3f4481bbc5ce1891caed283304fbba568a872224
2022-10-06 19:04:40 +00:00

72 lines
1.5 KiB
ArmAsm

/*
* Copyright 2022 Google LLC
*
* 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
*
* https://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.
*/
.section .text._start
.align 2
.globl _start
.type _start, @function
_start:
.option push
.option norelax
la gp, __global_pointer$
la x4, _tls
/* Setup __sel4_ipc_buffer */
lui t1, 0
add t1, t1, tp
sw a0, 0(t1)
/* Setup SDKRuntime RPC framework */
/* seL4_CPtr to SDKRuntime Endpoint */
la t1, KATA_SDK_ENDPOINT
sw a1, 0(t1)
/* seL4_CPtr to KATA_SDK_PARAMS Frame object */
la t1, KATA_SDK_FRAME
sw a2, 0(t1)
/* virtual address of KATA_SDK_PARAMS */
la t1, KATA_SDK_PARAMS
sw a3, 0(t1)
.option pop
j main
.section .bss
.align 12
.globl _tls
.type _tls, tls_object
_tls:
.ds.b 4096
.align 2
.global KATA_SDK_ENDPOINT
KATA_SDK_ENDPOINT:
.ds.b 4
.align 2
.global KATA_SDK_FRAME
KATA_SDK_FRAME:
.ds.b 4
.align 2
.global KATA_SDK_PARAMS
KATA_SDK_PARAMS:
.ds.b 4