Skip to content

Commit

Permalink
Remove comment
Browse files Browse the repository at this point in the history
  • Loading branch information
0152la committed Feb 11, 2022
1 parent 61b9d8a commit 7e16316
Showing 1 changed file with 36 additions and 9 deletions.
45 changes: 36 additions & 9 deletions src/manager.S
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,47 @@ add_compartment:
cmp x4, #MAX_COMP_COUNT
b.gt abort

// Update switcher DDC
//adr x2, switcher_caps
//ldr c0, [x2]
//gclen x1, c0
//add x1, x1, #32
//scbndse c0, c0, x1
//str c0, [x2]

ret

/**
* Function to delete an existing compartment data
*
* @param c0 ID of compartment to be deleted
* @param x0 Function of compartment to be deleted
*/
.type del_compartment, "function"
del_compartment:
// Find capabilities (DDC/PCC) of given compartment
ldr x1, comps_addr
add x1, x1, #COMP_OFFSET_PCC
mov x2, #0
ldr x4, comps_cnt

pcc_check_start:
ldr c3, [x1] // get current stored PCC to check
gcvalue x3, c3
cmp x3, x0 // check value of current PCC against given function
b.eq pcc_found
add x2, x2, #1
cmp x2, x4 // compartment bounds check
b.eq pcc_not_found
add x1, x1, #COMP_SIZE // go check next PCC
b pcc_check_start

pcc_not_found:
b abort

pcc_found:
// We found the compartment PCC, at address `$x1`
//sub x1, x1, #16 // get DDC
// Unmap memory region allocated







// Zero out the capabilities, and shift everything forward

ret

0 comments on commit 7e16316

Please sign in to comment.