/** Apply standard C calling conventions */
#define __cdecl __attribute__ (( cdecl , regparm(0) ))
+ /**
+ * Declare a function as pure - i.e. without side effects
+ */
+ #define __pure __attribute__ (( pure ))
+
+ /**
+ * Declare a function as const - i.e. it does not access global memory
+ * (including dereferencing pointers passed to it) at all.
+ * Must also not call any non-const functions.
+ */
+ #define __const __attribute__ (( const ))
+
+ /**
+ * Declare a function's pointer parameters as non-null - i.e. force
+ * compiler to check pointers at compile time and enable possible
+ * optimizations based on that fact
+ */
+ #define __nonnull __attribute__ (( nonnull ))
+
+ /**
+ * Declare a pointer returned by a function as a unique memory address
+ * as returned by malloc-type functions.
+ */
+ #define __malloc __attribute__ (( malloc ))
+
/**
* Declare a function as used.
*
*/
#define __shared __asm__ ( "_shared_bss" )
+/**
+ * Optimisation barrier
+ */
+#define barrier() __asm__ __volatile__ ( "" : : : "memory" )
+
#endif /* ASSEMBLY */
#endif /* COMPILER_H */
*/
#define DHCP_EB_SIADDR DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 3 )
+/*
+ * Tags in the range 0x10-0x7f are reserved for feature markers
+ *
+ */
+
/** Network device descriptor
*
* Byte 0 is the bus type ID; remaining bytes depend on the bus type.
extern void unregister_dhcp_options ( struct dhcp_option_block *options );
extern void init_dhcp_options ( struct dhcp_option_block *options,
void *data, size_t max_len );
- extern struct dhcp_option_block * alloc_dhcp_options ( size_t max_len );
+ extern struct dhcp_option_block * __malloc alloc_dhcp_options ( size_t max_len );
extern struct dhcp_option *
set_dhcp_option ( struct dhcp_option_block *options, unsigned int tag,
const void *data, size_t len );
/* Unspecified IP6 address */
static struct in6_addr ip6_none = {
- .in6_u.u6_addr32[0] = 0,
- .in6_u.u6_addr32[1] = 0,
- .in6_u.u6_addr32[2] = 0,
- .in6_u.u6_addr32[3] = 0,
+ .in6_u.u6_addr32 = { 0,0,0,0 }
};
/** An IPv6 routing table entry */
* @v gateway Gateway address (or ::0 for no gateway)
* @ret miniroute Routing table entry, or NULL
*/
- static struct ipv6_miniroute * add_ipv6_miniroute ( struct net_device *netdev,
- struct in6_addr prefix,
- int prefix_len,
- struct in6_addr address,
- struct in6_addr gateway ) {
+ static struct ipv6_miniroute * __malloc
+ add_ipv6_miniroute ( struct net_device *netdev, struct in6_addr prefix,
+ int prefix_len, struct in6_addr address,
+ struct in6_addr gateway ) {
struct ipv6_miniroute *miniroute;
miniroute = malloc ( sizeof ( *miniroute ) );