From cb5e3ca248435f19fce0254987ba894a25611974 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 15 Feb 2023 23:40:54 +0100 Subject: Document spl levels of locks taken during interrupts --- device/ds_routines.c | 3 ++- device/io_req.h | 2 ++ device/tty.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'device') diff --git a/device/ds_routines.c b/device/ds_routines.c index 07ab7b30..94e61592 100644 --- a/device/ds_routines.c +++ b/device/ds_routines.c @@ -1507,8 +1507,9 @@ ds_no_senders(mach_no_senders_notification_t *notification) notification->not_count); } +/* Shall be taken at splio only */ +def_simple_lock_data(static, io_done_list_lock) /* Lock for... */ queue_head_t io_done_list; -def_simple_lock_data(static, io_done_list_lock) #define splio splsched /* XXX must block ALL io devices */ diff --git a/device/io_req.h b/device/io_req.h index b80b3dde..e66e0800 100644 --- a/device/io_req.h +++ b/device/io_req.h @@ -95,6 +95,8 @@ struct io_req { * locking is needed in this sequence. Unfortunately, a synchronous wait * for a buffer requires a lock to avoid problems if the wait and interrupt * happen simultaneously on different processors. + * + * Shall be taken at splio only */ #define ior_lock(ior) simple_lock(&(ior)->io_req_lock) diff --git a/device/tty.h b/device/tty.h index 0bdb2db9..b0f99cf5 100644 --- a/device/tty.h +++ b/device/tty.h @@ -43,7 +43,7 @@ #include struct tty { - decl_simple_lock_data(,t_lock) + decl_simple_lock_data(,t_lock) /* Shall be taken at spltty only */ struct cirbuf t_inq; /* input buffer */ struct cirbuf t_outq; /* output buffer */ char * t_addr; /* device pointer */ -- cgit v1.2.3