Skip to content

Commit 972e6ad

Browse files
committed
Need turn to user_va to kernel_pa since mbox_call no reference address
1 parent f694dfd commit 972e6ad

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

lab6/kernel/src/mbox.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ unsigned int __attribute__((aligned(16))) mbox[8];
4646
*/
4747
int mbox_call(unsigned char ch, unsigned int *user_mbox)
4848
{
49-
// printf("[1]user_mbox[1]=%p\n",user_mbox[1]);
50-
// printf("[1]user_mbox[28]=%p\n",user_mbox[28]);
5149
unsigned int r = (((unsigned int)((unsigned long)VA2PA(user_mbox))&~0xF) | (ch&0xF));
5250
/* wait until we can write to the mailbox */
5351
do{asm volatile("nop");}while(*MBOX_STATUS & MBOX_FULL);

lab6/kernel/src/thread.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ void exec(const char *program_name, const char **argv) {
201201
// printf("identity_page=%p\n",identity_page);
202202
update_page_table(cur, identity_page , identity_page, PD_USER_RW);
203203
}
204+
204205
uint64_t virtual_addr = USER_STACK_BASE;
205206
uint64_t physical_addr = VA2PA(cur->user_stack_base);
206207
update_page_table(cur, virtual_addr, physical_addr, PD_USER_RW );

0 commit comments

Comments
 (0)