|
kusano |
7d535a |
/* portab_a.h -- advanced portability layer
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
This file is part of the LZO real-time data compression library.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
|
|
kusano |
7d535a |
All Rights Reserved.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
The LZO library is free software; you can redistribute it and/or
|
|
kusano |
7d535a |
modify it under the terms of the GNU General Public License as
|
|
kusano |
7d535a |
published by the Free Software Foundation; either version 2 of
|
|
kusano |
7d535a |
the License, or (at your option) any later version.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
The LZO library is distributed in the hope that it will be useful,
|
|
kusano |
7d535a |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
kusano |
7d535a |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
kusano |
7d535a |
GNU General Public License for more details.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
You should have received a copy of the GNU General Public License
|
|
kusano |
7d535a |
along with the LZO library; see the file COPYING.
|
|
kusano |
7d535a |
If not, write to the Free Software Foundation, Inc.,
|
|
kusano |
7d535a |
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Markus F.X.J. Oberhumer
|
|
kusano |
7d535a |
<markus@oberhumer.com></markus@oberhumer.com>
|
|
kusano |
7d535a |
http://www.oberhumer.com/opensource/lzo/
|
|
kusano |
7d535a |
*/
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/*************************************************************************
|
|
kusano |
7d535a |
// use the ACC library for the hard work
|
|
kusano |
7d535a |
**************************************************************************/
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#if defined(LZO_HAVE_CONFIG_H)
|
|
kusano |
7d535a |
# define ACC_CONFIG_NO_HEADER 1
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#define ACC_WANT_ACC_INCD_H 1
|
|
kusano |
7d535a |
#define ACC_WANT_ACC_INCE_H 1
|
|
kusano |
7d535a |
#if defined(__LZO_MMODEL_HUGE) || defined(WANT_LZO_UCLOCK) || defined(WANT_LZO_WILDARGV)
|
|
kusano |
7d535a |
# define ACC_WANT_ACC_INCI_H 1
|
|
kusano |
7d535a |
# define ACC_WANT_ACC_LIB_H 1
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
#include "src/miniacc.h"
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#if defined(WANT_LZO_MALLOC)
|
|
kusano |
7d535a |
# if defined(__LZO_MMODEL_HUGE)
|
|
kusano |
7d535a |
# define ACC_WANT_ACCLIB_HALLOC 1
|
|
kusano |
7d535a |
# else
|
|
kusano |
7d535a |
# define acc_halloc(a) (malloc(a))
|
|
kusano |
7d535a |
# define acc_hfree(a) (free(a))
|
|
kusano |
7d535a |
# endif
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
#if defined(WANT_LZO_FREAD)
|
|
kusano |
7d535a |
# if defined(__LZO_MMODEL_HUGE)
|
|
kusano |
7d535a |
# define ACC_WANT_ACCLIB_HFREAD 1
|
|
kusano |
7d535a |
# else
|
|
kusano |
7d535a |
# define acc_hfread(f,b,s) (fread(b,1,s,f))
|
|
kusano |
7d535a |
# define acc_hfwrite(f,b,s) (fwrite(b,1,s,f))
|
|
kusano |
7d535a |
# endif
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
#if defined(WANT_LZO_UCLOCK)
|
|
kusano |
7d535a |
# define ACC_WANT_ACCLIB_PCLOCK 1
|
|
kusano |
7d535a |
# if 0 && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
|
|
kusano |
7d535a |
# define __ACCLIB_PCLOCK_USE_RDTSC 1
|
|
kusano |
7d535a |
# define ACC_WANT_ACCLIB_RDTSC 1
|
|
kusano |
7d535a |
# endif
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
#if defined(WANT_LZO_WILDARGV)
|
|
kusano |
7d535a |
# define ACC_WANT_ACCLIB_WILDARGV 1
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
#if defined(__ACCLIB_PCLOCK_USE_PERFCTR)
|
|
kusano |
7d535a |
# include "src/fullacc.h"
|
|
kusano |
7d535a |
# define lzo_uclock_flush_cpu_cache(h,flags) acc_pclock_flush_cpu_cache(h,flags)
|
|
kusano |
7d535a |
#else
|
|
kusano |
7d535a |
# include "src/miniacc.h"
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#if (__ACCLIB_REQUIRE_HMEMCPY_CH) && !defined(__ACCLIB_HMEMCPY_CH_INCLUDED)
|
|
kusano |
7d535a |
# define ACC_WANT_ACCLIB_HMEMCPY 1
|
|
kusano |
7d535a |
# include "src/miniacc.h"
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/*************************************************************************
|
|
kusano |
7d535a |
// finally pull into the LZO namespace
|
|
kusano |
7d535a |
**************************************************************************/
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#undef lzo_malloc
|
|
kusano |
7d535a |
#undef lzo_free
|
|
kusano |
7d535a |
#undef lzo_fread
|
|
kusano |
7d535a |
#undef lzo_fwrite
|
|
kusano |
7d535a |
#if defined(WANT_LZO_MALLOC)
|
|
kusano |
7d535a |
# define lzo_malloc(a) acc_halloc(a)
|
|
kusano |
7d535a |
# define lzo_free(a) acc_hfree(a)
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
#if defined(WANT_LZO_FREAD)
|
|
kusano |
7d535a |
# define lzo_fread(f,b,s) acc_hfread(f,b,s)
|
|
kusano |
7d535a |
# define lzo_fwrite(f,b,s) acc_hfwrite(f,b,s)
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
#if defined(WANT_LZO_UCLOCK)
|
|
kusano |
7d535a |
# define lzo_uclock_handle_t acc_pclock_handle_t
|
|
kusano |
7d535a |
# define lzo_uclock_t acc_pclock_t
|
|
kusano |
7d535a |
# define lzo_uclock_open(a) acc_pclock_open_default(a)
|
|
kusano |
7d535a |
# define lzo_uclock_close(a) acc_pclock_close(a)
|
|
kusano |
7d535a |
# define lzo_uclock_read(a,b) acc_pclock_read(a,b)
|
|
kusano |
7d535a |
# define lzo_uclock_get_elapsed(a,b,c) acc_pclock_get_elapsed(a,b,c)
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
#if defined(WANT_LZO_WILDARGV)
|
|
kusano |
7d535a |
# define lzo_wildargv(a,b) acc_wildargv(a,b)
|
|
kusano |
7d535a |
#endif
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/*
|
|
kusano |
7d535a |
vi:ts=4:et
|
|
kusano |
7d535a |
*/
|
|
kusano |
7d535a |
|