# include/compiler/sparse.h File Reference

Compiler abstraction layer: sparse specifics. More...

`#include <compiler/gcc.h>`

Include dependency graph for sparse.h:

Go to the source code of this file.

## Defines
#define | __bitwise __attribute__((bitwise))
| Make a type incompatible with all other types.
#define | __virtual
| Mark a pointer as virtual.
#define | __physical __attribute__((noderef, address_space(1)))
| Mark a pointer as physical.
#define | __force __attribute__((force))
| Force a type cast.

## Detailed Description

Compiler abstraction layer: sparse specifics.

- Compiler: IAR EWAVR32 and GNU GCC for AVR32
- Supported devices: All devices
- AppNote:

Author:
  Atmel Corporation: http://www.atmel.com
  Support and FAQ: http://support.atmel.no/

Definition in file sparse.h.

## Define Documentation

#define __bitwise __attribute__((bitwise))

Make a type incompatible with all other types.

This is a sparse attribute which has no effect on other compilers. Declaring a type as __bitwise will cause sparse to complain if it is implicitly or explicitly cast to a different type. This is useful when dealing with foreign-endian types, for example, since it is always a bug if they are accessed without proper byte swapping.

Definition at line 57 of file sparse.h.

#define __force __attribute__((force))

Force a type cast.

This modifier can be used to silence any warnings from sparse with regards to casting of bitwise types or casting from one address space to another. This is typically used by the functions that provides the mappings between those types, e.g. byte swapping functions.

Definition at line 83 of file sparse.h.

#define __physical __attribute__((noderef, address_space(1)))

Mark a pointer as physical.

A pointer marked with this annotation cannot be dereferenced since it belongs to an address space which cannot be accessed directly on all platforms. It must be mapped to a virtual address by calling an appropriate mapping function.

Definition at line 73 of file sparse.h.

#define __virtual

Mark a pointer as virtual.

This annotation does nothing on any compiler, since the virtual address space is the default one.

Definition at line 64 of file sparse.h.