X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Flinker_lists.h;h=0575164ce4c8723c73cd3e699e1febbc0e1dc158;hb=5fac11e6d5ab350429b8c8ddf47d3d3877ca89d1;hp=fd98ecd297c14b862c13ddc939a892ad3bfca708;hpb=795f8fd0b591eef7cf3f8c6fcf9788280029cc4a;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/linker_lists.h b/include/linker_lists.h index fd98ecd..0575164 100644 --- a/include/linker_lists.h +++ b/include/linker_lists.h @@ -69,8 +69,8 @@ */ #define ll_entry_declare(_type, _name, _list) \ _type _u_boot_list_2_##_list##_2_##_name __aligned(4) \ - __attribute__((unused, \ - section(".u_boot_list_2_"#_list"_2_"#_name))) + __attribute__((unused)) \ + __section(".u_boot_list_2_"#_list"_2_"#_name) /** * ll_entry_declare_list() - Declare a list of link-generated array entries @@ -92,8 +92,8 @@ */ #define ll_entry_declare_list(_type, _name, _list) \ _type _u_boot_list_2_##_list##_2_##_name[] __aligned(4) \ - __attribute__((unused, \ - section(".u_boot_list_2_"#_list"_2_"#_name))) + __attribute__((unused)) \ + __section(".u_boot_list_2_"#_list"_2_"#_name) /* * We need a 0-byte-size type for iterator symbols, and the compiler @@ -125,8 +125,8 @@ #define ll_entry_start(_type, _list) \ ({ \ static char start[0] __aligned(CONFIG_LINKER_LIST_ALIGN) \ - __attribute__((unused, \ - section(".u_boot_list_2_"#_list"_1"))); \ + __attribute__((unused)) \ + __section(".u_boot_list_2_"#_list"_1"); \ (_type *)&start; \ }) @@ -151,8 +151,8 @@ */ #define ll_entry_end(_type, _list) \ ({ \ - static char end[0] __aligned(4) __attribute__((unused, \ - section(".u_boot_list_2_"#_list"_3"))); \ + static char end[0] __aligned(4) __attribute__((unused)) \ + __section(".u_boot_list_2_"#_list"_3"); \ (_type *)&end; \ }) /** @@ -212,6 +212,22 @@ }) /** + * ll_entry_ref() - Get a reference to a linker-generated array entry + * + * Once an extern ll_entry_declare() has been used to declare the reference, + * this macro allows the entry to be accessed. + * + * This is like ll_entry_get(), but without the extra code, so it is suitable + * for putting into data structures. + * + * @_type: C type of the list entry, e.g. 'struct foo' + * @_name: name of the entry + * @_list: name of the list + */ +#define ll_entry_ref(_type, _name, _list) \ + ((_type *)&_u_boot_list_2_##_list##_2_##_name) + +/** * ll_start() - Point to first entry of first linker-generated array * @_type: Data type of the entry * @@ -229,8 +245,8 @@ */ #define ll_start(_type) \ ({ \ - static char start[0] __aligned(4) __attribute__((unused, \ - section(".u_boot_list_1"))); \ + static char start[0] __aligned(4) __attribute__((unused)) \ + __section(".u_boot_list_1"); \ (_type *)&start; \ }) @@ -252,8 +268,8 @@ */ #define ll_end(_type) \ ({ \ - static char end[0] __aligned(4) __attribute__((unused, \ - section(".u_boot_list_3"))); \ + static char end[0] __aligned(4) __attribute__((unused)) \ + __section(".u_boot_list_3"); \ (_type *)&end; \ })