149999Salc/*- 249999Salc * Copyright (c) 1999 Peter Jeremy 349999Salc * All rights reserved. 449999Salc * 549999Salc * Redistribution and use in source and binary forms, with or without 649999Salc * modification, are permitted provided that the following conditions 749999Salc * are met: 849999Salc * 1. Redistributions of source code must retain the above copyright 949999Salc * notice, this list of conditions and the following disclaimer. 1049999Salc * 2. Redistributions in binary form must reproduce the above copyright 1149999Salc * notice, this list of conditions and the following disclaimer in the 1249999Salc * documentation and/or other materials provided with the distribution. 1349999Salc * 1449999Salc * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1549999Salc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1649999Salc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1749999Salc * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1849999Salc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1949999Salc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2049999Salc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2149999Salc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2249999Salc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2349999Salc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2449999Salc * SUCH DAMAGE. 2549999Salc */ 2649999Salc 27118031Sobrien#include <sys/cdefs.h> 28118031Sobrien__FBSDID("$FreeBSD$"); 29118031Sobrien 3049999Salc/* This file creates publically callable functions to perform various 3149999Salc * simple arithmetic on memory which is atomic in the presence of 3249999Salc * interrupts and multiple processors. 3349999Salc */ 3449999Salc#include <sys/types.h> 3549999Salc 3649999Salc/* Firstly make atomic.h generate prototypes as it will for kernel modules */ 3749999Salc#define KLD_MODULE 3849999Salc#include <machine/atomic.h> 3949999Salc#undef _MACHINE_ATOMIC_H_ /* forget we included it */ 4049999Salc#undef KLD_MODULE 4149999Salc#undef ATOMIC_ASM 4249999Salc 4349999Salc/* Make atomic.h generate public functions */ 4465514Sphk#define WANT_FUNCTIONS 4549999Salc#define static 4649999Salc#undef __inline 4749999Salc#define __inline 4849999Salc 4949999Salc#include <machine/atomic.h> 50