. cmd/nvedit.c

1    ulong getenv_ulong(const char *name, int base, ulong default_val)
2    {
3            /*
4             * We can use getenv() here, even before relocation, since the
5             * environment variable value is an integer and thus short.
6             */
7            const char *str = getenv(name);
8    
9            return str ? simple_strtoul(str, NULL, base) : default_val;
10    }
  • getenv_ulong함수의 인자는 ("fdtcontroladdr", 16, (uintptr_t)gd->fdt_blob)입니다.
  • 7번 줄의 getenv함수를 통해 fdtcontroladdr를 찾습니다.
  • 9번 줄의 simple_strtoul함수는 string을 unsigned long으로 변환해 주는 간단한 함수입니다. 만약 환경설정에서 fdtcontroladdr를 찾으면 주소를 unsigned long으로 변환해 반환하고 아니라면 (uintptr_t)gd->fdt_blob를 반환합니다.

results matching ""

    No results matching ""