Skip to content

Commit 787ac35

Browse files
ref(as): remove unused variable from addr_space struct
The cpu variable from struct addr_space was not being used throughout the code. Signed-off-by: Miguel Silva <[email protected]>
1 parent ac51124 commit 787ac35

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ struct mp_region {
2525
struct addr_space {
2626
asid_t id;
2727
enum AS_TYPE type;
28-
cpumap_t cpus;
2928
colormap_t colors;
3029
struct addr_space_arch arch;
3130
struct {
@@ -41,7 +40,7 @@ struct addr_space {
4140
spinlock_t lock;
4241
};
4342

44-
void as_init(struct addr_space* as, enum AS_TYPE type, asid_t id, cpumap_t cpus, colormap_t colors);
43+
void as_init(struct addr_space* as, enum AS_TYPE type, asid_t id, colormap_t colors);
4544

4645
static inline bool mem_regions_overlap(struct mp_region* reg1, struct mp_region* reg2)
4746
{

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, BIT_MASK(0, PLAT_CPU_NUM), 0);
206+
as_init(&cpu()->as, AS_HYP, HYP_ASID, 0);
207207
mem_init_boot_regions();
208208
mpu_enable();
209209
}
@@ -214,14 +214,13 @@ size_t mem_cpu_boot_alloc_size()
214214
return size;
215215
}
216216

217-
void as_init(struct addr_space* as, enum AS_TYPE type, asid_t id, cpumap_t cpus, colormap_t colors)
217+
void as_init(struct addr_space* as, enum AS_TYPE type, asid_t id, colormap_t colors)
218218
{
219219
UNUSED_ARG(colors);
220220

221221
as->type = type;
222222
as->colors = 0;
223223
as->id = id;
224-
as->cpus = cpus;
225224
as->lock = SPINLOCK_INITVAL;
226225
as_arch_init(as);
227226

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, vm->cpus, 0);
12+
as_init(&vm->as, AS_VM, vm->id, 0);
1313
}

src/core/vm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ static void vm_cpu_init(struct vm* vm)
2828
{
2929
spin_lock(&vm->lock);
3030
vm->cpus |= (1UL << cpu()->id);
31-
vm->as.cpus |= (1UL << cpu()->id);
3231
spin_unlock(&vm->lock);
3332
}
3433

0 commit comments

Comments
 (0)