1 /*****************************************************************************
2 * memcpy.c : classic memcpy module
3 *****************************************************************************
4 * Copyright (C) 2001 VideoLAN
5 * $Id: memcpy.c,v 1.5 2002/02/15 13:32:53 sam Exp $
7 * Authors: Samuel Hocevar <sam@zoy.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
30 #include <videolan/vlc.h>
38 #if defined( MODULE_NAME_IS_memcpy3dn )
40 # include "fastmemcpy.h"
41 #elif defined( MODULE_NAME_IS_memcpymmx )
43 # include "fastmemcpy.h"
44 #elif defined( MODULE_NAME_IS_memcpymmxext )
46 # include "fastmemcpy.h"
49 /*****************************************************************************
50 * Local and extern prototypes.
51 *****************************************************************************/
52 static void memcpy_getfunctions( function_list_t * p_function_list );
53 #ifndef MODULE_NAME_IS_memcpy
54 void * _M( fast_memcpy ) ( void * to, const void * from, size_t len );
57 /*****************************************************************************
58 * Build configuration tree.
59 *****************************************************************************/
64 #ifdef MODULE_NAME_IS_memcpy
65 SET_DESCRIPTION( "libc memcpy module" )
66 ADD_CAPABILITY( MEMCPY, 50 )
68 ADD_SHORTCUT( "libc" )
69 ADD_SHORTCUT( "memcpy" )
70 #elif defined( MODULE_NAME_IS_memcpy3dn )
71 SET_DESCRIPTION( "3D Now! memcpy module" )
72 ADD_CAPABILITY( MEMCPY, 100 )
73 ADD_REQUIREMENT( 3DNOW )
75 ADD_SHORTCUT( "3dnow" )
76 ADD_SHORTCUT( "memcpy3dn" )
77 ADD_SHORTCUT( "memcpy3dnow" )
78 #elif defined( MODULE_NAME_IS_memcpymmx )
79 SET_DESCRIPTION( "MMX memcpy module" )
80 ADD_CAPABILITY( MEMCPY, 100 )
81 ADD_REQUIREMENT( MMX )
83 ADD_SHORTCUT( "memcpymmx" )
84 #elif defined( MODULE_NAME_IS_memcpymmxext )
85 SET_DESCRIPTION( "MMX EXT memcpy module" )
86 ADD_CAPABILITY( MEMCPY, 200 )
87 ADD_REQUIREMENT( MMXEXT )
88 ADD_SHORTCUT( "mmxext" )
89 ADD_SHORTCUT( "memcpymmxext" )
94 memcpy_getfunctions( &p_module->p_functions->memcpy );
97 MODULE_DEACTIVATE_START
98 MODULE_DEACTIVATE_STOP
100 /* Following functions are local */
102 /*****************************************************************************
103 * Functions exported as capabilities. They are declared as static so that
104 * we don't pollute the namespace too much.
105 *****************************************************************************/
106 static void memcpy_getfunctions( function_list_t * p_function_list )
108 #ifdef MODULE_NAME_IS_memcpy
109 p_function_list->functions.memcpy.pf_memcpy = memcpy;
111 p_function_list->functions.memcpy.pf_memcpy = _M( fast_memcpy );