i386_clr_watch.c (66174) | i386_clr_watch.c (92986) |
---|---|
1/* 2 * Copyright 2000 Brian S. Dean <bsd@bsdhome.com> 3 * All Rights Reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 22 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 25 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 26 * DAMAGE. | 1/* 2 * Copyright 2000 Brian S. Dean <bsd@bsdhome.com> 3 * All Rights Reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 22 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 25 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 26 * DAMAGE. |
27 * | |
28 */ 29 | 27 */ 28 |
30/* 31 * $FreeBSD: head/lib/libc/i386/sys/i386_clr_watch.c 66174 2000-09-21 17:07:27Z bsd $ 32 */ | 29#include <sys/cdefs.h> 30__FBSDID("$FreeBSD: head/lib/libc/i386/sys/i386_clr_watch.c 92986 2002-03-22 21:53:29Z obrien $"); |
33 | 31 |
34 | |
35#include <machine/reg.h> 36#include <machine/sysarch.h> 37 | 32#include <machine/reg.h> 33#include <machine/sysarch.h> 34 |
38 | |
39int 40i386_clr_watch(int watchnum, struct dbreg * d) 41{ 42 43 if (watchnum < 0 || watchnum >= 4) 44 return -1; 45 46 d->dr7 = d->dr7 & ~((0x3 << (watchnum*2)) | (0x0f << (watchnum*4+16))); 47 DBREG_DRX(d,watchnum) = 0; 48 49 return 0; 50} | 35int 36i386_clr_watch(int watchnum, struct dbreg * d) 37{ 38 39 if (watchnum < 0 || watchnum >= 4) 40 return -1; 41 42 d->dr7 = d->dr7 & ~((0x3 << (watchnum*2)) | (0x0f << (watchnum*4+16))); 43 DBREG_DRX(d,watchnum) = 0; 44 45 return 0; 46} |