Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Nov 1997 13:41:32 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Mike Smith <mike@smith.net.au>
Cc:        freebsd-mobile@FreeBSD.ORG
Subject:   Re: Libretto 50 - US Version and PAO 
Message-ID:  <478.878820092@critter.freebsd.dk>
In-Reply-To: Your message of "Thu, 06 Nov 1997 17:59:20 %2B1030." <199711060729.RAA01727@word.smith.net.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <199711060729.RAA01727@word.smith.net.au>, Mike Smith writes:
>> In message <199711060121.LAA00464@word.smith.net.au>, Mike Smith writes:
>> 
>> >One thing I was wondering; does
>> >
>> >pnp_func(u_int16_t a, u_int16_b)
>> >
>> >construct the stack properly, or will we still get int-sized objects on 
>> >the stack?
>> 
>> You still get 32bit stuff on the stack.  C promotes them.
>
>As Shakespeare would have said, "Puck".
>
>Alright, let's try something even more ugly.
>
>/* 
> * pnpcall(int dseg, int coffs, int cseg,
> *	   int retoffs, int retseg, u_int_16 stack[PNP_MAXSTACK])
> * pass (retoffs) and (retseg) in as junk.
> */
>ENTRY(pnpcall)
>	movl	%cs,%di
>	movl	%di,(5*4)(%esp)
>	movl	pnpret,(4*4)(%esp)
>	popl	%di
>	movl	%di,%ds
>	lret
>pnpret:		/* fossick return value etc. */
>
>About all I can see here is that we don't save any registers across
>the call, which might be Bad.
>
>Comments?

Uhm, the "popl %di" comes from the wrong stack, right ?

--
Poul-Henning Kamp             FreeBSD coreteam member
phk@FreeBSD.ORG               "Real hackers run -current on their laptop."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?478.878820092>