[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACoURw540BQgs4457uEtkGf41-uLbbubGBP23qnvT4W-MNJqOQ@mail.gmail.com>
Date: Sun, 25 Sep 2011 07:40:18 -0600
From: Shane McDonald <mcdonald.shane@...il.com>
To: wu zhangjin <wuzhangjin@...il.com>
Cc: keguang.zhang@...il.com, linux-mips@...ux-mips.org,
linux-kernel@...r.kernel.org, ralf@...ux-mips.org,
r0bertz@...too.org, chenj@...ote.com
Subject: Re: [PATCH 1/2] MIPS: Add basic support for Loongson1B (UPDATED)
>> diff --git a/arch/mips/include/asm/mach-loongson1/regs-clk.h b/arch/mips/include/asm/mach-loongson1/regs-clk.h
>> new file mode 100644
>> index 0000000..7a09d6a
>> --- /dev/null
>> +++ b/arch/mips/include/asm/mach-loongson1/regs-clk.h
>> @@ -0,0 +1,32 @@
>> +/*
>> + * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@...il.com>
>> + *
>> + * Loongson1 Clock Register Definitions.
>> + *
>> + * This program is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU General Public License as published by the
>> + * Free Software Foundation; either version 2 of the License, or (at your
>> + * option) any later version.
>> + */
>> +
>> +#ifndef __ASM_MACH_LOONGSON1_REGS_CLK_H
>> +#define __ASM_MACH_LOONGSON1_REGS_CLK_H
>> +
>> +#define LS1_CLK_REG(x) ((void __iomem *)(LOONGSON1_CLK_BASE + (x)))
>
> "volatile" keyword may be required for __iomem access, the same to the
> following similar usage.
>
> Considering a scene is(LS1_XXX_REG(X) doesn't really exist):
>
> LS1_XXX_REG(X) = 0; /* put cpu into idle and wait interrupt */
> LS1_XXX_REG(X) = 7; /* recover the cpu frequency to the highest */
>
> If no "volatile" keyword indicated, the above two lines will be
> intelligently but wrongly removed by compiler.
No -- please see Documentation/volatile-considered-harmful.txt,
particularly the paragraph starting at line 49. This macro
is only being used as an argument to __raw_readl,
as it should be.
Shane
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists