Simplify reschedule points, mail works now!
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m55s

This commit is contained in:
2026-02-19 18:25:47 +01:00
parent a1730dfdc2
commit 4472ad5bb3
13 changed files with 45 additions and 143 deletions

View File

@@ -37,7 +37,6 @@ void proc_cleanup_resource_mail (struct proc_resource* resource, struct reschedu
}
spin_unlock (&mail->send_sq.lock);
spin_unlock (&mail->resource->lock);
}
@@ -82,9 +81,12 @@ void proc_mail_send (struct proc* proc, struct proc_mail* mail, struct reschedul
spin_unlock (&mail->recv_sq.lock);
/* mail is empty and nobody is waiting */
mail->pending_mesg = malloc (data_size);
memcpy (mail->pending_mesg, data, data_size);
mail->pending_mesg_size = data_size;
void* mesg = malloc (data_size);
if (mesg != NULL) {
mail->pending_mesg = mesg;
memcpy (mail->pending_mesg, data, data_size);
mail->pending_mesg_size = data_size;
}
spin_unlock (&mail->resource->lock);
}
@@ -100,7 +102,7 @@ void proc_mail_receive (struct proc* proc, struct proc_mail* mail, struct resche
/* consume mesg if available */
if (mail->pending_mesg != NULL) {
memcpy (recv_buffer, mail->pending_mesg, recv_size);
memcpy (recv_buffer, mail->pending_mesg, min (recv_size, mail->pending_mesg_size));
free (mail->pending_mesg);
mail->pending_mesg = NULL;
mail->pending_mesg_size = 0;