mirror of
https://git.rtems.org/rtems-docs/
synced 2025-07-24 04:24:24 +08:00
c-user: Fix linker set code blocks
This commit is contained in:
parent
3b9b8a004c
commit
51392ac0df
@ -92,11 +92,11 @@ section descriptions.
|
||||
|
||||
/* To be placed in a read-only memory region */
|
||||
.rtemsroset : {
|
||||
KEEP (*(SORT(.rtemsroset.*)))
|
||||
KEEP (*(SORT(.rtemsroset.*)))
|
||||
}
|
||||
/* To be placed in a read-write memory region */
|
||||
.rtemsrwset : {
|
||||
KEEP (*(SORT(.rtemsrwset.*)))
|
||||
KEEP (*(SORT(.rtemsrwset.*)))
|
||||
}
|
||||
|
||||
The ``KEEP()`` ensures that a garbage collection by the linker will not discard
|
||||
@ -436,7 +436,7 @@ NOTES:
|
||||
#include <rtems/linkersets.h>
|
||||
|
||||
typedef struct {
|
||||
int foo;
|
||||
int foo;
|
||||
} xyz_item;
|
||||
|
||||
/* The XYZ-order defines */
|
||||
@ -445,10 +445,10 @@ NOTES:
|
||||
|
||||
/* Defines an ordered XYZ-item */
|
||||
#define XYZ_ITEM( item, order ) \
|
||||
enum { xyz_##item = order - order }; \
|
||||
RTEMS_LINKER_ROSET_ITEM_ORDERED( \
|
||||
xyz, const xyz_item *, item, order \
|
||||
) = { &item }
|
||||
enum { xyz_##item = order }; \
|
||||
RTEMS_LINKER_ROSET_ITEM_ORDERED( \
|
||||
xyz, const xyz_item *, item, order \
|
||||
) = { &item }
|
||||
|
||||
/* Example item */
|
||||
static const xyz_item some_item = { 123 };
|
||||
@ -636,7 +636,7 @@ NOTES:
|
||||
#include <rtems/linkersets.h>
|
||||
|
||||
typedef struct {
|
||||
int foo;
|
||||
int foo;
|
||||
} xyz_item;
|
||||
|
||||
/* The XYZ-order defines */
|
||||
@ -645,10 +645,11 @@ NOTES:
|
||||
|
||||
/* Defines an ordered XYZ-item */
|
||||
#define XYZ_ITEM( item, order ) \
|
||||
enum { xyz_##item = order - order }; \
|
||||
RTEMS_LINKER_RWSET_ITEM_ORDERED( \
|
||||
xyz, const xyz_item *, item, order \
|
||||
) = { &item }
|
||||
enum { xyz_##item = order }; \
|
||||
RTEMS_LINKER_RWSET_ITEM_ORDERED( \
|
||||
xyz, const xyz_item *, item, order \
|
||||
) = { &item }
|
||||
|
||||
/* Example item */
|
||||
static const xyz_item some_item = { 123 };
|
||||
XYZ_ITEM( some_item, XYZ_ORDER_FIRST );
|
||||
|
Loading…
x
Reference in New Issue
Block a user