From: rmeenaks@olf.com
Newsgroups: comp.sys.transputer
Subject: Re: HELP: ProcToHigh() and ProcToLow()
Date: Tue, 27 Apr 1999 18:06:24 GMT
Organization: Deja News - The Leader in Internet Discussion
Message-Id: <7g4uas$6ga$1@nnrp1.dejanews.com>
References: <3724A9CF.48EB@-SPAM-netscape.net>
Xref: ukc comp.sys.transputer:9132


In article <3724A9CF.48EB@-SPAM-netscape.net>,
  ImoiJeEu <ImoiJeEu@-SPAM-netscape.net> wrote:
> Dear Transputer Die Hard
>
> I'm trying to find a way of implementing two functions: ProcToHigh(void)
> and ProcToLow(void) which would switch a process' priority on the fly.
> ProcToHigh would change it to High priority and ProcToLow() back to Low.
>
> Any ideas? I'm using the SGS-Thomson D7141a.
>

Hi Nuno,

Here are assembly versions of ProcToHigh and ProcToLow.  It returns the
previous priority to you.

ProcToLow:
	ldpri
	cj	@highprocess
	ldc	1
	ret

highprocess:
	ldlp	0
	ldc	1
	or
	runp
	stopp
	ldc	0
	ret


ProcToHigh:
	ldpri
	eqc	0
	cj	@lowprocess
	ldc	0
	ret

lowprocess:
	ldlp	0
	runp
	stopp
	ldc	1
	ret

Hope this helps.  If you want to know the exact details of what is going on
let me know.  Also, I don;t know if you can use it exactly like this in
D7141a toolset.  Might need to change it a bit for its syntax on labels, etc.
 This assembly code is pretty much generic.

Cheers,

Ram


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

