1 /* system / environment specific defines */
3 //#define LIBRFID_FIRMWARE
7 #ifndef LIBRFID_FIRMWARE
8 /* If we're not doing a firmware compile, then we just use the regular
9 * malloc()/free() functions as expected */
11 #define malloc_asic_handle(x) malloc(x)
12 #define free_asic_handle(x) free(x)
14 #define malloc_layer2_handle(x) malloc(x)
15 #define free_layer2_handle(x) free(x)
17 #define malloc_protocol_handle(x) malloc(x)
18 #define free_protocol_handle(x) free(x)
20 #define malloc_rat_handle(x) malloc(x)
21 #define free_rat_handle(x) free(x)
23 #define malloc_reader_handle(x) malloc(x)
24 #define free_reader_handle(x) free(x)
27 /* If we're actually doing a firmware compile, then we use pre-allocated
28 * handles in order to avoid dynamic memory allocation. */
30 #define EMPTY_STATEMENT do {} while(0)
31 extern struct rfid_asic_handle rfid_ah;
32 #define malloc_asic_handle(x) &rfid_ah
33 #define free_asic_handle(x) EMPTY_STATEMENT
35 extern struct rfid_layer2_handle rfid_l2h;
36 #define malloc_layer2_handle(x) &rfid_l2h
37 #define free_layer2_handle(x) EMPTY_STATEMENT
39 extern struct rfid_protocol_handle rfid_ph;
40 #define malloc_protocol_handle(x) &rfid_ph
41 #define free_protocol_handle(x) EMPTY_STATEMENT
43 extern struct rfid_asic_transport_handle rfid_ath;
44 #define malloc_rat_handle(x) &rfid_ath
45 #define free_rat_handle(x) EMPTY_STATEMENT
47 extern struct rfid_reader_handle rfid_rh;
48 #define malloc_reader_handle(x) &rfid_rh
49 #define free_reader_handle(x) EMPTY_STATEMENT
51 #endif /* LIBRFID_FIRMWARE */
53 #endif /* __LIBRFID__ */