arch/s390/include/asm/processor.h

Source file repositories/reference/linux-study-clean/arch/s390/include/asm/processor.h

File Facts

System
Linux kernel
Corpus path
arch/s390/include/asm/processor.h
Extension
.h
Size
11063 bytes
Lines
422
Domain
Architecture Layer
Bucket
arch/s390
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

struct pcpu {
	unsigned long ec_mask;		/* bit mask for ec_xxx functions */
	unsigned long ec_clk;		/* sigp timestamp for ec_xxx */
	unsigned long flags;		/* per CPU flags */
	unsigned long capacity;		/* cpu capacity for scheduler */
	signed char state;		/* physical cpu state */
	signed char polarization;	/* physical polarization */
	u16 address;			/* physical cpu address */
};

DECLARE_PER_CPU(struct pcpu, pcpu_devices);

typedef long (*sys_call_ptr_t)(struct pt_regs *regs);

static __always_inline struct pcpu *this_pcpu(void)
{
	return (struct pcpu *)(get_lowcore()->pcpu);
}

static __always_inline void set_cpu_flag(int flag)
{
	set_bit(flag, &this_pcpu()->flags);
}

static __always_inline void clear_cpu_flag(int flag)
{
	clear_bit(flag, &this_pcpu()->flags);
}

static __always_inline bool test_cpu_flag(int flag)
{
	return test_bit(flag, &this_pcpu()->flags);
}

static __always_inline bool test_and_set_cpu_flag(int flag)
{
	return test_and_set_bit(flag, &this_pcpu()->flags);
}

static __always_inline bool test_and_clear_cpu_flag(int flag)
{
	return test_and_clear_bit(flag, &this_pcpu()->flags);
}

/*
 * Test CIF flag of another CPU. The caller needs to ensure that
 * CPU hotplug can not happen, e.g. by disabling preemption.
 */
static __always_inline bool test_cpu_flag_of(int flag, int cpu)
{
	return test_bit(flag, &per_cpu(pcpu_devices, cpu).flags);
}

#define arch_needs_cpu() test_cpu_flag(CIF_NOHZ_DELAY)

static inline void get_cpu_id(struct cpuid *ptr)
{
	asm volatile("stidp %0" : "=Q" (*ptr));
}

static __always_inline unsigned long get_cpu_timer(void)
{
	unsigned long timer;

	asm volatile("stpt	%[timer]" : [timer] "=Q" (timer));
	return timer;
}

void s390_adjust_jiffies(void);
void s390_update_cpu_mhz(void);
void cpu_detect_mhz_feature(void);

extern const struct seq_operations cpuinfo_op;
extern void execve_tail(void);
unsigned long vdso_text_size(void);
unsigned long vdso_size(void);

#define TASK_SIZE		(TASK_SIZE_MAX)
#define TASK_UNMAPPED_BASE	(_REGION2_SIZE >> 1)
#define TASK_SIZE_MAX		(-PAGE_SIZE)

#define VDSO_BASE		(STACK_TOP + PAGE_SIZE)
#define VDSO_LIMIT		(_REGION2_SIZE)
#define STACK_TOP		(VDSO_LIMIT - vdso_size() - PAGE_SIZE)
#define STACK_TOP_MAX		(_REGION2_SIZE - vdso_size() - PAGE_SIZE)

#define HAVE_ARCH_PICK_MMAP_LAYOUT

#define __stackleak_poison __stackleak_poison
static __always_inline void __stackleak_poison(unsigned long erase_low,

Annotation

Implementation Notes