xref: /netbsd-src/external/gpl3/gcc.old/dist/libgomp/libgomp-plugin.c (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
1*8feb0f0bSmrg /* Copyright (C) 2014-2020 Free Software Foundation, Inc.
21debfc3dSmrg 
31debfc3dSmrg    Contributed by Mentor Embedded.
41debfc3dSmrg 
51debfc3dSmrg    This file is part of the GNU Offloading and Multi Processing Library
61debfc3dSmrg    (libgomp).
71debfc3dSmrg 
81debfc3dSmrg    Libgomp is free software; you can redistribute it and/or modify it
91debfc3dSmrg    under the terms of the GNU General Public License as published by
101debfc3dSmrg    the Free Software Foundation; either version 3, or (at your option)
111debfc3dSmrg    any later version.
121debfc3dSmrg 
131debfc3dSmrg    Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
141debfc3dSmrg    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
151debfc3dSmrg    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
161debfc3dSmrg    more details.
171debfc3dSmrg 
181debfc3dSmrg    Under Section 7 of GPL version 3, you are granted additional
191debfc3dSmrg    permissions described in the GCC Runtime Library Exception, version
201debfc3dSmrg    3.1, as published by the Free Software Foundation.
211debfc3dSmrg 
221debfc3dSmrg    You should have received a copy of the GNU General Public License and
231debfc3dSmrg    a copy of the GCC Runtime Library Exception along with this program;
241debfc3dSmrg    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
251debfc3dSmrg    <http://www.gnu.org/licenses/>.  */
261debfc3dSmrg 
271debfc3dSmrg /* Exported (non-hidden) functions exposing libgomp interface for plugins.  */
281debfc3dSmrg 
291debfc3dSmrg #include <stdlib.h>
301debfc3dSmrg 
311debfc3dSmrg #include "libgomp.h"
321debfc3dSmrg #include "libgomp-plugin.h"
331debfc3dSmrg 
341debfc3dSmrg void *
GOMP_PLUGIN_malloc(size_t size)351debfc3dSmrg GOMP_PLUGIN_malloc (size_t size)
361debfc3dSmrg {
371debfc3dSmrg   return gomp_malloc (size);
381debfc3dSmrg }
391debfc3dSmrg 
401debfc3dSmrg void *
GOMP_PLUGIN_malloc_cleared(size_t size)411debfc3dSmrg GOMP_PLUGIN_malloc_cleared (size_t size)
421debfc3dSmrg {
431debfc3dSmrg   return gomp_malloc_cleared (size);
441debfc3dSmrg }
451debfc3dSmrg 
461debfc3dSmrg void *
GOMP_PLUGIN_realloc(void * ptr,size_t size)471debfc3dSmrg GOMP_PLUGIN_realloc (void *ptr, size_t size)
481debfc3dSmrg {
491debfc3dSmrg   return gomp_realloc (ptr, size);
501debfc3dSmrg }
511debfc3dSmrg 
521debfc3dSmrg void
GOMP_PLUGIN_debug(int kind,const char * msg,...)531debfc3dSmrg GOMP_PLUGIN_debug (int kind, const char *msg, ...)
541debfc3dSmrg {
551debfc3dSmrg   va_list ap;
561debfc3dSmrg 
571debfc3dSmrg   va_start (ap, msg);
581debfc3dSmrg   gomp_vdebug (kind, msg, ap);
591debfc3dSmrg   va_end (ap);
601debfc3dSmrg }
611debfc3dSmrg 
621debfc3dSmrg void
GOMP_PLUGIN_error(const char * msg,...)631debfc3dSmrg GOMP_PLUGIN_error (const char *msg, ...)
641debfc3dSmrg {
651debfc3dSmrg   va_list ap;
661debfc3dSmrg 
671debfc3dSmrg   va_start (ap, msg);
681debfc3dSmrg   gomp_verror (msg, ap);
691debfc3dSmrg   va_end (ap);
701debfc3dSmrg }
711debfc3dSmrg 
721debfc3dSmrg void
GOMP_PLUGIN_fatal(const char * msg,...)731debfc3dSmrg GOMP_PLUGIN_fatal (const char *msg, ...)
741debfc3dSmrg {
751debfc3dSmrg   va_list ap;
761debfc3dSmrg 
771debfc3dSmrg   va_start (ap, msg);
781debfc3dSmrg   gomp_vfatal (msg, ap);
791debfc3dSmrg   va_end (ap);
801debfc3dSmrg }
81