public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: Karim Yaghmour <karim@opersys.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Adeos <adeos-main@mail.freesoftware.fsf.org>,
	Philippe Gerum <rpm@xenomai.org>
Subject: Re: [PATCH] Adeos nanokernel for 2.5.38 1/2: no-arch code
Date: Mon, 23 Sep 2002 00:03:12 -0300	[thread overview]
Message-ID: <20020923030312.GM20520@conectiva.com.br> (raw)
In-Reply-To: <3D8E8371.D2070D87@opersys.com>

Em Sun, Sep 22, 2002 at 10:58:57PM -0400, Karim Yaghmour escreveu:
> diff -urpN linux-2.5.38/kernel/printk.c linux-2.5.38-adeos/kernel/printk.c
> --- linux-2.5.38/kernel/printk.c	Sun Sep 22 00:25:31 2002
> +++ linux-2.5.38-adeos/kernel/printk.c	Sun Sep 22 21:57:19 2002
> @@ -194,17 +194,33 @@ int do_syslog(int type, char * buf, int 
>  		if (error)
>  			goto out;
>  		i = 0;
> +#ifdef CONFIG_ADEOS
> +		ipipe_hw_spin_lock_disable(&logbuf_lock);
> +#else  /* !CONFIG_ADEOS */
>  		spin_lock_irq(&logbuf_lock);
> +#endif /* CONFIG_ADEOS */
>  		while ((log_start != log_end) && i < len) {
>  			c = LOG_BUF(log_start);
>  			log_start++;
> +#ifdef CONFIG_ADEOS
> +			ipipe_hw_spin_unlock_enable(&logbuf_lock);
> +#else  /* !CONFIG_ADEOS */
>  			spin_unlock_irq(&logbuf_lock);
> +#endif /* CONFIG_ADEOS */
>  			__put_user(c,buf);
>  			buf++;
>  			i++;
> +#ifdef CONFIG_ADEOS
> +			ipipe_hw_spin_lock_disable(&logbuf_lock);
> +#else  /* !CONFIG_ADEOS */
>  			spin_lock_irq(&logbuf_lock);
> +#endif /* CONFIG_ADEOS */
>  		}
> +#ifdef CONFIG_ADEOS
> +		ipipe_hw_spin_unlock_enable(&logbuf_lock);
> +#else  /* !CONFIG_ADEOS */
>  		spin_unlock_irq(&logbuf_lock);
> +#endif /* CONFIG_ADEOS */
>  		error = i;

Why this ifdef hell and not something like:

	lockbuf_lock();
	bla
	logbuf_unlock();

and have this defined in a header, say printk.h or whatever, with the
ifdefs?

- Arnaldo

  parent reply	other threads:[~2002-09-23  2:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-23  2:58 [PATCH] Adeos nanokernel for 2.5.38 1/2: no-arch code Karim Yaghmour
2002-09-22  4:59 ` Pavel Machek
2002-09-24 21:05   ` Karim Yaghmour
2002-09-24 21:33     ` [Adeos-main] " Jacob Gorm Hansen
2002-09-24 23:15       ` Karim Yaghmour
2002-09-24 22:06     ` Pavel Machek
2002-09-24 23:22       ` Karim Yaghmour
2002-09-25  8:17         ` Pavel Machek
2002-09-23  3:03 ` Arnaldo Carvalho de Melo [this message]
2002-09-23  3:09   ` Karim Yaghmour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020923030312.GM20520@conectiva.com.br \
    --to=acme@conectiva.com.br \
    --cc=adeos-main@mail.freesoftware.fsf.org \
    --cc=karim@opersys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpm@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox