~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/skiboot/core/test/stubs.c

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2013-2014 IBM Corp.
 
2
 *
 
3
 * Licensed under the Apache License, Version 2.0 (the "License");
 
4
 * you may not use this file except in compliance with the License.
 
5
 * You may obtain a copy of the License at
 
6
 *
 
7
 *      http://www.apache.org/licenses/LICENSE-2.0
 
8
 *
 
9
 * Unless required by applicable law or agreed to in writing, software
 
10
 * distributed under the License is distributed on an "AS IS" BASIS,
 
11
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 
12
 * implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
 
15
 */
 
16
#include <stdlib.h>
 
17
#include <stdio.h>
 
18
#include <stdarg.h>
 
19
 
 
20
void _prlog(int log_level __attribute__((unused)), const char* fmt, ...) __attribute__((format (printf, 2, 3)));
 
21
 
 
22
#ifndef pr_fmt
 
23
#define pr_fmt(fmt) fmt
 
24
#endif
 
25
#define prlog(l, f, ...) do { _prlog(l, pr_fmt(f), ##__VA_ARGS__); } while(0)
 
26
 
 
27
void _prlog(int log_level __attribute__((unused)), const char* fmt, ...)
 
28
{
 
29
        va_list ap;
 
30
 
 
31
        va_start(ap, fmt);
 
32
        vprintf(fmt, ap);
 
33
        va_end(ap);
 
34
}
 
35
 
 
36
/* Add any stub functions required for linking here. */
 
37
static void stub_function(void)
 
38
{
 
39
        abort();
 
40
}
 
41
 
 
42
#define STUB(fnname) \
 
43
        void fnname(void) __attribute__((weak, alias ("stub_function")))
 
44
 
 
45
STUB(fdt_begin_node);
 
46
STUB(fdt_property);
 
47
STUB(fdt_end_node);
 
48
STUB(fdt_create);
 
49
STUB(fdt_add_reservemap_entry);
 
50
STUB(fdt_finish_reservemap);
 
51
STUB(fdt_strerror);
 
52
STUB(fdt_check_header);
 
53
STUB(_fdt_check_node_offset);
 
54
STUB(fdt_next_tag);
 
55
STUB(fdt_string);
 
56
STUB(fdt_get_name);
 
57
STUB(dt_first);
 
58
STUB(dt_next);
 
59
STUB(dt_has_node_property);
 
60
STUB(dt_get_address);
 
61
STUB(add_chip_dev_associativity);