These are used extensively in the ethernet code for example:
// Copyright (c) 2011, XMOS Ltd., All rights reserved
// This software is freely distributable under a derivative of the
// University of Illinois/NCSA Open Source License posted in
// LICENSE.txt and at <http://github.xcore.com/>
#ifndef __mii_filter_h__
#define __mii_filter_h__
#include "mii_full.h"
#include "mii_queue.h"
#include "mii_malloc.h"
//! This define is the last bit in the filter bitfield, and is set when the
//! system has to forward the packet to the other ethernet ports
#define MII_FILTER_FORWARD_TO_OTHER_PORTS (0x80000000)
void ethernet_filter(const char mac[], streaming chanend c[NUM_ETHERNET_PORTS]);
#if ETHERNET_COUNT_PACKETS
void ethernet_get_filter_counts(REFERENCE_PARAM(unsigned,address),
REFERENCE_PARAM(unsigned,filter),
REFERENCE_PARAM(unsigned,length),
REFERENCE_PARAM(unsigned,crc));
#endif
#endif // __mii_filter_h__
What is a REFERENCE_PARAM?
-
- XCore Addict
- Posts: 204
- Joined: Sun Jun 01, 2014 10:25 pm
-
- Respected Member
- Posts: 318
- Joined: Tue Dec 15, 2009 12:46 am
REFERENCE_PARAM is a macro in the header xccompat.h. Taking REFERENCE_PARAM(unsigned,filter) as an example, this will expand to:
in xC and in C.
The reason for the macro is to make it easier to write function prototypes in header files that can be called from both C and xC.
Code: Select all
unsigned &filter
Code: Select all
unsigned *filter
The reason for the macro is to make it easier to write function prototypes in header files that can be called from both C and xC.