annotate libmpx/mpxrt/mpxrt-utils.h @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* mpxrt-utils.h -*-C++-*-
kono
parents:
diff changeset
2 *
kono
parents:
diff changeset
3 *************************************************************************
kono
parents:
diff changeset
4 *
kono
parents:
diff changeset
5 * @copyright
kono
parents:
diff changeset
6 * Copyright (C) 2014, Intel Corporation
kono
parents:
diff changeset
7 * All rights reserved.
kono
parents:
diff changeset
8 *
kono
parents:
diff changeset
9 * @copyright
kono
parents:
diff changeset
10 * Redistribution and use in source and binary forms, with or without
kono
parents:
diff changeset
11 * modification, are permitted provided that the following conditions
kono
parents:
diff changeset
12 * are met:
kono
parents:
diff changeset
13 *
kono
parents:
diff changeset
14 * * Redistributions of source code must retain the above copyright
kono
parents:
diff changeset
15 * notice, this list of conditions and the following disclaimer.
kono
parents:
diff changeset
16 * * Redistributions in binary form must reproduce the above copyright
kono
parents:
diff changeset
17 * notice, this list of conditions and the following disclaimer in
kono
parents:
diff changeset
18 * the documentation and/or other materials provided with the
kono
parents:
diff changeset
19 * distribution.
kono
parents:
diff changeset
20 * * Neither the name of Intel Corporation nor the names of its
kono
parents:
diff changeset
21 * contributors may be used to endorse or promote products derived
kono
parents:
diff changeset
22 * from this software without specific prior written permission.
kono
parents:
diff changeset
23 *
kono
parents:
diff changeset
24 * @copyright
kono
parents:
diff changeset
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
kono
parents:
diff changeset
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
kono
parents:
diff changeset
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
kono
parents:
diff changeset
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
kono
parents:
diff changeset
29 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
kono
parents:
diff changeset
30 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
kono
parents:
diff changeset
31 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
kono
parents:
diff changeset
32 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
kono
parents:
diff changeset
33 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
kono
parents:
diff changeset
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
kono
parents:
diff changeset
35 * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
kono
parents:
diff changeset
36 * POSSIBILITY OF SUCH DAMAGE.
kono
parents:
diff changeset
37 *
kono
parents:
diff changeset
38 **************************************************************************/
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 #ifndef MPXRT_UTILS_H
kono
parents:
diff changeset
41 #define MPXRT_UTILS_H
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 #include <stdint.h>
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 typedef enum {
kono
parents:
diff changeset
46 VERB_ERROR,
kono
parents:
diff changeset
47 VERB_INFO,
kono
parents:
diff changeset
48 VERB_BR,
kono
parents:
diff changeset
49 VERB_DEBUG
kono
parents:
diff changeset
50 } verbose_type;
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 typedef enum {
kono
parents:
diff changeset
53 MPX_RT_COUNT,
kono
parents:
diff changeset
54 MPX_RT_STOP
kono
parents:
diff changeset
55 } mpx_rt_mode_t;
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 typedef enum {
kono
parents:
diff changeset
58 MPX_RT_STOP_HANDLER_ABORT,
kono
parents:
diff changeset
59 MPX_RT_STOP_HANDLER_EXIT
kono
parents:
diff changeset
60 } mpx_rt_stop_mode_handler_t;
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 void __mpxrt_init_env_vars (int* bndpreserve);
kono
parents:
diff changeset
63 void __mpxrt_write_uint (verbose_type vt, uint64_t val, unsigned base);
kono
parents:
diff changeset
64 void __mpxrt_write (verbose_type vt, const char* str);
kono
parents:
diff changeset
65 void __mpxrt_print (verbose_type vt, const char* frmt, ...);
kono
parents:
diff changeset
66 mpx_rt_mode_t __mpxrt_mode (void);
kono
parents:
diff changeset
67 void __mpxrt_utils_free (void);
kono
parents:
diff changeset
68 void __mpxrt_print_summary (uint64_t num_brs, uint64_t l1_size);
kono
parents:
diff changeset
69 void __mpxrt_stop (void) __attribute__ ((noreturn));
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 #endif /* MPXRT_UTILS_H */