Skip to content

Commit 23c0098

Browse files
miguelafsilva5josecm
authored andcommitted
ref(as_init): Remove id from as_init prototype
Signed-off-by: Miguel Silva <[email protected]>
1 parent 01f0139 commit 23c0098

File tree

6 files changed

+10
-13
lines changed

6 files changed

+10
-13
lines changed

src/core/mmu/inc/mem_prot/mem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct addr_space {
2121

2222
typedef pte_t mem_flags_t;
2323

24-
void as_init(struct addr_space* as, enum AS_TYPE type, asid_t id, pte_t* root_pt, colormap_t colors);
24+
void as_init(struct addr_space* as, enum AS_TYPE type, pte_t* root_pt, colormap_t colors);
2525
vaddr_t mem_alloc_vpage(struct addr_space* as, enum AS_SEC section, vaddr_t at, size_t n);
2626

2727
#endif /* __MEM_PROT_H__ */

src/core/mmu/mem.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ void mem_color_hypervisor(const paddr_t load_addr, struct mem_region* root_regio
764764
* the new CPU region is created, cleaned, prepared and finally mapped.
765765
*/
766766
cpu_new = copy_space((void*)BAO_CPU_BASE, sizeof(struct cpu), &p_cpu);
767-
as_init(&cpu_new->as, AS_HYP_CPY, HYP_ASID, NULL, colors);
767+
as_init(&cpu_new->as, AS_HYP_CPY, NULL, colors);
768768
va = mem_alloc_vpage(&cpu_new->as, SEC_HYP_PRIVATE, (vaddr_t)BAO_CPU_BASE,
769769
NUM_PAGES(sizeof(struct cpu)));
770770
if (va != (vaddr_t)BAO_CPU_BASE) {
@@ -860,7 +860,7 @@ void mem_color_hypervisor(const paddr_t load_addr, struct mem_region* root_regio
860860
while (shared_pte != 0) { }
861861
}
862862

863-
as_init(&cpu()->as, AS_HYP, HYP_ASID, (void*)v_root_pt_addr, colors);
863+
as_init(&cpu()->as, AS_HYP, (void*)v_root_pt_addr, colors);
864864

865865
/*
866866
* Clear the old region that have been copied.
@@ -916,10 +916,8 @@ static unsigned long as_id_alloc(struct addr_space* as)
916916
return ret;
917917
}
918918

919-
void as_init(struct addr_space* as, enum AS_TYPE type, asid_t id, pte_t* root_pt, colormap_t colors)
919+
void as_init(struct addr_space* as, enum AS_TYPE type, pte_t* root_pt, colormap_t colors)
920920
{
921-
UNUSED_ARG(id);
922-
923921
as->type = type;
924922
as->pt.dscr = type == AS_HYP || type == AS_HYP_CPY ? hyp_pt_dscr : vm_pt_dscr;
925923
as->id = as_id_alloc(as);
@@ -940,7 +938,7 @@ void as_init(struct addr_space* as, enum AS_TYPE type, asid_t id, pte_t* root_pt
940938
void mem_prot_init(void)
941939
{
942940
pte_t* root_pt = (pte_t*)ALIGN(((vaddr_t)cpu()) + sizeof(struct cpu), PAGE_SIZE);
943-
as_init(&cpu()->as, AS_HYP, HYP_ASID, root_pt, config.hyp.colors);
941+
as_init(&cpu()->as, AS_HYP, root_pt, config.hyp.colors);
944942
}
945943

946944
vaddr_t mem_alloc_map(struct addr_space* as, enum AS_SEC section, struct ppages* page, vaddr_t at,

src/core/mmu/vm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

1111
void vm_mem_prot_init(struct vm* vm, const struct vm_config* vm_config)
1212
{
13-
as_init(&vm->as, AS_VM, vm->id, NULL, vm_config->colors);
13+
as_init(&vm->as, AS_VM, NULL, vm_config->colors);
1414
}

src/core/mpu/inc/mem_prot/mem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct addr_space {
3838
spinlock_t lock;
3939
};
4040

41-
void as_init(struct addr_space* as, enum AS_TYPE type, asid_t id, colormap_t colors);
41+
void as_init(struct addr_space* as, enum AS_TYPE type, colormap_t colors);
4242

4343
static inline bool mem_regions_overlap(struct mp_region* reg1, struct mp_region* reg2)
4444
{

src/core/mpu/mem.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static void mem_init_boot_regions(void)
203203
void mem_prot_init()
204204
{
205205
mpu_init();
206-
as_init(&cpu()->as, AS_HYP, HYP_ASID, 0);
206+
as_init(&cpu()->as, AS_HYP, 0);
207207
mem_init_boot_regions();
208208
mpu_enable();
209209
}
@@ -239,10 +239,9 @@ static unsigned long as_id_alloc(struct addr_space* as)
239239
return ret;
240240
}
241241

242-
void as_init(struct addr_space* as, enum AS_TYPE type, asid_t id, colormap_t colors)
242+
void as_init(struct addr_space* as, enum AS_TYPE type, colormap_t colors)
243243
{
244244
UNUSED_ARG(colors);
245-
UNUSED_ARG(id);
246245

247246
as->type = type;
248247
as->colors = 0;

src/core/mpu/vm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ void vm_mem_prot_init(struct vm* vm, const struct vm_config* config)
99
{
1010
UNUSED_ARG(config);
1111

12-
as_init(&vm->as, AS_VM, vm->id, 0);
12+
as_init(&vm->as, AS_VM, 0);
1313
}

0 commit comments

Comments
 (0)