[9182e86f] | 1 | /*
|
---|
| 2 | * Copyright (c) 2016 Jiri Svoboda
|
---|
| 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /** @addtogroup libdltest
|
---|
| 30 | * @brief Dynamic linking test library
|
---|
| 31 | * @{
|
---|
| 32 | */
|
---|
| 33 | /** @file
|
---|
| 34 | */
|
---|
| 35 |
|
---|
[0dc9a474] | 36 | #include <fibril.h>
|
---|
[9182e86f] | 37 | #include "libdltest.h"
|
---|
| 38 |
|
---|
| 39 | /** Private initialized variable */
|
---|
| 40 | static int private_var = dl_private_var_val;
|
---|
| 41 | /** Private uninitialized variable */
|
---|
| 42 | static int private_uvar;
|
---|
| 43 |
|
---|
| 44 | /** Public initialized variable */
|
---|
| 45 | int dl_public_var = dl_public_var_val;
|
---|
| 46 | /** Public uninitialized variable */
|
---|
| 47 | int dl_public_uvar;
|
---|
| 48 |
|
---|
[0dc9a474] | 49 | /** Private initialized fibril-local variable */
|
---|
| 50 | static fibril_local int dl_private_fib_var = dl_private_fib_var_val;
|
---|
| 51 | /** Private uninitialized fibril-local variable */
|
---|
| 52 | static fibril_local int dl_private_fib_uvar;
|
---|
| 53 |
|
---|
| 54 | /** Public initialized fibril-local variable */
|
---|
| 55 | fibril_local int dl_public_fib_var = dl_public_fib_var_val;
|
---|
| 56 | /** Public uninitialized fibril-local variable */
|
---|
| 57 | fibril_local int dl_public_fib_uvar;
|
---|
| 58 |
|
---|
[9182e86f] | 59 | /** Return constant value. */
|
---|
| 60 | int dl_get_constant(void)
|
---|
| 61 | {
|
---|
| 62 | return dl_constant;
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | /** Return value of private initialized variable */
|
---|
| 66 | int dl_get_private_var(void)
|
---|
| 67 | {
|
---|
| 68 | return private_var;
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | /** Return value of private uninitialized variable */
|
---|
| 72 | int dl_get_private_uvar(void)
|
---|
| 73 | {
|
---|
| 74 | return private_uvar;
|
---|
| 75 | }
|
---|
| 76 |
|
---|
| 77 | /** Return value of public initialized variable */
|
---|
| 78 | int dl_get_public_var(void)
|
---|
| 79 | {
|
---|
| 80 | return dl_public_var;
|
---|
| 81 | }
|
---|
| 82 |
|
---|
| 83 | /** Return value of public uninitialized variable */
|
---|
| 84 | int dl_get_public_uvar(void)
|
---|
| 85 | {
|
---|
| 86 | return dl_public_uvar;
|
---|
| 87 | }
|
---|
| 88 |
|
---|
[0dc9a474] | 89 | /** Return value of private initialized fibril-local variable */
|
---|
| 90 | int dl_get_private_fib_var(void)
|
---|
| 91 | {
|
---|
| 92 | return dl_private_fib_var;
|
---|
| 93 | }
|
---|
| 94 |
|
---|
| 95 | /** Return value of private uninitialized fibril-local variable */
|
---|
| 96 | int dl_get_private_fib_uvar(void)
|
---|
| 97 | {
|
---|
| 98 | return dl_private_fib_uvar;
|
---|
| 99 | }
|
---|
| 100 |
|
---|
| 101 | /** Return value of public initialized fibril-local variable */
|
---|
| 102 | int dl_get_public_fib_var(void)
|
---|
| 103 | {
|
---|
| 104 | return dl_public_fib_var;
|
---|
| 105 | }
|
---|
| 106 |
|
---|
| 107 | /** Return value of public uninitialized fibril-local variable */
|
---|
| 108 | int dl_get_public_fib_uvar(void)
|
---|
| 109 | {
|
---|
| 110 | return dl_public_fib_uvar;
|
---|
| 111 | }
|
---|
| 112 |
|
---|
[9182e86f] | 113 | /**
|
---|
| 114 | * @}
|
---|
| 115 | */
|
---|