From: "Jacob Gorm Hansen" Subject: [PATCH] add function for unbinding all evtchns to min-os Date: Thu, 18 May 2006 16:24:08 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_99298_10775944.1147962248537" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org ------=_Part_99298_10775944.1147962248537 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline When using mini-os for hosting a boot-loader, it needs the ability to shut down any bound ports before calling the booted OS. This patch adds a function that the bootloader can call to do that. Jacob ------=_Part_99298_10775944.1147962248537 Content-Type: application/octet-stream; name=miniosunbindall Content-Transfer-Encoding: 7bit X-Attachment-Id: f_end71rf7 Content-Disposition: attachment; filename="miniosunbindall" Signed-off-by: Jacob Gorm Hansen diff -r 6344bbd4433b extras/mini-os/events.c --- a/extras/mini-os/events.c Wed May 17 18:00:23 2006 +0200 +++ b/extras/mini-os/events.c Thu May 18 16:20:35 2006 +0200 @@ -26,6 +26,8 @@ static ev_action_t ev_actions[NR_EVS]; static ev_action_t ev_actions[NR_EVS]; void default_handler(int port, struct pt_regs *regs); +u32 bound_ports[32]; +int num_bound_ports=0; /* * Demux events to different handlers. @@ -96,6 +98,7 @@ int bind_virq( u32 virq, void (*handler) printk("Failed to bind virtual IRQ %d\n", virq); goto out; } + bound_ports[num_bound_ports++] = op.u.bind_virq.port; bind_evtchn(op.u.bind_virq.port, handler); out: return ret; @@ -106,6 +109,30 @@ void unbind_virq( u32 port ) unbind_evtchn(port); } +void unbind_all_ports(void) +{ + int i; + for(i=0; i