*BSD News Article 23130


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!usc!howland.reston.ans.net!spool.mu.edu!bloom-beacon.mit.edu!ai-lab!life.ai.mit.edu!mycroft
From: mycroft@duality.gnu.ai.mit.edu (Charles Hannum)
Newsgroups: comp.os.386bsd.questions
Subject: Re: [NetBSD] What is this in SYS.h?
Followup-To: comp.os.386bsd.questions
Date: 01 Nov 1993 15:23:12 GMT
Organization: MIT Artificial Intelligence Lab
Lines: 23
Message-ID: <MYCROFT.93Nov1102312@duality.gnu.ai.mit.edu>
References: <2avo6k$mlm@homer.cs.mcgill.ca> <4177@bigfoot.first.gmd.de>
NNTP-Posting-Host: duality.ai.mit.edu
In-reply-to: ats@g386bsd.first.gmd.de's message of 31 Oct 93 23:09:04 GMT

In article <4177@bigfoot.first.gmd.de> ats@g386bsd.first.gmd.de (Andreas Schulz) writes:

   In article <2avo6k$mlm@homer.cs.mcgill.ca>, Marc WANDSCHNEIDER
   <storm@cs.mcgill.ca> wrote:

      [...]

      #define SYSCALL(x)      2: jmp cerror; ENTRY(x); lea SYS_/**/x,%eax; LCALL(7,0); jb 2b
      /* gas fucks up offset -- although we don't currently need it, do for BCS */
      #define LCALL(x,y)      .byte 0x9a ; .long y; .word x

   [...]

   Don't ask me in the moment, what the "2: jmp cerror;" does.

Systems calls return with the carry bit set to indicate an error has
occured.

   I am not sure, if the 0x9a is a trap or a gate-call , [...]

It's an inter-segment (`long') call, to a selector which happens to be
a call gate to kernel privilege level.