forked from Mirrors/opensbi
		
	lib: Pack struct sbi_fifo
This patch reduces memory consumed by struct sbi_fifo by droping redundant "head" member and using u16 in-place of "unsigned long". Signed-off-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
		@@ -15,21 +15,18 @@
 | 
			
		||||
#include <sbi/sbi_types.h>
 | 
			
		||||
 | 
			
		||||
struct sbi_fifo {
 | 
			
		||||
	/* Static members of struct */
 | 
			
		||||
	void *queue;
 | 
			
		||||
	unsigned long entry_size;
 | 
			
		||||
	unsigned long num_entries;
 | 
			
		||||
	/* Dynamic members of struct protected by lock */
 | 
			
		||||
	spinlock_t qlock;
 | 
			
		||||
	unsigned long avail;
 | 
			
		||||
	unsigned long head;
 | 
			
		||||
	unsigned long tail;
 | 
			
		||||
	u16 entry_size;
 | 
			
		||||
	u16 num_entries;
 | 
			
		||||
	u16 avail;
 | 
			
		||||
	u16 tail;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
int sbi_fifo_dequeue(struct sbi_fifo *fifo, void *data);
 | 
			
		||||
int sbi_fifo_enqueue(struct sbi_fifo *fifo, void *data);
 | 
			
		||||
void sbi_fifo_init(struct sbi_fifo *fifo, void *queue_mem,
 | 
			
		||||
		   unsigned long entries, unsigned long entry_size);
 | 
			
		||||
		   u16 entries, u16 entry_size);
 | 
			
		||||
bool sbi_fifo_is_empty(struct sbi_fifo *fifo);
 | 
			
		||||
bool sbi_fifo_is_full(struct sbi_fifo *fifo);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user