188794Sjake/*- 288794Sjake * Copyright (c) 2001 Jake Burkholder. 388794Sjake * All rights reserved. 488794Sjake * 588794Sjake * Redistribution and use in source and binary forms, with or without 688794Sjake * modification, are permitted provided that the following conditions 788794Sjake * are met: 888794Sjake * 1. Redistributions of source code must retain the above copyright 988794Sjake * notice, this list of conditions and the following disclaimer. 1088794Sjake * 2. Redistributions in binary form must reproduce the above copyright 1188794Sjake * notice, this list of conditions and the following disclaimer in the 1288794Sjake * documentation and/or other materials provided with the distribution. 1388794Sjake * 1488794Sjake * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1588794Sjake * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1688794Sjake * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1788794Sjake * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1888794Sjake * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1988794Sjake * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2088794Sjake * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2188794Sjake * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2288794Sjake * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2388794Sjake * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2488794Sjake * SUCH DAMAGE. 2588794Sjake */ 2688794Sjake 2788794Sjake#include <sys/cdefs.h> 2888794Sjake__FBSDID("$FreeBSD: releng/10.3/lib/libc/sparc64/sys/__sparc_utrap_install.c 124296 2004-01-09 16:52:09Z nectar $"); 2988794Sjake 3088794Sjake#include <machine/utrap.h> 3188794Sjake#include <machine/sysarch.h> 3288794Sjake 3388794Sjakeint 3488794Sjake__sparc_utrap_install(utrap_entry_t type, utrap_handler_t new_precise, 3588794Sjake utrap_handler_t new_deferred, utrap_handler_t *old_precise, 3688794Sjake utrap_handler_t *old_deferred) 3788794Sjake{ 3888794Sjake struct sparc_utrap_install_args uia; 3988794Sjake struct sparc_utrap_args ua[1]; 4088794Sjake 4188794Sjake ua[0].type = type; 4288794Sjake ua[0].new_precise = new_precise; 4388794Sjake ua[0].new_deferred = new_deferred; 4488794Sjake ua[0].old_precise = old_precise; 4588794Sjake ua[0].old_deferred = old_deferred; 4688794Sjake uia.num = 1; 4788794Sjake uia.handlers = ua; 48124296Snectar return (sysarch(SPARC_UTRAP_INSTALL, &uia)); 4988794Sjake} 50