[riot-notifications] [RIOT] cpu: provide link-time random value, use as fake cpuid (#3944)

Kaspar Schleiser notifications at github.com
Wed Sep 23 17:50:16 CEST 2015


> @@ -45,7 +45,14 @@ extern "C" {
>   *                  defined in the CPU's cpu_conf.h)
>   */
>  void cpuid_get(void *id);
> -#endif /* CPUID_ID_LEN */
> +#else
> +extern unsigned *RANDOM;
> +#define CPUID_ID_LEN (sizeof(&RANDOM))
> +static inline void cpuid_get(void* id)
> +{
> +    *(unsigned*)id = (unsigned) &RANDOM;

> Shouldn't it be:
> 
>                             v
> *(unsigned*)id = (unsigned) *RANDOM;

No, somehow when ld defines a symbol, it defines where the symbol points to.


---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3944/files#r40220468
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150923/2ca03e4e/attachment-0001.html>


More information about the notifications mailing list