5 * Doxygen can't cope with some of the more esoteric areas of C, so we
6 * make its life simpler.
10 #define __attribute__(x)
15 * Global compiler definitions.
17 * This file is implicitly included by every @c .c file in Etherboot.
18 * It defines global macros such as DBG().
20 * We arrange for each object to export the symbol @c obj_OBJECT
21 * (where @c OBJECT is the object name, e.g. @c rtl8139) as a global
22 * symbol, so that the linker can drag in selected object files from
23 * the library using <tt> -u obj_OBJECT </tt>.
27 /* Force visibility of all symbols to "hidden", i.e. inform gcc that
28 * all symbol references resolve strictly within our final binary.
29 * This avoids unnecessary PLT/GOT entries on x86_64.
31 * This is a stronger claim than specifying "-fvisibility=hidden",
32 * since it also affects symbols marked with "extern".
36 #pragma GCC visibility push(hidden)
45 /** Concatenate non-expanded arguments */
46 #define _C1( x, y ) x ## y
47 /** Concatenate expanded arguments */
48 #define _C2( x, y ) _C1 ( x, y )
50 /** Stringify non-expanded argument */
52 /** Stringify expanded argument */
53 #define _S2( x ) _S1 ( x )
56 * @defgroup symmacros Macros to provide or require explicit symbols
61 * Provide a symbol within this object file
63 * @v symbol Symbol name
66 #define PROVIDE_SYMBOL( symbol ) \
67 .section ".provided", "a", @nobits ; \
73 #define PROVIDE_SYMBOL( symbol ) \
75 __attribute__ (( section ( ".provided" ) ))
81 * @v symbol Symbol name
83 * Request a symbol to be included within the link. If the symbol
84 * cannot be found, the link will succeed anyway.
87 #define REQUEST_SYMBOL( symbol ) \
88 .equ __request_ ## symbol, symbol
90 #define REQUEST_SYMBOL( symbol ) \
91 __asm__ ( ".equ __request_" #symbol ", " #symbol )
97 * @v symbol Symbol name
99 * Require a symbol to be included within the link. If the symbol
100 * cannot be found, the link will fail.
102 * To use this macro within a file, you must also specify the file's
103 * "requiring symbol" using the REQUIRING_SYMBOL() or
104 * PROVIDE_REQUIRING_SYMBOL() macros.
107 #define REQUIRE_SYMBOL( symbol ) \
108 .reloc __requiring_symbol__, RELOC_TYPE_NONE, symbol
110 #define REQUIRE_SYMBOL( symbol ) \
111 __asm__ ( ".reloc __requiring_symbol__, " \
112 _S2 ( RELOC_TYPE_NONE ) ", " #symbol )
116 * Specify the file's requiring symbol
118 * @v symbol Symbol name
120 * REQUIRE_SYMBOL() works by defining a dummy relocation record
121 * against a nominated "requiring symbol". The presence of the
122 * nominated requiring symbol will drag in all of the symbols
123 * specified using REQUIRE_SYMBOL().
126 #define REQUIRING_SYMBOL( symbol ) \
127 .equ __requiring_symbol__, symbol
129 #define REQUIRING_SYMBOL( symbol ) \
130 __asm__ ( ".equ __requiring_symbol__, " #symbol )
134 * Provide a file's requiring symbol
136 * If the file contains no symbols that can be used as the requiring
137 * symbol, you can provide a dummy one-byte-long symbol using
138 * PROVIDE_REQUIRING_SYMBOL().
141 #define PROVIDE_REQUIRING_SYMBOL() \
142 .section ".tbl.requiring_symbols", "a", @progbits ; \
143 __requiring_symbol__: .byte 0 ; \
144 .size __requiring_symbol__, . - __requiring_symbol__ ; \
147 #define PROVIDE_REQUIRING_SYMBOL() \
148 __asm__ ( ".section \".tbl.requiring_symbols\", " \
149 " \"a\", @progbits\n" \
150 "__requiring_symbol__:\t.byte 0\n" \
151 ".size __requiring_symbol__, " \
152 " . - __requiring_symbol__\n" \
159 * @defgroup objmacros Macros to provide or require explicit objects
163 #define PREFIX_OBJECT( _prefix ) _C2 ( _prefix, OBJECT )
164 #define OBJECT_SYMBOL PREFIX_OBJECT ( obj_ )
166 /** Always provide the symbol for the current object (defined by -DOBJECT) */
167 PROVIDE_SYMBOL ( OBJECT_SYMBOL );
172 * @v object Object name
174 * Request an object to be included within the link. If the object
175 * cannot be found, the link will succeed anyway.
177 #define REQUEST_OBJECT( object ) REQUEST_SYMBOL ( obj_ ## object )
182 * @v object Object name
184 * Require an object to be included within the link. If the object
185 * cannot be found, the link will fail.
187 * To use this macro within a file, you must also specify the file's
188 * "requiring symbol" using the REQUIRING_SYMBOL() or
189 * PROVIDE_REQUIRING_SYMBOL() macros.
191 #define REQUIRE_OBJECT( object ) REQUIRE_SYMBOL ( obj_ ## object )
195 /** Select file identifier for errno.h (if used) */
196 #define ERRFILE PREFIX_OBJECT ( ERRFILE_ )
200 /** Declare a function as weak (use *before* the definition)
202 * Due to a bug in at least GCC 4.4.4 and earlier, weak symbols may be
203 * inlined if they have hidden visibility (see above for why hidden
204 * visibility is used). This results in the non-weak symbol never
205 * being used, so explicitly mark the function as noinline to prevent
208 #define __weak __attribute__ (( weak, noinline ))
212 /** @defgroup dbg Debugging infrastructure
218 * Print a debugging message.
220 * The debug level is set at build time by specifying the @c DEBUG=
221 * parameter on the @c make command line. For example, to enable
222 * debugging for the PCI bus functions (in pci.c) in a @c .dsk image
223 * for the @c rtl8139 card, you could use the command line
227 * make bin/rtl8139.dsk DEBUG=pci
231 * This will enable the debugging statements (DBG()) in pci.c. If
232 * debugging is not enabled, DBG() statements will be ignored.
234 * You can enable debugging in several objects simultaneously by
235 * separating them with commas, as in
239 * make bin/rtl8139.dsk DEBUG=pci,buffer,heap
243 * You can increase the debugging level for an object by specifying it
244 * with @c :N, where @c N is the level, as in
248 * make bin/rtl8139.dsk DEBUG=pci,buffer:2,heap
252 * which would enable debugging for the PCI, buffer-handling and
253 * heap-allocation code, with the buffer-handling code at level 2.
264 /** printf() for debugging */
265 extern void __attribute__ (( format ( printf, 1, 2 ) ))
266 dbg_printf ( const char *fmt, ... );
267 extern void dbg_autocolourise ( unsigned long id );
268 extern void dbg_decolourise ( void );
269 extern void dbg_hex_dump_da ( unsigned long dispaddr,
270 const void *data, unsigned long len );
271 extern void dbg_md5_da ( unsigned long dispaddr,
272 const void *data, unsigned long len );
273 extern void dbg_pause ( void );
274 extern void dbg_more ( void );
276 /* Allow for selective disabling of enabled debug levels */
279 #define DBGLVL ( DBGLVL_MAX & ~__debug_disable )
280 #define DBG_DISABLE( level ) do { \
281 __debug_disable |= (level); \
283 #define DBG_ENABLE( level ) do { \
284 __debug_disable &= ~(level); \
288 #define DBG_DISABLE( level ) do { } while ( 0 )
289 #define DBG_ENABLE( level ) do { } while ( 0 )
293 #define DBG_LOG ( DBGLVL & DBGLVL_LOG )
294 #define DBGLVL_EXTRA 2
295 #define DBG_EXTRA ( DBGLVL & DBGLVL_EXTRA )
296 #define DBGLVL_PROFILE 4
297 #define DBG_PROFILE ( DBGLVL & DBGLVL_PROFILE )
299 #define DBG_IO ( DBGLVL & DBGLVL_IO )
302 * Print debugging message if we are at a certain debug level
304 * @v level Debug level
305 * @v ... printf() argument list
307 #define DBG_IF( level, ... ) do { \
308 if ( DBG_ ## level ) { \
309 dbg_printf ( __VA_ARGS__ ); \
314 * Print a hex dump if we are at a certain debug level
316 * @v level Debug level
317 * @v dispaddr Display address
318 * @v data Data to print
319 * @v len Length of data
321 #define DBG_HDA_IF( level, dispaddr, data, len ) do { \
322 if ( DBG_ ## level ) { \
325 typeof ( dispaddr ) raw; \
329 dbg_hex_dump_da ( da.ul, data, len ); \
334 * Print a hex dump if we are at a certain debug level
336 * @v level Debug level
337 * @v data Data to print
338 * @v len Length of data
340 #define DBG_HD_IF( level, data, len ) do { \
341 const void *_data = data; \
342 DBG_HDA_IF ( level, _data, _data, len ); \
346 * Print an MD5 checksum if we are at a certain debug level
348 * @v level Debug level
349 * @v dispaddr Display address
350 * @v data Data to print
351 * @v len Length of data
353 #define DBG_MD5A_IF( level, dispaddr, data, len ) do { \
354 if ( DBG_ ## level ) { \
357 typeof ( dispaddr ) raw; \
361 dbg_md5_da ( da.ul, data, len ); \
366 * Print an MD5 checksum if we are at a certain debug level
368 * @v level Debug level
369 * @v data Data to print
370 * @v len Length of data
372 #define DBG_MD5_IF( level, data, len ) do { \
373 const void *_data = data; \
374 DBG_MD5A_IF ( level, _data, _data, len ); \
378 * Prompt for key press if we are at a certain debug level
380 * @v level Debug level
382 #define DBG_PAUSE_IF( level ) do { \
383 if ( DBG_ ## level ) { \
389 * Prompt for more output data if we are at a certain debug level
391 * @v level Debug level
393 #define DBG_MORE_IF( level ) do { \
394 if ( DBG_ ## level ) { \
400 * Select colour for debug messages if we are at a certain debug level
402 * @v level Debug level
403 * @v id Message stream ID
405 #define DBG_AC_IF( level, id ) do { \
406 if ( DBG_ ## level ) { \
412 dbg_stream.raw = id; \
413 dbg_autocolourise ( dbg_stream.ul ); \
418 * Revert colour for debug messages if we are at a certain debug level
420 * @v level Debug level
422 #define DBG_DC_IF( level ) do { \
423 if ( DBG_ ## level ) { \
428 /* Autocolourising versions of the DBGxxx_IF() macros */
430 #define DBGC_IF( level, id, ... ) do { \
431 DBG_AC_IF ( level, id ); \
432 DBG_IF ( level, __VA_ARGS__ ); \
433 DBG_DC_IF ( level ); \
436 #define DBGC_HDA_IF( level, id, ... ) do { \
437 DBG_AC_IF ( level, id ); \
438 DBG_HDA_IF ( level, __VA_ARGS__ ); \
439 DBG_DC_IF ( level ); \
442 #define DBGC_HD_IF( level, id, ... ) do { \
443 DBG_AC_IF ( level, id ); \
444 DBG_HD_IF ( level, __VA_ARGS__ ); \
445 DBG_DC_IF ( level ); \
448 #define DBGC_MD5A_IF( level, id, ... ) do { \
449 DBG_AC_IF ( level, id ); \
450 DBG_MD5A_IF ( level, __VA_ARGS__ ); \
451 DBG_DC_IF ( level ); \
454 #define DBGC_MD5_IF( level, id, ... ) do { \
455 DBG_AC_IF ( level, id ); \
456 DBG_MD5_IF ( level, __VA_ARGS__ ); \
457 DBG_DC_IF ( level ); \
460 #define DBGC_PAUSE_IF( level, id ) do { \
461 DBG_AC_IF ( level, id ); \
462 DBG_PAUSE_IF ( level ); \
463 DBG_DC_IF ( level ); \
466 #define DBGC_MORE_IF( level, id ) do { \
467 DBG_AC_IF ( level, id ); \
468 DBG_MORE_IF ( level ); \
469 DBG_DC_IF ( level ); \
472 /* Versions of the DBGxxx_IF() macros that imply DBGxxx_IF( LOG, ... )*/
474 #define DBG( ... ) DBG_IF ( LOG, ##__VA_ARGS__ )
475 #define DBG_HDA( ... ) DBG_HDA_IF ( LOG, ##__VA_ARGS__ )
476 #define DBG_HD( ... ) DBG_HD_IF ( LOG, ##__VA_ARGS__ )
477 #define DBG_MD5A( ... ) DBG_MD5A_IF ( LOG, ##__VA_ARGS__ )
478 #define DBG_MD5( ... ) DBG_MD5_IF ( LOG, ##__VA_ARGS__ )
479 #define DBG_PAUSE( ... ) DBG_PAUSE_IF ( LOG, ##__VA_ARGS__ )
480 #define DBG_MORE( ... ) DBG_MORE_IF ( LOG, ##__VA_ARGS__ )
481 #define DBGC( ... ) DBGC_IF ( LOG, ##__VA_ARGS__ )
482 #define DBGC_HDA( ... ) DBGC_HDA_IF ( LOG, ##__VA_ARGS__ )
483 #define DBGC_HD( ... ) DBGC_HD_IF ( LOG, ##__VA_ARGS__ )
484 #define DBGC_MD5A( ... ) DBGC_MD5A_IF ( LOG, ##__VA_ARGS__ )
485 #define DBGC_MD5( ... ) DBGC_MD5_IF ( LOG, ##__VA_ARGS__ )
486 #define DBGC_PAUSE( ... ) DBGC_PAUSE_IF ( LOG, ##__VA_ARGS__ )
487 #define DBGC_MORE( ... ) DBGC_MORE_IF ( LOG, ##__VA_ARGS__ )
489 /* Versions of the DBGxxx_IF() macros that imply DBGxxx_IF( EXTRA, ... )*/
491 #define DBG2( ... ) DBG_IF ( EXTRA, ##__VA_ARGS__ )
492 #define DBG2_HDA( ... ) DBG_HDA_IF ( EXTRA, ##__VA_ARGS__ )
493 #define DBG2_HD( ... ) DBG_HD_IF ( EXTRA, ##__VA_ARGS__ )
494 #define DBG2_MD5A( ... ) DBG_MD5A_IF ( EXTRA, ##__VA_ARGS__ )
495 #define DBG2_MD5( ... ) DBG_MD5_IF ( EXTRA, ##__VA_ARGS__ )
496 #define DBG2_PAUSE( ... ) DBG_PAUSE_IF ( EXTRA, ##__VA_ARGS__ )
497 #define DBG2_MORE( ... ) DBG_MORE_IF ( EXTRA, ##__VA_ARGS__ )
498 #define DBGC2( ... ) DBGC_IF ( EXTRA, ##__VA_ARGS__ )
499 #define DBGC2_HDA( ... ) DBGC_HDA_IF ( EXTRA, ##__VA_ARGS__ )
500 #define DBGC2_HD( ... ) DBGC_HD_IF ( EXTRA, ##__VA_ARGS__ )
501 #define DBGC2_MD5A( ... ) DBGC_MD5A_IF ( EXTRA, ##__VA_ARGS__ )
502 #define DBGC2_MD5( ... ) DBGC_MD5_IF ( EXTRA, ##__VA_ARGS__ )
503 #define DBGC2_PAUSE( ... ) DBGC_PAUSE_IF ( EXTRA, ##__VA_ARGS__ )
504 #define DBGC2_MORE( ... ) DBGC_MORE_IF ( EXTRA, ##__VA_ARGS__ )
506 /* Versions of the DBGxxx_IF() macros that imply DBGxxx_IF( PROFILE, ... )*/
508 #define DBGP( ... ) DBG_IF ( PROFILE, ##__VA_ARGS__ )
509 #define DBGP_HDA( ... ) DBG_HDA_IF ( PROFILE, ##__VA_ARGS__ )
510 #define DBGP_HD( ... ) DBG_HD_IF ( PROFILE, ##__VA_ARGS__ )
511 #define DBGP_MD5A( ... ) DBG_MD5A_IF ( PROFILE, ##__VA_ARGS__ )
512 #define DBGP_MD5( ... ) DBG_MD5_IF ( PROFILE, ##__VA_ARGS__ )
513 #define DBGP_PAUSE( ... ) DBG_PAUSE_IF ( PROFILE, ##__VA_ARGS__ )
514 #define DBGP_MORE( ... ) DBG_MORE_IF ( PROFILE, ##__VA_ARGS__ )
515 #define DBGCP( ... ) DBGC_IF ( PROFILE, ##__VA_ARGS__ )
516 #define DBGCP_HDA( ... ) DBGC_HDA_IF ( PROFILE, ##__VA_ARGS__ )
517 #define DBGCP_HD( ... ) DBGC_HD_IF ( PROFILE, ##__VA_ARGS__ )
518 #define DBGCP_MD5A( ... ) DBGC_MD5A_IF ( PROFILE, ##__VA_ARGS__ )
519 #define DBGCP_MD5( ... ) DBGC_MD5_IF ( PROFILE, ##__VA_ARGS__ )
520 #define DBGCP_PAUSE( ... ) DBGC_PAUSE_IF ( PROFILE, ##__VA_ARGS__ )
521 #define DBGCP_MORE( ... ) DBGC_MORE_IF ( PROFILE, ##__VA_ARGS__ )
523 /* Versions of the DBGxxx_IF() macros that imply DBGxxx_IF( IO, ... )*/
525 #define DBGIO( ... ) DBG_IF ( IO, ##__VA_ARGS__ )
526 #define DBGIO_HDA( ... ) DBG_HDA_IF ( IO, ##__VA_ARGS__ )
527 #define DBGIO_HD( ... ) DBG_HD_IF ( IO, ##__VA_ARGS__ )
528 #define DBGIO_MD5A( ... ) DBG_MD5A_IF ( IO, ##__VA_ARGS__ )
529 #define DBGIO_MD5( ... ) DBG_MD5_IF ( IO, ##__VA_ARGS__ )
530 #define DBGIO_PAUSE( ... ) DBG_PAUSE_IF ( IO, ##__VA_ARGS__ )
531 #define DBGIO_MORE( ... ) DBG_MORE_IF ( IO, ##__VA_ARGS__ )
532 #define DBGCIO( ... ) DBGC_IF ( IO, ##__VA_ARGS__ )
533 #define DBGCIO_HDA( ... ) DBGC_HDA_IF ( IO, ##__VA_ARGS__ )
534 #define DBGCIO_HD( ... ) DBGC_HD_IF ( IO, ##__VA_ARGS__ )
535 #define DBGCIO_MD5A( ... ) DBGC_MD5A_IF ( IO, ##__VA_ARGS__ )
536 #define DBGCIO_MD5( ... ) DBGC_MD5_IF ( IO, ##__VA_ARGS__ )
537 #define DBGCIO_PAUSE( ... ) DBGC_PAUSE_IF ( IO, ##__VA_ARGS__ )
538 #define DBGCIO_MORE( ... ) DBGC_MORE_IF ( IO, ##__VA_ARGS__ )
540 #endif /* ASSEMBLY */
543 /** @defgroup attrs Miscellaneous attributes
548 /** Declare a variable or data structure as unused. */
549 #define __unused __attribute__ (( unused ))
552 * Declare a function as pure - i.e. without side effects
554 #define __pure __attribute__ (( pure ))
557 * Declare a function as const - i.e. it does not access global memory
558 * (including dereferencing pointers passed to it) at all.
559 * Must also not call any non-const functions.
561 #define __const __attribute__ (( const ))
564 * Declare a function's pointer parameters as non-null - i.e. force
565 * compiler to check pointers at compile time and enable possible
566 * optimizations based on that fact
568 #define __nonnull __attribute__ (( nonnull ))
571 * Declare a pointer returned by a function as a unique memory address
572 * as returned by malloc-type functions.
574 #define __malloc __attribute__ (( malloc ))
577 * Declare a function as used.
579 * Necessary only if the function is called only from assembler code.
581 #define __used __attribute__ (( used ))
583 /** Declare a data structure to be aligned with 16-byte alignment */
584 #define __aligned __attribute__ (( aligned ( 16 ) ))
586 /** Declare a function to be always inline */
587 #define __always_inline __attribute__ (( always_inline ))
589 /* Force all inline functions to not be instrumented
591 * This is required to cope with what seems to be a long-standing gcc
592 * bug, in which -finstrument-functions will cause instances of
593 * inlined functions to be reported as further calls to the
594 * *containing* function. This makes instrumentation very difficult
597 * Work around this problem by adding the no_instrument_function
598 * attribute to all inlined functions.
600 #define inline inline __attribute__ (( no_instrument_function ))
605 * To save space in the binary when multiple-driver images are
606 * compiled, uninitialised data areas can be shared between drivers.
607 * This will typically be used to share statically-allocated receive
608 * and transmit buffers between drivers.
615 * char rx_buf[NUM_RX_BUF][RX_BUF_SIZE];
616 * char tx_buf[TX_BUF_SIZE];
617 * } my_static_data __shared;
622 #define __shared __asm__ ( "_shared_bss" ) __aligned
624 #endif /* ASSEMBLY */
628 * Optimisation barrier
631 #define barrier() __asm__ __volatile__ ( "" : : : "memory" )
632 #endif /* ASSEMBLY */
635 * @defgroup licences Licence declarations
637 * For reasons that are partly historical, various different files
638 * within the iPXE codebase have differing licences.
643 /** Declare a file as being in the public domain
645 * This licence declaration is applicable when a file states itself to
646 * be in the public domain.
648 #define FILE_LICENCE_PUBLIC_DOMAIN \
649 PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__public_domain__ ) )
651 /** Declare a file as being under version 2 (or later) of the GNU GPL
653 * This licence declaration is applicable when a file states itself to
654 * be licensed under the GNU GPL; "either version 2 of the License, or
655 * (at your option) any later version".
657 #define FILE_LICENCE_GPL2_OR_LATER \
658 PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__gpl2_or_later__ ) )
660 /** Declare a file as being under version 2 of the GNU GPL
662 * This licence declaration is applicable when a file states itself to
663 * be licensed under version 2 of the GPL, and does not include the
664 * "or, at your option, any later version" clause.
666 #define FILE_LICENCE_GPL2_ONLY \
667 PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__gpl2_only__ ) )
669 /** Declare a file as being under any version of the GNU GPL
671 * This licence declaration is applicable when a file states itself to
672 * be licensed under the GPL, but does not specify a version.
674 * According to section 9 of the GPLv2, "If the Program does not
675 * specify a version number of this License, you may choose any
676 * version ever published by the Free Software Foundation".
678 #define FILE_LICENCE_GPL_ANY \
679 PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__gpl_any__ ) )
681 /** Declare a file as being under the three-clause BSD licence
683 * This licence declaration is applicable when a file states itself to
684 * be licensed under terms allowing redistribution in source and
685 * binary forms (with or without modification) provided that:
687 * redistributions of source code retain the copyright notice,
688 * list of conditions and any attached disclaimers
690 * redistributions in binary form reproduce the copyright notice,
691 * list of conditions and any attached disclaimers in the
692 * documentation and/or other materials provided with the
695 * the name of the author is not used to endorse or promote
696 * products derived from the software without specific prior
699 * It is not necessary for the file to explicitly state that it is
700 * under a "BSD" licence; only that the licensing terms be
701 * functionally equivalent to the standard three-clause BSD licence.
703 #define FILE_LICENCE_BSD3 \
704 PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__bsd3__ ) )
706 /** Declare a file as being under the two-clause BSD licence
708 * This licence declaration is applicable when a file states itself to
709 * be licensed under terms allowing redistribution in source and
710 * binary forms (with or without modification) provided that:
712 * redistributions of source code retain the copyright notice,
713 * list of conditions and any attached disclaimers
715 * redistributions in binary form reproduce the copyright notice,
716 * list of conditions and any attached disclaimers in the
717 * documentation and/or other materials provided with the
720 * It is not necessary for the file to explicitly state that it is
721 * under a "BSD" licence; only that the licensing terms be
722 * functionally equivalent to the standard two-clause BSD licence.
724 #define FILE_LICENCE_BSD2 \
725 PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__bsd2__ ) )
727 /** Declare a file as being under the one-clause MIT-style licence
729 * This licence declaration is applicable when a file states itself to
730 * be licensed under terms allowing redistribution for any purpose
731 * with or without fee, provided that the copyright notice and
732 * permission notice appear in all copies.
734 #define FILE_LICENCE_MIT \
735 PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__mit__ ) )
737 /** Declare a file as being under GPLv2+ or UBDL
739 * This licence declaration is applicable when a file states itself to
740 * be licensed under the GNU GPL; "either version 2 of the License, or
741 * (at your option) any later version" and also states that it may be
742 * distributed under the terms of the Unmodified Binary Distribution
743 * Licence (as given in the file COPYING.UBDL).
745 #define FILE_LICENCE_GPL2_OR_LATER_OR_UBDL \
746 PROVIDE_SYMBOL ( PREFIX_OBJECT ( __licence__gpl2_or_later_or_ubdl__ ) )
748 /** Declare a particular licence as applying to a file */
749 #define FILE_LICENCE( _licence ) FILE_LICENCE_ ## _licence
753 /* This file itself is under GPLv2+/UBDL */
754 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
756 #include <bits/compiler.h>
758 #endif /* COMPILER_H */