Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8978bfd2 authored by Guan Xuetao's avatar Guan Xuetao Committed by David Howells
Browse files

Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt]



Disintegrate asm/system.h for Unicore32. (Compilation successful)
The implementation details are not changed, but only splitted.
BTW, some codestyles are adjusted.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarGuan Xuetao <gxt@mprc.pku.edu.cn>
parent bd119c69
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -3,7 +3,6 @@ include include/asm-generic/Kbuild.asm
generic-y += atomic.h
generic-y += atomic.h
generic-y += auxvec.h
generic-y += auxvec.h
generic-y += bitsperlong.h
generic-y += bitsperlong.h
generic-y += bug.h
generic-y += bugs.h
generic-y += bugs.h
generic-y += cputime.h
generic-y += cputime.h
generic-y += current.h
generic-y += current.h
+28 −0
Original line number Original line Diff line number Diff line
/*
 * Memory barrier implementations for PKUnity SoC and UniCore ISA
 *
 * Copyright (C) 2001-2012 GUAN Xue-tao
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#ifndef __UNICORE_BARRIER_H__
#define __UNICORE_BARRIER_H__

#define isb() __asm__ __volatile__ ("" : : : "memory")
#define dsb() __asm__ __volatile__ ("" : : : "memory")
#define dmb() __asm__ __volatile__ ("" : : : "memory")

#define mb()				barrier()
#define rmb()				barrier()
#define wmb()				barrier()
#define smp_mb()			barrier()
#define smp_rmb()			barrier()
#define smp_wmb()			barrier()
#define read_barrier_depends()		do { } while (0)
#define smp_read_barrier_depends()	do { } while (0)

#define set_mb(var, value)		do { var = value; smp_mb(); } while (0)

#endif /* __UNICORE_BARRIER_H__ */
+27 −0
Original line number Original line Diff line number Diff line
/*
 * Bug handling for PKUnity SoC and UniCore ISA
 *
 * Copyright (C) 2001-2012 GUAN Xue-tao
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#ifndef __UNICORE_BUG_H__
#define __UNICORE_BUG_H__

#include <asm-generic/bug.h>

struct pt_regs;
struct siginfo;

extern void die(const char *msg, struct pt_regs *regs, int err);
extern void uc32_notify_die(const char *str, struct pt_regs *regs,
		struct siginfo *info, unsigned long err, unsigned long trap);

extern asmlinkage void __backtrace(void);
extern asmlinkage void c_backtrace(unsigned long fp, int pmode);

extern void __show_regs(struct pt_regs *);

#endif /* __UNICORE_BUG_H__ */
+61 −0
Original line number Original line Diff line number Diff line
/*
 * Atomics xchg/cmpxchg for PKUnity SoC and UniCore ISA
 *
 * Copyright (C) 2001-2012 GUAN Xue-tao
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#ifndef __UNICORE_CMPXCHG_H__
#define __UNICORE_CMPXCHG_H__

/*
 * Generate a link failure on undefined symbol if the pointer points to a value
 * of unsupported size.
 */
extern void __xchg_bad_pointer(void);

static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
		int size)
{
	unsigned long ret;

	switch (size) {
	case 1:
		asm volatile("swapb	%0, %1, [%2]"
			: "=&r" (ret)
			: "r" (x), "r" (ptr)
			: "memory", "cc");
		break;
	case 4:
		asm volatile("swapw	%0, %1, [%2]"
			: "=&r" (ret)
			: "r" (x), "r" (ptr)
			: "memory", "cc");
		break;
	default:
		ret = __xchg_bad_pointer();
	}

	return ret;
}

#define xchg(ptr, x) \
	((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))

#include <asm-generic/cmpxchg-local.h>

/*
 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
 * them available.
 */
#define cmpxchg_local(ptr, o, n)					\
		((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr),	\
		(unsigned long)(o), (unsigned long)(n), sizeof(*(ptr))))
#define cmpxchg64_local(ptr, o, n)					\
		__cmpxchg64_local_generic((ptr), (o), (n))

#include <asm-generic/cmpxchg.h>

#endif /* __UNICORE_CMPXCHG_H__ */
+15 −0
Original line number Original line Diff line number Diff line
/*
 * Process execution bits for PKUnity SoC and UniCore ISA
 *
 * Copyright (C) 2001-2012 GUAN Xue-tao
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#ifndef __UNICORE_EXEC_H__
#define __UNICORE_EXEC_H__

#define arch_align_stack(x)		(x)

#endif /* __UNICORE_EXEC_H__ */
Loading