[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IO-Flexpage support added

From: Matthieu Lemerre
Subject: IO-Flexpage support added
Date: Sat, 02 Jul 2005 18:39:30 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)


This patch adds IO-Flexpages support to the Hurd.  For those who don't
know, IO-Flexpage is the way to give to tasks access to IO-ports on
IA32 and AMD64 machines, and works like Flexpage (with limitations).
It is part of L4 X.2 spec and was implemented recently in pistachio

This patch makes wortel request a IOFpage containing all IO ports from
sigma0, and makes deva ask it back from wortel.  Future device drivers
(and regular applications?) will then receive specific io ports from
deva when they ask for it.

One little thing was missing from sigma0 to get it working; I sent a
patch that hopefully the L4ka team will integrate (or a better one).
I attach it for those who would want to try.

I added support for both IO-Flexpage and no IO-Flexpage in the kernel
at first, and I had to factorize wortel/sigma0.c a little.  Then
Marcus told me we should simply drop support for kernel without
IO-Flexpages support, but I kept the factorization anyway.  I think
it's pretty harmless.



2005-07-02  Matthieu Lemerre  <address@hidden>

        * deva.c (get_io_fpages): New function.
        (main): Calls get_io_fpages.

2005-07-02  Matthieu Lemerre  <address@hidden>

        * ia32/l4/bits/space.h (__L4_io_fpage_t): _two's size is 6 bit,
        not 2.

2005-07-02  Matthieu Lemerre  <address@hidden>

        * wortel.h (WORTEL_MSG_GET_IO): New macro.
        (wortel_get_io): New RPC client stub.

        * wortel.c (wortel_io_fpages): New global.
        (wortel_io_fpages_count): Likewise.
        (serve_bootstrap_requests): Handle WORTEL_MSG_GET_IO RPC.
        (main): Calls get_io_fpages.

        * wortel-intern.h (MAX_IO_FPAGES): New macro.
        (wortel_io_fpages): New declaration.
        (wortel_io_fpages_count): Likewise.
        (get_io_fpages): Likewise.

        * sigma0.h: (sigma0_get_io_fpage): New declaration.

        * sigma0.c: Includes assert.h
        (sigma0_try_get_fpage): New function.
        (sigma0_get_fpage): Now calls sigma0_try_get_fpage.
        (sigma0_get_any): Likewise.
        (sigma0_get_io_fpage): New function.


Attachment: patch
Description: Binary data

/* Main function for root server.
   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
   This file is part of the GNU Hurd.

   The GNU Hurd is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU Hurd is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

#include <config.h>

#include <l4.h>
#include "wortel-intern.h"
#include "sigma0.h"

/* Get IO Fpages on architectures which support it.  Do this before
   any in/out operation, such as output.  */
void get_io_fpages ()
  /* We must do this as our first operation, else we would generate an
     IO pagefault to sigma0 on the first in/out operation and loose
     count of iofpages we requested.  */

  l4_fpage_t fpage;

  /* There is only one IO page to retrieve.  */
  fpage = l4_io_fpage_log2 (0, 16);
  fpage = sigma0_get_io_fpage (fpage);

  if (l4_is_nil_fpage (fpage))
    panic ("You must have IO-Flexpage support in the kernel and sigma0\n");
  wortel_io_fpages[wortel_io_fpages_count++] = fpage;

Attachment: sigma0-patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]