ulib: Move ulib into its own directory

Before adding more files, create a new lib/ulib directory and put the
only existing file in there.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-09-05 15:53:38 -06:00
parent e2d8843922
commit 4c0d9d2959
3 changed files with 7 additions and 1 deletions

6
lib/ulib/Makefile Normal file
View File

@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-2.0+
# Copyright 2025 Canonical
# Written by Simon Glass <simon.glass@canonical.com>
obj-y += ulib.o

36
lib/ulib/ulib.c Normal file
View File

@@ -0,0 +1,36 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Simplified U-Boot library interface implementation
*
* Copyright 2025 Canonical
* Written by Simon Glass <simon.glass@canonical.com>
*/
#include <string.h>
#include <version.h>
#include <asm/global_data.h>
#include <u-boot-lib.h>
/* Static storage for global data when using simplified API */
static struct global_data static_gd;
int ulib_init(char *progname)
{
int ret;
/* Initialize the U-Boot library with our static global data */
ret = ulib_init_with_data(progname, &static_gd);
if (ret)
return ret;
return 0;
}
void ulib_uninit(void)
{
}
const char *ulib_get_version(void)
{
return PLAIN_VERSION;
}