From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: module as seperate crate References: From: Finn Behrens Message-ID: Date: Sun, 29 Nov 2020 18:54:43 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US To: Miguel Ojeda Cc: rust-for-linux@vger.kernel.org List-ID: Oh, I see the problem. Ok, will try some more on how to create a mutex value. I'm currently trying to implement pr_*. As we cannot define stuff easily, I would create a set_pr_fmt macro, which stores some fmt info globaly. This is where I would like to use a mutex. Finn On 11/29/20 6:51 PM, Miguel Ojeda wrote: > On Sun, Nov 29, 2020 at 6:38 PM Finn Behrens wrote: >> What is the reason for module being an extra crate? I would have to run >> some generic setup code for kernel/printk, but as the module macro being >> from an extra crate, I cannot easily run some code there. Should we >> maybe move module into the kernel crate, to make this easier? > It is because it is a proc macro. Otherwise, if Rust supported proc > macros in the same crate, we could do it, yeah. > > Cheers, > Miguel