debuggers.hg
changeset 13669:16f7f5ac80ed
Replace mlock() calls with lock_pages().
Signed-off-by: Russell Blaine <russell.blaine@sun.com>
Signed-off-by: Russell Blaine <russell.blaine@sun.com>
author | kaf24@localhost.localdomain |
---|---|
date | Fri Jan 26 13:31:59 2007 +0000 (2007-01-26) |
parents | e0291e3ed603 |
children | fcaf34bc5e41 |
files | tools/libxc/xc_misc.c |
line diff
1.1 --- a/tools/libxc/xc_misc.c Fri Jan 26 13:27:01 2007 +0000 1.2 +++ b/tools/libxc/xc_misc.c Fri Jan 26 13:31:59 2007 +0000 1.3 @@ -110,15 +110,15 @@ int xc_hvm_set_pci_intx_level( 1.4 arg.intx = intx; 1.5 arg.level = level; 1.6 1.7 - if ( mlock(&arg, sizeof(arg)) != 0 ) 1.8 + if ( (rc = lock_pages(&arg, sizeof(arg))) != 0 ) 1.9 { 1.10 PERROR("Could not lock memory"); 1.11 - return -1; 1.12 + return rc; 1.13 } 1.14 1.15 rc = do_xen_hypercall(xc_handle, &hypercall); 1.16 1.17 - safe_munlock(&arg, sizeof(arg)); 1.18 + unlock_pages(&arg, sizeof(arg)); 1.19 1.20 return rc; 1.21 } 1.22 @@ -140,15 +140,15 @@ int xc_hvm_set_isa_irq_level( 1.23 arg.isa_irq = isa_irq; 1.24 arg.level = level; 1.25 1.26 - if ( mlock(&arg, sizeof(arg)) != 0 ) 1.27 + if ( (rc = lock_pages(&arg, sizeof(arg))) != 0 ) 1.28 { 1.29 PERROR("Could not lock memory"); 1.30 - return -1; 1.31 + return rc; 1.32 } 1.33 1.34 rc = do_xen_hypercall(xc_handle, &hypercall); 1.35 1.36 - safe_munlock(&arg, sizeof(arg)); 1.37 + unlock_pages(&arg, sizeof(arg)); 1.38 1.39 return rc; 1.40 } 1.41 @@ -168,15 +168,15 @@ int xc_hvm_set_pci_link_route( 1.42 arg.link = link; 1.43 arg.isa_irq = isa_irq; 1.44 1.45 - if ( mlock(&arg, sizeof(arg)) != 0 ) 1.46 + if ( (rc = lock_pages(&arg, sizeof(arg))) != 0 ) 1.47 { 1.48 PERROR("Could not lock memory"); 1.49 - return -1; 1.50 + return rc; 1.51 } 1.52 1.53 rc = do_xen_hypercall(xc_handle, &hypercall); 1.54 1.55 - safe_munlock(&arg, sizeof(arg)); 1.56 + unlock_pages(&arg, sizeof(arg)); 1.57 1.58 return rc; 1.59 }