Merge branch 'master'
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#ifndef _ALPHA_ATOMIC_H
|
||||
#define _ALPHA_ATOMIC_H
|
||||
|
||||
#include <asm/barrier.h>
|
||||
|
||||
/*
|
||||
* Atomic operations that C can't guarantee us. Useful for
|
||||
* resource counting etc...
|
||||
@@ -100,18 +102,19 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
|
||||
static __inline__ long atomic_add_return(int i, atomic_t * v)
|
||||
{
|
||||
long temp, result;
|
||||
smp_mb();
|
||||
__asm__ __volatile__(
|
||||
"1: ldl_l %0,%1\n"
|
||||
" addl %0,%3,%2\n"
|
||||
" addl %0,%3,%0\n"
|
||||
" stl_c %0,%1\n"
|
||||
" beq %0,2f\n"
|
||||
" mb\n"
|
||||
".subsection 2\n"
|
||||
"2: br 1b\n"
|
||||
".previous"
|
||||
:"=&r" (temp), "=m" (v->counter), "=&r" (result)
|
||||
:"Ir" (i), "m" (v->counter) : "memory");
|
||||
smp_mb();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -120,54 +123,57 @@ static __inline__ long atomic_add_return(int i, atomic_t * v)
|
||||
static __inline__ long atomic64_add_return(long i, atomic64_t * v)
|
||||
{
|
||||
long temp, result;
|
||||
smp_mb();
|
||||
__asm__ __volatile__(
|
||||
"1: ldq_l %0,%1\n"
|
||||
" addq %0,%3,%2\n"
|
||||
" addq %0,%3,%0\n"
|
||||
" stq_c %0,%1\n"
|
||||
" beq %0,2f\n"
|
||||
" mb\n"
|
||||
".subsection 2\n"
|
||||
"2: br 1b\n"
|
||||
".previous"
|
||||
:"=&r" (temp), "=m" (v->counter), "=&r" (result)
|
||||
:"Ir" (i), "m" (v->counter) : "memory");
|
||||
smp_mb();
|
||||
return result;
|
||||
}
|
||||
|
||||
static __inline__ long atomic_sub_return(int i, atomic_t * v)
|
||||
{
|
||||
long temp, result;
|
||||
smp_mb();
|
||||
__asm__ __volatile__(
|
||||
"1: ldl_l %0,%1\n"
|
||||
" subl %0,%3,%2\n"
|
||||
" subl %0,%3,%0\n"
|
||||
" stl_c %0,%1\n"
|
||||
" beq %0,2f\n"
|
||||
" mb\n"
|
||||
".subsection 2\n"
|
||||
"2: br 1b\n"
|
||||
".previous"
|
||||
:"=&r" (temp), "=m" (v->counter), "=&r" (result)
|
||||
:"Ir" (i), "m" (v->counter) : "memory");
|
||||
smp_mb();
|
||||
return result;
|
||||
}
|
||||
|
||||
static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
|
||||
{
|
||||
long temp, result;
|
||||
smp_mb();
|
||||
__asm__ __volatile__(
|
||||
"1: ldq_l %0,%1\n"
|
||||
" subq %0,%3,%2\n"
|
||||
" subq %0,%3,%0\n"
|
||||
" stq_c %0,%1\n"
|
||||
" beq %0,2f\n"
|
||||
" mb\n"
|
||||
".subsection 2\n"
|
||||
"2: br 1b\n"
|
||||
".previous"
|
||||
:"=&r" (temp), "=m" (v->counter), "=&r" (result)
|
||||
:"Ir" (i), "m" (v->counter) : "memory");
|
||||
smp_mb();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
34
include/asm-alpha/barrier.h
Normal file
34
include/asm-alpha/barrier.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef __BARRIER_H
|
||||
#define __BARRIER_H
|
||||
|
||||
#define mb() \
|
||||
__asm__ __volatile__("mb": : :"memory")
|
||||
|
||||
#define rmb() \
|
||||
__asm__ __volatile__("mb": : :"memory")
|
||||
|
||||
#define wmb() \
|
||||
__asm__ __volatile__("wmb": : :"memory")
|
||||
|
||||
#define read_barrier_depends() \
|
||||
__asm__ __volatile__("mb": : :"memory")
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define smp_mb() mb()
|
||||
#define smp_rmb() rmb()
|
||||
#define smp_wmb() wmb()
|
||||
#define smp_read_barrier_depends() read_barrier_depends()
|
||||
#else
|
||||
#define smp_mb() barrier()
|
||||
#define smp_rmb() barrier()
|
||||
#define smp_wmb() barrier()
|
||||
#define smp_read_barrier_depends() barrier()
|
||||
#endif
|
||||
|
||||
#define set_mb(var, value) \
|
||||
do { var = value; mb(); } while (0)
|
||||
|
||||
#define set_wmb(var, value) \
|
||||
do { var = value; wmb(); } while (0)
|
||||
|
||||
#endif /* __BARRIER_H */
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <linux/config.h>
|
||||
#include <asm/pal.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/barrier.h>
|
||||
|
||||
/*
|
||||
* System defines.. Note that this is included both from .c and .S
|
||||
@@ -139,36 +140,6 @@ extern void halt(void) __attribute__((noreturn));
|
||||
struct task_struct;
|
||||
extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*);
|
||||
|
||||
#define mb() \
|
||||
__asm__ __volatile__("mb": : :"memory")
|
||||
|
||||
#define rmb() \
|
||||
__asm__ __volatile__("mb": : :"memory")
|
||||
|
||||
#define wmb() \
|
||||
__asm__ __volatile__("wmb": : :"memory")
|
||||
|
||||
#define read_barrier_depends() \
|
||||
__asm__ __volatile__("mb": : :"memory")
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define smp_mb() mb()
|
||||
#define smp_rmb() rmb()
|
||||
#define smp_wmb() wmb()
|
||||
#define smp_read_barrier_depends() read_barrier_depends()
|
||||
#else
|
||||
#define smp_mb() barrier()
|
||||
#define smp_rmb() barrier()
|
||||
#define smp_wmb() barrier()
|
||||
#define smp_read_barrier_depends() barrier()
|
||||
#endif
|
||||
|
||||
#define set_mb(var, value) \
|
||||
do { var = value; mb(); } while (0)
|
||||
|
||||
#define set_wmb(var, value) \
|
||||
do { var = value; wmb(); } while (0)
|
||||
|
||||
#define imb() \
|
||||
__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
|
||||
|
||||
|
||||
@@ -18,7 +18,9 @@
|
||||
* 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat)
|
||||
* 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA
|
||||
* 27-Aug-2005 Ben Dooks Add clock-slow info
|
||||
*/
|
||||
* 20-Oct-2005 Ben Dooks Fixed overflow in PLL (Guillaume Gourat)
|
||||
* 20-Oct-2005 Ben Dooks Add masks for DCLK (Guillaume Gourat)
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARM_REGS_CLOCK
|
||||
#define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $"
|
||||
@@ -66,11 +68,16 @@
|
||||
#define S3C2410_DCLKCON_DCLK0_UCLK (1<<1)
|
||||
#define S3C2410_DCLKCON_DCLK0_DIV(x) (((x) - 1 )<<4)
|
||||
#define S3C2410_DCLKCON_DCLK0_CMP(x) (((x) - 1 )<<8)
|
||||
#define S3C2410_DCLKCON_DCLK0_DIV_MASK ((0xf)<<4)
|
||||
#define S3C2410_DCLKCON_DCLK0_CMP_MASK ((0xf)<<8)
|
||||
|
||||
#define S3C2410_DCLKCON_DCLK1EN (1<<16)
|
||||
#define S3C2410_DCLKCON_DCLK1_PCLK (0<<17)
|
||||
#define S3C2410_DCLKCON_DCLK1_UCLK (1<<17)
|
||||
#define S3C2410_DCLKCON_DCLK1_DIV(x) (((x) - 1) <<20)
|
||||
#define S3C2410_DCLKCON_DCLK1_CMP(x) (((x) - 1) <<24)
|
||||
#define S3C2410_DCLKCON_DCLK1_DIV_MASK ((0xf) <<20)
|
||||
#define S3C2410_DCLKCON_DCLK1_CMP_MASK ((0xf) <<24)
|
||||
|
||||
#define S3C2410_CLKDIVN_PDIVN (1<<0)
|
||||
#define S3C2410_CLKDIVN_HDIVN (1<<1)
|
||||
@@ -83,10 +90,13 @@
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <asm/div64.h>
|
||||
|
||||
static inline unsigned int
|
||||
s3c2410_get_pll(int pllval, int baseclk)
|
||||
s3c2410_get_pll(unsigned int pllval, unsigned int baseclk)
|
||||
{
|
||||
int mdiv, pdiv, sdiv;
|
||||
unsigned int mdiv, pdiv, sdiv;
|
||||
uint64_t fvco;
|
||||
|
||||
mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT;
|
||||
pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT;
|
||||
@@ -96,7 +106,10 @@ s3c2410_get_pll(int pllval, int baseclk)
|
||||
pdiv &= S3C2410_PLLCON_PDIVMASK;
|
||||
sdiv &= S3C2410_PLLCON_SDIVMASK;
|
||||
|
||||
return (baseclk * (mdiv + 8)) / ((pdiv + 2) << sdiv);
|
||||
fvco = (uint64_t)baseclk * (mdiv + 8);
|
||||
do_div(fvco, (pdiv + 2) << sdiv);
|
||||
|
||||
return (unsigned int)fvco;
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
@@ -25,6 +25,8 @@ int is_hugepage_mem_enough(size_t);
|
||||
unsigned long hugetlb_total_pages(void);
|
||||
struct page *alloc_huge_page(void);
|
||||
void free_huge_page(struct page *);
|
||||
int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
unsigned long address, int write_access);
|
||||
|
||||
extern unsigned long max_huge_pages;
|
||||
extern const unsigned long hugetlb_zero, hugetlb_infinity;
|
||||
@@ -99,6 +101,7 @@ static inline unsigned long hugetlb_total_pages(void)
|
||||
do { } while (0)
|
||||
#define alloc_huge_page() ({ NULL; })
|
||||
#define free_huge_page(p) ({ (void)(p); BUG(); })
|
||||
#define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; })
|
||||
|
||||
#ifndef HPAGE_MASK
|
||||
#define HPAGE_MASK 0 /* Keep the compiler happy */
|
||||
@@ -155,24 +158,11 @@ static inline void set_file_hugepages(struct file *file)
|
||||
{
|
||||
file->f_op = &hugetlbfs_file_operations;
|
||||
}
|
||||
|
||||
static inline int valid_hugetlb_file_off(struct vm_area_struct *vma,
|
||||
unsigned long address)
|
||||
{
|
||||
struct inode *inode = vma->vm_file->f_dentry->d_inode;
|
||||
loff_t file_off = address - vma->vm_start;
|
||||
|
||||
file_off += (vma->vm_pgoff << PAGE_SHIFT);
|
||||
|
||||
return (file_off < inode->i_size);
|
||||
}
|
||||
|
||||
#else /* !CONFIG_HUGETLBFS */
|
||||
|
||||
#define is_file_hugepages(file) 0
|
||||
#define set_file_hugepages(file) BUG()
|
||||
#define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS)
|
||||
#define valid_hugetlb_file_off(vma, address) 0
|
||||
|
||||
#endif /* !CONFIG_HUGETLBFS */
|
||||
|
||||
|
||||
@@ -75,4 +75,5 @@ int idr_pre_get(struct idr *idp, unsigned gfp_mask);
|
||||
int idr_get_new(struct idr *idp, void *ptr, int *id);
|
||||
int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
|
||||
void idr_remove(struct idr *idp, int id);
|
||||
void idr_destroy(struct idr *idp);
|
||||
void idr_init(struct idr *idp);
|
||||
|
||||
@@ -171,7 +171,7 @@ typedef struct {
|
||||
ax25_address calls[AX25_MAX_DIGIS];
|
||||
unsigned char repeated[AX25_MAX_DIGIS];
|
||||
unsigned char ndigi;
|
||||
char lastrepeat;
|
||||
signed char lastrepeat;
|
||||
} ax25_digi;
|
||||
|
||||
typedef struct ax25_route {
|
||||
|
||||
@@ -254,8 +254,10 @@ static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa)
|
||||
{
|
||||
if (skb->protocol == ntohs(ETH_P_802_2))
|
||||
memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN);
|
||||
else if (skb->protocol == ntohs(ETH_P_TR_802_2))
|
||||
else if (skb->protocol == ntohs(ETH_P_TR_802_2)) {
|
||||
memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN);
|
||||
*sa &= 0x7F;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user