From: Alvaro Lopes <alvieboy@alvie.com>
To: Maciej Soltysiak <solt@dns.toxicfilms.tv>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [STUPID] Best looking code to transfer to a t-shirt
Date: Fri, 03 Jan 2003 16:33:28 +0000 [thread overview]
Message-ID: <3E15BB58.9020900@alvie.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0301031419560.11311-100000@dns.toxicfilms.tv>
Maciej Soltysiak wrote:
>Hi,
>
>I am in a t-shirt transfering frenzy and was wondering which part of the
>kernel code it would be best to have on my t-shirt.
>I was looking at my favourite: netfilter code, but it is to clean, short
>and simple functions, no tons of pointers, no mallocs, no hex numbers, too
>many defines used. I was looking for something terribly complicated and
>looking awesome to the eye.
>
>
arch/i386/mm/fault.c
/*
* Synchronize this task's top level page-table
* with the 'reference' page table.
*
* Do _not_ use "tsk" here. We might be inside
* an interrupt in the middle of a task switch..
*/
int offset = __pgd_offset(address);
pgd_t *pgd, *pgd_k;
pmd_t *pmd, *pmd_k;
pte_t *pte_k;
asm("movl %%cr3,%0":"=r" (pgd));
pgd = offset + (pgd_t *)__va(pgd);
pgd_k = init_mm.pgd + offset;
if (!pgd_present(*pgd_k))
goto no_context;
set_pgd(pgd, *pgd_k);
pmd = pmd_offset(pgd, address);
pmd_k = pmd_offset(pgd_k, address);
if (!pmd_present(*pmd_k))
goto no_context;
set_pmd(pmd, *pmd_k);
pte_k = pte_offset_kernel(pmd_k, address);
if (!pte_present(*pte_k))
goto no_context;
return;
}
--
Álvaro Lopes
---------------------
A .sig is just a .sig
next prev parent reply other threads:[~2003-01-03 16:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-03 13:25 [STUPID] Best looking code to transfer to a t-shirt Maciej Soltysiak
2003-01-03 13:26 ` Jose Celestino
2003-01-03 14:55 ` Matthias Schniedermeyer
2003-01-03 15:03 ` Anders Gustafsson
2003-01-03 15:11 ` Tomas Szepe
2003-01-03 15:59 ` Disconnect
2003-01-03 16:32 ` Randy.Dunlap
2003-01-03 16:53 ` Arnaldo Carvalho de Melo
2003-01-03 16:33 ` Alvaro Lopes [this message]
2003-01-03 22:58 ` Rik van Riel
2003-01-03 23:39 ` William Lee Irwin III
2003-01-04 0:20 ` Ranjeet Shetye
2003-01-04 13:46 ` Maciej Soltysiak
2003-01-04 13:47 ` Maciej Soltysiak
2003-01-05 3:55 ` Randy.Dunlap
-- strict thread matches above, loose matches on Subject: below --
2003-01-03 14:53 uaca
2003-01-04 0:13 Nivedita Singhvi
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=3E15BB58.9020900@alvie.com \
--to=alvieboy@alvie.com \
--cc=linux-kernel@vger.kernel.org \
--cc=solt@dns.toxicfilms.tv \
/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