資源簡介
從GitHub下載的OpenBMC的U-Boot的源碼
U-Boot,全稱 Universal Boot Loader,是遵循GPL條款的開放源碼項目。U-Boot的作用是系統引導。U-Boot從FADSROM、8xxROM、PPCBOOT逐步發展演化而來。其源碼目錄、編譯形式與Linux內核很相似,事實上,不少U-Boot源碼就是根據相應的Linux內核源程序進行簡化而形成的,尤其是一些設備的驅動程序,這從U-Boot源碼的注釋中能體現這一點。
代碼片段和文件信息
/*
?*?(C)?Copyright?2007?Semihalf
?*
?*?Written?by:?Rafal?Jaworowski?
?*
?*?SPDX-License-Identifier: GPL-2.0+
?*/
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?“api_private.h“
#define?DEBUG
#undef?DEBUG
/*****************************************************************************
?*
?*?This?is?the?API?core.
?*
?*?API_?functions?are?part?of?U-Boot?code?and?constitute?the?lowest?level
?*?calls:
?*
?*??-?they?know?what?values?they?need?as?arguments
?*??-?their?direct?return?value?pertains?to?the?API_?“shell“?itself?(0?on
?*????success?some?error?code?otherwise)
?*??-?if?the?call?returns?a?value?it?is?buried?within?arguments
?*
?****************************************************************************/
#ifdef?DEBUG
#define?debugf(fmt?args...)?do?{?printf(“%s():?“?__func__);?printf(fmt?##args);?}?while?(0)
#else
#define?debugf(fmt?args...)
#endif
typedef int?(*cfp_t)(va_list?argp);
static?int?calls_no;
/*
?*?pseudo?signature:
?*
?*?int?API_getc(int?*c)
?*/
static?int?API_getc(va_list?ap)
{
int?*c;
if?((c?=?(int?*)va_arg(ap?uintptr_t))?==?NULL)
return?API_EINVAL;
*c?=?getc();
return?0;
}
/*
?*?pseudo?signature:
?*
?*?int?API_tstc(int?*c)
?*/
static?int?API_tstc(va_list?ap)
{
int?*t;
if?((t?=?(int?*)va_arg(ap?uintptr_t))?==?NULL)
return?API_EINVAL;
*t?=?tstc();
return?0;
}
/*
?*?pseudo?signature:
?*
?*?int?API_putc(char?*ch)
?*/
static?int?API_putc(va_list?ap)
{
char?*c;
if?((c?=?(char?*)va_arg(ap?uintptr_t))?==?NULL)
return?API_EINVAL;
putc(*c);
return?0;
}
/*
?*?pseudo?signature:
?*
?*?int?API_puts(char?**s)
?*/
static?int?API_puts(va_list?ap)
{
char?*s;
if?((s?=?(char?*)va_arg(ap?uintptr_t))?==?NULL)
return?API_EINVAL;
puts(s);
return?0;
}
/*
?*?pseudo?signature:
?*
?*?int?API_reset(void)
?*/
static?int?API_reset(va_list?ap)
{
do_reset(NULL?0?0?NULL);
/*?NOT?REACHED?*/
return?0;
}
/*
?*?pseudo?signature:
?*
?*?int?API_get_sys_info(struct?sys_info?*si)
?*
?*?fill?out?the?sys_info?struct?containing?selected?parameters?about?the
?*?machine
?*/
static?int?API_get_sys_info(va_list?ap)
{
struct?sys_info?*si;
si?=?(struct?sys_info?*)va_arg(ap?uintptr_t);
if?(si?==?NULL)
return?API_ENOMEM;
return?(platform_sys_info(si))???0?:?API_ENODEV;
}
/*
?*?pseudo?signature:
?*
?*?int?API_udelay(unsigned?long?*udelay)
?*/
static?int?API_udelay(va_list?ap)
{
unsigned?long?*d;
if?((d?=?(unsigned?long?*)va_arg(ap?unsigned?long))?==?NULL)
return?API_EINVAL;
udelay(*d);
return?0;
}
/*
?*?pseudo?signature:
?*
?*?int?API_get_timer(unsigned?long?*current?unsigned?long?*base)
?*/
static?int?API_get_timer(va_list?ap)
{
unsigned?long?*base?*cur;
cur?=?(unsigned?long?*)va_arg(ap?unsigned?long);
if?(cur?==?NULL)
return?API_EINVAL;
base?=?(unsigned?long?*)va_arg(ap?unsigned?long);
if?(base?==?NULL)
return?API_EINVAL;
*cur?=?get_timer(*base);
return?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\
?????文件?????????610??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\.checkpatch.conf
?????文件?????????825??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\.gitignore
?????文件????????1323??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\.mailmap
?????文件????????5645??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\.travis.yml
?????文件????????1863??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Kbuild
?????文件???????11312??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Kconfig
?????目錄???????????0??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\
?????文件?????????627??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\Exceptions
?????文件????????4575??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\OFL.txt
?????文件????????3846??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\README
?????文件????????1249??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\bsd-2-clause.txt
?????文件????????1442??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\bsd-3-clause.txt
?????文件????????1864??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\eCos-2.0.txt
?????文件???????18092??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\gpl-2.0.txt
?????文件?????????849??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\ibm-pibs.txt
?????文件?????????822??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\isc.txt
?????文件???????25383??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\lgpl-2.0.txt
?????文件???????26530??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\lgpl-2.1.txt
?????文件????????1337??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Licenses\x11.txt
?????文件???????11560??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\MAINTAINERS
?????文件???????23247??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\MAKEALL
?????文件???????53335??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\Makefile
?????文件??????233843??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\README
?????目錄???????????0??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\api\
?????文件?????????252??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\api\Makefile
?????文件????????1873??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\api\README
?????文件???????14370??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\api\api.c
?????文件????????1145??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\api\api_display.c
?????文件????????1997??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\api\api_net.c
?????文件?????????844??2018-02-20?05:42??u-boot-2016.07-aspeed-openbmc\api\api_platform-arm.c
............此處省略13287個文件信息
評論
共有 條評論