a1200   NEWS   APPS   DOCS   ABOUT
a1200
----
a1200
----
Autodocs
 Resources:
 misc.resource
  AllocMiscResource
  FreeMiscResource
Include
GuruMeditation
Docs » Autodocs » misc.resource » AllocMiscResource

NAME

	AllocMiscResource - allocate one of the miscelaneous resources

SYNOPSIS

	CurrentUser = AllocMiscResource( unitNum, name )
D0 D0 A1
char * AllocMiscResource(ULONG,char *);

FUNCTION

	This routine attempts to allocate one of the miscellaneous resources
If the resource had already been allocated, an error is returned. If
you do get it, your name is associated with the resource (so a user
can see who has it allocated).
This function may not be called from interrupt code

DESCRIPTION

	There are certain parts of the hardware that a multitasking- friendly
program may need to take over. The serial port is a good example. By
grabbing the misc.resource for the serial port, the caller would
"own" the hardware registers associated with that function. Nobody
else, including the system serial driver, is allowed to interfere.
Resources are called in exactly the same manner as libraries.
From assembly language, A6 must equal the resource base. The
offsets for the function are listed in the resources/misc.i
include file (MR_ALLOCMISCRESOURCE for this function).

INPUTS

	unitNum - the number of the resource you want to allocate
(eg. MR_SERIALBITS).
name - a mnenonic name that will help the user figure out
what piece of software is hogging a resource.
(havoc breaks out if a name of null is passed in...)

RESULT

	CurrentUser - if the resource is busy, then the name of
the current user is returned. If the resource is
free, then null is returned.

BUGS

SEE ALSO

"resources/misc.i", FreeMiscResource()

Comments

Name:
E-mail: Use this if you want a message if you get a response, will not be shown.
Comment:
Select correct short for:

Anarchy

AOA
TBL
RBS
ANA

Comments:

$VER: d0.se 1.14 Copyright © 2011-2024 Tobias Geijersson support at d0 dot se