blob: 0cb2c0c8d261b90f78727968636e51d1f3acf5da [file] [log] [blame]
Myles Watson58170782009-10-28 16:13:28 +00001/*
2 * This file is part of the coreboot project.
3 *
Uwe Hermannc70e9fc2010-02-15 23:10:19 +00004 * Copyright (C) 2009 Myles Watson <mylesgw@gmail.com>
Myles Watson58170782009-10-28 16:13:28 +00005 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
18 */
19
20/* This file is for "nuisance prototypes" that have no other home. */
21
Myles Watson34261952010-03-19 02:33:40 +000022#ifndef __LIB_H__
23#define __LIB_H__
Ronald G. Minnich9764d4c2012-06-12 16:29:32 -070024#include <stdint.h>
Alexandru Gagniuc3dd0e722013-12-26 22:53:52 -050025#include <types.h>
Myles Watson34261952010-03-19 02:33:40 +000026
Alexandru Gagniucaf4bd592014-01-12 15:42:58 -060027#if !defined(__ROMCC__) /* Conflicts with inline function in arch/io.h */
Myles Watson58170782009-10-28 16:13:28 +000028/* Defined in src/lib/clog2.c */
29unsigned long log2(unsigned long x);
Myles Watson34261952010-03-19 02:33:40 +000030#endif
Alexandru Gagniuc594ef812014-01-13 00:49:49 -060031unsigned long log2_ceil(unsigned long x);
Myles Watson58170782009-10-28 16:13:28 +000032
33/* Defined in src/lib/lzma.c */
34unsigned long ulzma(unsigned char *src, unsigned char *dst);
35
Myles Watson34261952010-03-19 02:33:40 +000036/* Defined in src/lib/ramtest.c */
37void ram_check(unsigned long start, unsigned long stop);
Sven Schnelle3ad8c542011-12-02 16:23:06 +010038int ram_check_nodie(unsigned long start, unsigned long stop);
Alexandru Gagniuc5239ba22013-06-08 11:32:36 -050039int ram_check_noprint_nodie(unsigned long start, unsigned long stop);
Myles Watsonb54deb72010-04-02 21:39:12 +000040void quick_ram_check(void);
Myles Watson34261952010-03-19 02:33:40 +000041
David Hendricks560c6432014-02-13 13:07:50 -080042/* Defined in primitive_memtest.c */
43int primitive_memtest(uintptr_t base, uintptr_t size);
44
Ronald G. Minnich9764d4c2012-06-12 16:29:32 -070045/* Defined in src/lib/stack.c */
Stefan Reinauer75dbc382012-10-15 15:19:43 -070046int checkstack(void *top_of_stack, int core);
Ronald G. Minnich9764d4c2012-06-12 16:29:32 -070047
Stefan Reinauer3f5f6d82013-05-07 20:35:29 +020048#ifndef __PRE_RAM__ // fails in bootblock compiled with romcc
Ronald G. Minnich9764d4c2012-06-12 16:29:32 -070049/* currently defined by a ldscript */
Stefan Reinauer75dbc382012-10-15 15:19:43 -070050extern unsigned char _estack[];
Stefan Reinauer3f5f6d82013-05-07 20:35:29 +020051#endif
Ronald G. Minnich9764d4c2012-06-12 16:29:32 -070052
Stefan Reinauer2f38b072013-07-18 16:24:08 -070053/* Defined in src/lib/hexdump.c */
Alexandru Gagniuc3dd0e722013-12-26 22:53:52 -050054void hexdump(const void *memory, size_t length);
Paul Menzel60ec2ff2014-05-03 16:21:34 +020055void hexdump32(char LEVEL, const void *d, size_t len);
Stefan Reinauer2f38b072013-07-18 16:24:08 -070056
Myles Watson34261952010-03-19 02:33:40 +000057#endif /* __LIB_H__ */