foboot/third_party/libbase/id.c
Sean Cross 06d64b8c68 it builds! what more do you want?
Signed-off-by: Sean Cross <sean@xobs.io>
2019-01-01 18:41:37 +08:00

21 lines
359 B
C

#include <generated/csr.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <id.h>
void get_ident(char *ident)
{
#ifdef CSR_IDENTIFIER_MEM_BASE
int len, i;
len = MMPTR(CSR_IDENTIFIER_MEM_BASE);
for(i=0;i<len;i++)
ident[i] = MMPTR(CSR_IDENTIFIER_MEM_BASE + 4*i);
ident[i] = 0;
#else
ident[0] = 0;
#endif
}