uboot/examples/api/libgenwrap.c
<<
>>
Prefs
   1// SPDX-License-Identifier: GPL-2.0+
   2/*
   3 * (C) Copyright 2007 Semihalf
   4 *
   5 * Written by: Rafal Jaworowski <raj@semihalf.com>
   6 *
   7 * This is is a set of wrappers/stubs that allow to use certain routines from
   8 * U-Boot's lib in the standalone app. This way way we can re-use
   9 * existing code e.g. operations on strings and similar.
  10 */
  11
  12#include <common.h>
  13#include <command.h>
  14#include <hang.h>
  15#include <linux/delay.h>
  16#include <linux/types.h>
  17#include <api_public.h>
  18
  19#include "glue.h"
  20
  21void putc(const char c)
  22{
  23        ub_putc(c);
  24}
  25
  26void puts(const char *s)
  27{
  28        ub_puts(s);
  29}
  30
  31void __udelay(unsigned long usec)
  32{
  33        ub_udelay(usec);
  34}
  35
  36int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
  37{
  38        ub_reset();
  39        return 0;
  40}
  41
  42void *malloc (size_t len)
  43{
  44        return NULL;
  45}
  46
  47void hang(void)
  48{
  49        while (1) ;
  50}
  51