Fix IO memory access .. SB128 driver makes noises in VMWare - CMI is untested (Curren...
[AROS.git] / rom / expansion / setcurrentbinding.c
blob74240f304bdfa8b41c7e061a57b8602869494c85
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include "expansion_intern.h"
9 #include <proto/exec.h>
11 /*****************************************************************************
13 NAME */
14 #include <clib/expansion_protos.h>
16 AROS_LH2(void, SetCurrentBinding,
18 /* SYNOPSIS */
19 AROS_LHA(struct CurrentBinding *, currentBinding, A0),
20 AROS_LHA(ULONG , bindingSize, D0),
22 /* LOCATION */
23 struct ExpansionBase *, ExpansionBase, 22, Expansion)
25 /* FUNCTION
26 This function will return the contents of the "currentBinding"
27 structure. The currentBinding structure may be returned with
28 GetConfigBinding(). This is how arguments are passed to a newly
29 configured device.
31 A CurrentBinding structure has the following information:
32 - the name of the currently loaded driver file
33 - the product string associated with this driver
34 - a singly linked list of ConfigDev structures
36 You may not need this information, but it is recommended that you
37 at least make sure you can deal with the product code in the
38 ConfigDev structure.
40 INPUTS
41 currentBinding - a pointer to the CurrentBinding structure that
42 you wish filled in.
43 bindingSize - the size of the currentBinding structure. Do
44 not pass less than sizeof(struct CurrentBinding).
46 RESULT
47 The size of the CurrentBinding structure set.
49 NOTES
51 EXAMPLE
53 BUGS
55 SEE ALSO
56 GetCurrentBinding()
58 INTERNALS
60 HISTORY
61 27-11-96 digulla automatically created from
62 expansion_lib.fd and clib/expansion_protos.h
64 *****************************************************************************/
66 AROS_LIBFUNC_INIT
68 ULONG size = bindingSize;
70 if( bindingSize > sizeof(struct CurrentBinding) )
71 size = sizeof(struct CurrentBinding);
73 CopyMem(currentBinding,
74 &IntExpBase(ExpansionBase)->eb_CurrentBinding,
75 size);
77 /* NULL pad the rest */
78 while(size < sizeof(struct CurrentBinding))
79 ((UBYTE *)&IntExpBase(ExpansionBase)->eb_CurrentBinding)[size++] = 0;
81 AROS_LIBFUNC_EXIT
82 } /* SetCurrentBinding */