Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Mike Shaver <shaver@netscape.com>
To: hppa-linux@thepuffingroup.com
Subject: [hppa-linux] syscall work
Date: Thu, 25 Mar 1999 12:33:15 -0500	[thread overview]
Message-ID: <36FA735B.A36FDB6D@netscape.com> (raw)

[-- 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);                                                     \
}

             reply	other threads:[~1999-03-25  4:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-25 17:33 Mike Shaver [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-03-25 19:23 [hppa-linux] syscall work Cary Coutant
1999-03-25 20:12 ` Mike Shaver
1999-03-25 23:05 ` 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 23:40 Bjorn Helgaas
1999-03-26  0:42 ` Alan Cox
1999-03-29 21:50 Stan Sieler
     [not found] <199903292146.NAA28577@bart.allegro.com>
1999-03-29 21:55 ` Michael Shalayeff

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=36FA735B.A36FDB6D@netscape.com \
    --to=shaver@netscape.com \
    --cc=hppa-linux@thepuffingroup.com \
    /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