Send_msg now reqires size

This commit is contained in:
pjht 2019-05-04 10:58:52 -05:00
parent c679ae1bde
commit 35bba425ac
5 changed files with 6 additions and 6 deletions

View File

@ -182,7 +182,7 @@ void isr_handler(registers_t r) {
} else if (r.eax==6) {
r.ebx=tasking_get_msg((uint32_t*)r.ebx);
} else if (r.eax==7) {
tasking_send_msg(r.ebx,(void*)r.ecx);
tasking_send_msg(r.ebx,(void*)r.ecx,r.edx);
}
break;
}

View File

@ -78,7 +78,7 @@ Task* tasking_createTask(void* eip) {
return createTaskKmode(eip,0);
}
void tasking_send_msg(uint32_t pid,void* msg) {
void tasking_send_msg(uint32_t pid,void* msg,uint32_t size) {
for (Task* task=headTask;task!=NULL;task=task->next) {
if (task->pid==pid) {
uint32_t cr3;

View File

@ -7,6 +7,6 @@ void tasking_init();
void tasking_yield();
Task* tasking_createTask(void* eip);
char isPrivleged(uint32_t pid);
void tasking_send_msg(uint32_t pid,void* msg);
void tasking_send_msg(uint32_t pid,void* msg,uint32_t size);
void* tasking_get_msg(uint32_t* sender);
#endif

View File

@ -23,9 +23,9 @@ void* get_msg(uint32_t* sender) {
return msg;
}
void send_msg(uint32_t pid,void* msg) {
void send_msg(uint32_t pid,void* msg,uint32_t size) {
asm volatile(" \
mov $7, %%eax; \
int $80; \
"::"b"(pid),"c"(msg));
"::"b"(pid),"c"(msg),"d"(size));
}

View File

@ -6,7 +6,7 @@
void yield();
void createTask(void* task);
char isPrivleged(uint32_t pid);
void send_msg(uint32_t pid,void* msg);
void send_msg(uint32_t pid,void* msg,uint32_t size);
void* get_msg(uint32_t* sender);
#endif