[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DE7832AA-27B1-4C06-A82C-5FA4EF7CF7E6@fb.com>
Date: Wed, 1 Feb 2023 00:37:33 +0000
From: Song Liu <songliubraving@...a.com>
To: Peter Zijlstra <peterz@...radead.org>
CC: Song Liu <song@...nel.org>,
"linux-modules@...r.kernel.org" <linux-modules@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Christoph Hellwig <hch@....de>,
Kernel Team <kernel-team@...a.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Guenter Roeck <linux@...ck-us.net>,
Christophe Leroy <christophe.leroy@...roup.eu>
Subject: Re: [PATCH v4] module: replace module_layout with module_memory
Thanks to all for these feedbacks. I will fix the code and send v5.
> On Jan 31, 2023, at 3:14 AM, Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Mon, Jan 30, 2023 at 10:21:09AM -0800, Song Liu wrote:
>> +#define for_each_mod_mem_type(type) \
>> + for ((type) = MOD_TEXT; \
>> + (type) < MOD_MEM_NUM_TYPES; (type)++)
>>
>> +#define for_core_mod_mem_type(type) \
>> + for ((type) = MOD_TEXT; \
>> + (type) < MOD_INIT_TEXT; (type)++)
>> +
>> +#define for_init_mod_mem_type(type) \
>> + for ((type) = MOD_INIT_TEXT; \
>> + (type) < MOD_MEM_NUM_TYPES; (type)++)
>
> #define __for_each_mod_mem_types(type, _from, _to) \
> for (enum mod_mem_type type = _from; type <= _to; type++;)
>
> also to be used in the previously suggested within_module_mem_types()
> function.
>
> also note the C99 variable in for-loop decl thing
Aha, I didn't realize we started using C99 for-loop decl.
Thanks,
Song
>
> #define for_code_mod_mem_type(type) \
> __for_each_mod_mem_types(type, MOD_TEXT, MOD_RO_AFTER_INIT)
>
> #define for_code_mod_mem_type(type) \
> __for_each_mod_mem_types(type, MOD_INIT_TEXT, MOD_INIT_RODATA)
>
>
>
Powered by blists - more mailing lists