aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ics.h
blob: f19534f66ef40d287fbd309540c8a1ddea5f1f81 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef _LINUX_ICS_H_
#define _LINUX_ICS_H_

#include <asm/atomic.h>
#include <linux/mutex.h>

#define MAX_ICS_NESTING 16

struct ics_descriptor {
	/* ICS id, only read by kernel */
	int 	id;
	/* rollback program counter, only read by kernel */
	void* 	pc; 
	/* rollback stack pointer, not used by kernel */
	void*	 sp;
	/* retry flag, not used by kernel */
	int* 	retry;
};

/* ICS control block */
struct ics_cb {
	/* Points to the top-most valid entry.
	 * -1 indicates an empty stack.
	 * Read and written by kernel.
	 */
	int			top;	
	struct ics_descriptor	ics_stack[MAX_ICS_NESTING];
};

/* get rollback addr for current task */
void* get_rollback_addr(void);

#define ICS_DBG(x, args...) printk(x, ## args)

#endif