Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / identify / idhardwareupdate.c
blob4168cd05f5b061800569429d2c97f2a65424d422
1 /*
2 * Copyright (c) 2010-2011 Matthias Rustler
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 * IN THE SOFTWARE.
22 * $Id$
25 #include <string.h>
27 #include "identify_intern.h"
29 /*****************************************************************************
31 NAME */
32 #include <proto/identify.h>
34 AROS_LH0(void, IdHardwareUpdate,
36 /* SYNOPSIS */
37 /* void */
39 /* LOCATION */
40 struct IdentifyBaseIntern *, IdentifyBase, 10, Identify)
42 /* FUNCTION
43 Once a hardware information has been evaluated, the result will be
44 stored in an internal cache. All subsequent queries return the cache
45 contents, irregarding of any changes.
47 This function invalidates the cache and forces identify to re-check
48 ALL hardware features. Useful if e.g. the amount of memory has changed
49 after VMM has been started.
51 Use this function wisely. DO NOT call it just to make sure to get the
52 latest information, let the user decide to do so. Also, DO NOT call
53 it when you will only query hardware information that will for sure
54 not change while run-time, e.g. CPU.
56 IDHW_VBR, IDHW_LASTALERT and IDHW_TCPIP are NOT cached, so there is
57 absolutely no need to call IdHardwareUpdate() just to check them out.
59 INPUTS
61 RESULT
63 NOTES
65 EXAMPLE
67 BUGS
68 Calling this function in identify V8.0 will lead to a system crash.
69 This has been fixed in V8.1.
71 SEE ALSO
72 IdHardware(), IdHardwareNum()
74 INTERNALS
76 HISTORY
79 *****************************************************************************/
81 AROS_LIBFUNC_INIT
83 ObtainSemaphore(&IdentifyBase->sem);
85 IdentifyBase->dirtyflag = TRUE;
86 memset(&IdentifyBase->hwb, 0, sizeof IdentifyBase->hwb);
88 ReleaseSemaphore(&IdentifyBase->sem);
90 AROS_LIBFUNC_EXIT
91 } /* IdHardwareUpdate */