summaryrefslogtreecommitdiff
path: root/firmware/test/buflib/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/test/buflib/util.c')
-rw-r--r--firmware/test/buflib/util.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/firmware/test/buflib/util.c b/firmware/test/buflib/util.c
deleted file mode 100644
index 66a02e8a0d..0000000000
--- a/firmware/test/buflib/util.c
+++ /dev/null
@@ -1,61 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2015 Thomas Jarosch
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21#include "util.h"
22#include "stdio.h"
23#include "buflib.h"
24#include "system.h"
25
26void print_simple(const char *str)
27{
28 printf("%s\n", str);
29}
30
31void print_handle(int handle_num, const char *str)
32{
33 (void)handle_num;
34 printf("%s\n", str);
35}
36
37/* fake core_allocator_init() with a fixed 50kb buffer size */
38void UT_core_allocator_init()
39{
40 extern struct buflib_context core_ctx;
41 static char buf[50<<10];
42 unsigned char *raw_start = buf;
43 unsigned char *aligned_start = ALIGN_UP(raw_start, sizeof(intptr_t));
44
45 buflib_init(&core_ctx, aligned_start, sizeof(buf) - (aligned_start - raw_start));
46}
47
48/* TODO: those should be part of core_alloc */
49void core_print_blocks(void (*print)(const char*))
50{
51 (void)print;
52 extern struct buflib_context core_ctx;
53 buflib_print_blocks(&core_ctx, &print_handle);
54}
55
56void core_print_allocs(void (*print)(const char*))
57{
58 (void)print;
59 extern struct buflib_context core_ctx;
60 buflib_print_allocs(&core_ctx, &print_handle);
61}