From: Ben Gras Date: Thu, 29 Apr 2010 08:50:52 +0000 (+0000) Subject: kernel: more diagnostics for privctl ENOMEM conditions. X-Git-Tag: v3.1.7~99 X-Git-Url: http://zhaoyanbai.com/repos/%22../static/icons/ChangeLog.html?a=commitdiff_plain;h=4e837dcfb3b0f84ea50feb4fdf6d144a848de242;p=minix.git kernel: more diagnostics for privctl ENOMEM conditions. --- diff --git a/kernel/system/do_privctl.c b/kernel/system/do_privctl.c index 21544862d..ce4ca6c8d 100644 --- a/kernel/system/do_privctl.c +++ b/kernel/system/do_privctl.c @@ -233,8 +233,11 @@ PUBLIC int do_privctl(struct proc * caller, message * m_ptr) KERNEL, (vir_bytes) &io_range, sizeof(io_range)); priv(rp)->s_flags |= CHECK_IO_PORT; /* Check I/O accesses */ i= priv(rp)->s_nr_io_range; - if (i >= NR_IO_RANGE) + if (i >= NR_IO_RANGE) { + printf("do_privctl: %d already has %d i/o ranges.\n", + rp->p_endpoint, i); return ENOMEM; + } priv(rp)->s_io_tab[i].ior_base= io_range.ior_base; priv(rp)->s_io_tab[i].ior_limit= io_range.ior_limit; @@ -256,8 +259,11 @@ PUBLIC int do_privctl(struct proc * caller, message * m_ptr) return r; priv(rp)->s_flags |= CHECK_MEM; /* Check memory mappings */ i= priv(rp)->s_nr_mem_range; - if (i >= NR_MEM_RANGE) + if (i >= NR_MEM_RANGE) { + printf("do_privctl: %d already has %d mem ranges.\n", + rp->p_endpoint, i); return ENOMEM; + } priv(rp)->s_mem_tab[i].mr_base= mem_range.mr_base; priv(rp)->s_mem_tab[i].mr_limit= mem_range.mr_limit; @@ -278,8 +284,11 @@ PUBLIC int do_privctl(struct proc * caller, message * m_ptr) priv(rp)->s_flags |= CHECK_IRQ; /* Check IRQs */ i= priv(rp)->s_nr_irq; - if (i >= NR_IRQ) + if (i >= NR_IRQ) { + printf("do_privctl: %d already has %d irq's.\n", + rp->p_endpoint, i); return ENOMEM; + } priv(rp)->s_irq_tab[i]= irq; priv(rp)->s_nr_irq++;