Linux PARISC architecture development
 help / color / mirror / Atom feed
* Re: [hppa-linux] syscall work
@ 1999-03-29 21:50 Stan Sieler
  0 siblings, 0 replies; 20+ messages in thread
From: Stan Sieler @ 1999-03-29 21:50 UTC (permalink / raw)
  To: hppa-linux

Hi,

> okie, but why emulating gate instruction, when there is already such
> instruction exist? (;

Simple: HP does this...there must be a reason.

They appear to do it on selected models of PA-RISC systems.  Why?  Don't know.

I can only conjecture...and the conjecture is the obvious one: there must be
some circumstance where GATE fails.  Otherwise, *why* replace it with
a slightly slower mechanism?

-- 
Stan Sieler                                          sieler@allegro.com
                                     http://www.allegro.com/sieler.html

^ permalink raw reply	[flat|nested] 20+ messages in thread
[parent not found: <199903292146.NAA28577@bart.allegro.com>]
* Re: [hppa-linux] syscall work
@ 1999-03-25 23:40 Bjorn Helgaas
  1999-03-26  0:42 ` Alan Cox
  0 siblings, 1 reply; 20+ messages in thread
From: Bjorn Helgaas @ 1999-03-25 23:40 UTC (permalink / raw)
  To: hppa-linux

>> I'd suggest *not* using the same gateway page address as HP-UX. If you 
>> do, you won't be able to develop a later kernel extension to support 
>> HP-UX binaries, unless you allocate syscall numbers carefully.
>
>Doesn't that depend which gateway page you map into each application ?

Here's one of the subtleties of PA-RISC VM.  Under HP-UX, there's only one
mapping (space 0, offset 0xC0000000) that is shared by all applications.
The libc stub branches to (%sr7,0xC0000000), and %sr7 always contains
a zero while running user apps.

Sharing a mapping between applications is a performance win, because
you can share the TLB entry and you can share the physical page without
worrying about any cache flushing issues.  Since PA-RISC has virtually-
indexed caches, you can only share physical pages under limited conditions
-- see appendix F in the 2.0 arch book.

Of course, you don't *have* to share those mappings, but you will
have more TLB misses and (unless you're careful about virtual address
allocation for aliasing) more cache flushing.

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [hppa-linux] syscall work
@ 1999-03-25 20:46 Bjorn Helgaas
  1999-03-25 21:07 ` Mike Shaver
  0 siblings, 1 reply; 20+ messages in thread
From: Bjorn Helgaas @ 1999-03-25 20:46 UTC (permalink / raw)
  To: hppa-linux

Cary Coutant wrote
>
>I'd suggest *not* using the same gateway page address as HP-UX. If you 
>do, you won't be able to develop a later kernel extension to support 
>HP-UX binaries, unless you allocate syscall numbers carefully.

If Linux uses a different gateway page address than HP-UX (which I
think is a good idea), why not use a strategy like that used for
64-bit HP-UX apps, where the kernel supplies the address in a
register at application startup?

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [hppa-linux] syscall work
@ 1999-03-25 19:23 Cary Coutant
  1999-03-25 20:12 ` Mike Shaver
  1999-03-25 23:05 ` Alan Cox
  0 siblings, 2 replies; 20+ messages in thread
From: Cary Coutant @ 1999-03-25 19:23 UTC (permalink / raw)
  To: hppa-linux

I'd suggest *not* using the same gateway page address as HP-UX. If you 
do, you won't be able to develop a later kernel extension to support 
HP-UX binaries, unless you allocate syscall numbers carefully.


Cary Coutant
Hewlett-Packard Co.
Application Delivery Lab

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [hppa-linux] syscall work
@ 1999-03-25 17:33 Mike Shaver
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Shaver @ 1999-03-25 17:33 UTC (permalink / raw)
  To: hppa-linux

[-- Attachment #1: Type: text/plain, Size: 267 bytes --]

I've committed a mildly updated version of unistd.h, which contains the
magic _syscall<n> macros.  I'm sure I'm doing silly things, so you
should all point and laugh as approriate.

I've attached the relevant chunks for your easy mocking.

Mike

-- 
22863.99 20474.77

[-- Attachment #2: syscall.c --]
[-- Type: text/plain, Size: 2220 bytes --]


#define syscall_prolog                                                        \
    register long __res __asm__("%r22");                                      \
    register long __err __asm__("%r28");

#define syscall_epilog(type)                                                  \
if (__err == 0)                                                               \
        return (type) __res;                                                  \
errno = __res;                                                                \
return -1;

#define _syscall0(type,name)                                                  \
type name(void)                                                               \
{                                                                             \
    syscall_prolog;                                                           \
    __asm__ volatile ("ldil L%%0xC0000004,%%r1\n\t"                           \
                      "ble  R%%0xC0000004(%%sr7,%%r1)\n\t"                    \
                      "ldo  %2,%%r22"                                         \
                      : "=r" (__res), "=r" (__err)                            \
                      : "i" (__NR_##name));                                   \
    syscall_epilog(type);                                                     \
}

#define _syscall1(type,name,atype,a)                                          \
type name(atype a)                                                            \
{                                                                             \
    syscall_prolog;                                                           \
    __asm__ volatile ("ldo  %2,%%arg0\n\t"                                    \
                      "ldil L%%0xC0000004,%%r1\n\t"                           \
                      "ble  R%%0xC0000004(%%sr7,%%r1)\n\t"                    \
                      "ldo  %3,%%r22"                                         \
                      : "=r" (__res), "=r" (__err)                            \
                      : "i" (__NR_##name), "r" ((long)a));                    \
    syscall_epilog(type);                                                     \
}

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~1999-03-29 22:00 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-29 21:50 [hppa-linux] syscall work Stan Sieler
     [not found] <199903292146.NAA28577@bart.allegro.com>
1999-03-29 21:55 ` Michael Shalayeff
  -- strict thread matches above, loose matches on Subject: below --
1999-03-25 23:40 Bjorn Helgaas
1999-03-26  0:42 ` Alan Cox
1999-03-25 20:46 Bjorn Helgaas
1999-03-25 21:07 ` Mike Shaver
1999-03-25 21:27   ` Stan Sieler
1999-03-25 23:30   ` Bob Pflederer
1999-03-25 23:55     ` Mike Shaver
1999-03-26  5:01       ` Kumar
1999-03-29  4:08         ` Stan Sieler
1999-03-26 15:39       ` Michael Shalayeff
1999-03-26 11:12         ` Mike Shaver
1999-03-26 17:03           ` Michael Shalayeff
1999-03-29 21:27             ` Stan Sieler
1999-03-29 20:41               ` Michael Shalayeff
1999-03-25 19:23 Cary Coutant
1999-03-25 20:12 ` Mike Shaver
1999-03-25 23:05 ` Alan Cox
1999-03-25 17:33 Mike Shaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox