1 /*
2  * Copyright 2018 The Hafnium Authors.
3  *
4  * Use of this source code is governed by a BSD-style
5  * license that can be found in the LICENSE file or at
6  * https://opensource.org/licenses/BSD-3-Clause.
7  */
8 
9 #include "hf/arch/cpu.h"
10 
11 #include "hf/cpu.h"
12 #include "hf/ffa.h"
13 #include "hf/plat/interrupts.h"
14 
arch_irq_disable(void)15 void arch_irq_disable(void)
16 {
17 	/* TODO */
18 }
19 
arch_irq_enable(void)20 void arch_irq_enable(void)
21 {
22 	/* TODO */
23 }
24 
arch_regs_reset(struct vcpu * vcpu)25 void arch_regs_reset(struct vcpu *vcpu)
26 {
27 	/* TODO */
28 	(void)vcpu;
29 }
30 
arch_regs_set_pc_arg(struct arch_regs * r,ipaddr_t pc,uintreg_t arg)31 void arch_regs_set_pc_arg(struct arch_regs *r, ipaddr_t pc, uintreg_t arg)
32 {
33 	(void)pc;
34 	r->arg[0] = arg;
35 }
36 
arch_regs_reg_num_valid(const unsigned int gp_reg_num)37 bool arch_regs_reg_num_valid(const unsigned int gp_reg_num)
38 {
39 	(void)gp_reg_num;
40 	return false;
41 }
42 
arch_regs_set_gp_reg(struct arch_regs * r,uintreg_t value,const unsigned int gp_reg_num)43 void arch_regs_set_gp_reg(struct arch_regs *r, uintreg_t value,
44 			  const unsigned int gp_reg_num)
45 {
46 	(void)r;
47 	(void)value;
48 	(void)gp_reg_num;
49 }
50 
arch_regs_set_retval(struct arch_regs * r,struct ffa_value v)51 void arch_regs_set_retval(struct arch_regs *r, struct ffa_value v)
52 {
53 	r->arg[0] = v.func;
54 	r->arg[1] = v.arg1;
55 	r->arg[2] = v.arg2;
56 	r->arg[3] = v.arg3;
57 	r->arg[4] = v.arg4;
58 	r->arg[5] = v.arg5;
59 	r->arg[6] = v.arg6;
60 	r->arg[7] = v.arg7;
61 }
62 
arch_cpu_init(struct cpu * c,ipaddr_t entry_point)63 void arch_cpu_init(struct cpu *c, ipaddr_t entry_point)
64 {
65 	(void)c;
66 	(void)entry_point;
67 
68 	plat_interrupts_controller_hw_init(c);
69 }
70