Subversion Repositories HelenOS-historic

Rev

Rev 1780 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1780 Rev 1784
Line 24... Line 24...
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
27
 */
28
 
28
 
29
 /** @addtogroup genarch   
29
/** @addtogroup genarch
30
 * @{
30
 * @{
31
 */
31
 */
32
/** @file
32
/** @file
33
 */
33
 */
34
 
34
 
35
#ifndef __OFW_H__
35
#ifndef KERN_OFW_H_
36
#define __OFW_H__
36
#define KERN_OFW_H_
37
 
37
 
38
#include <arch/types.h>
38
#include <arch/types.h>
39
 
39
 
40
#define MAX_OFW_ARGS    10
40
#define MAX_OFW_ARGS    12
41
 
41
 
42
typedef unative_t ofw_arg_t;
42
typedef unative_t ofw_arg_t;
43
typedef int ihandle;
43
typedef unsigned int ihandle;
44
typedef int phandle;
44
typedef unsigned int phandle;
45
 
45
 
46
/** OpenFirmware command structure
46
/** OpenFirmware command structure
47
 *
47
 *
48
 */
48
 */
49
typedef struct {
49
typedef struct {
50
    const char *service;          /**< Command name */
50
    const char *service;        /**< Command name */
51
    unative_t nargs;               /**< Number of in arguments */
51
    unative_t nargs;        /**< Number of in arguments */
52
    unative_t nret;                /**< Number of out arguments */
52
    unative_t nret;         /**< Number of out arguments */
53
    ofw_arg_t args[MAX_OFW_ARGS]; /**< List of arguments */
53
    ofw_arg_t args[MAX_OFW_ARGS];   /**< Buffer for in and out arguments */
54
} ofw_args_t;
54
} ofw_args_t;
55
 
55
 
56
typedef void (*ofw_entry)(ofw_args_t *);
56
extern int ofw(ofw_args_t *);       /**< OpenFirmware Client Interface entry point. */
57
 
-
 
58
extern ofw_entry ofw;
-
 
59
 
57
 
60
extern void ofw_init(void);
58
extern void ofw_init(void);
61
extern void ofw_done(void);
59
extern void ofw_done(void);
62
extern unative_t ofw_call(const char *service, const int nargs, const int nret, ...);
60
extern ofw_arg_t ofw_call(const char *service, const int nargs, const int nret, ofw_arg_t *rets, ...);
63
extern void ofw_putchar(const char ch);
61
extern void ofw_putchar(const char ch);
64
extern char ofw_getchar(void);
-
 
65
extern phandle ofw_find_device(const char *name);
62
extern phandle ofw_find_device(const char *name);
66
extern int ofw_get_property(const phandle device, const char *name, void *buf, const int buflen);
63
extern int ofw_get_property(const phandle device, const char *name, const void *buf, const int buflen);
-
 
64
extern void *ofw_translate(const void *addr);
67
extern void *ofw_claim(const void *addr, const int size, const int align);
65
extern void *ofw_claim(const void *addr, const int size, const int align);
68
 
66
 
69
#endif
67
#endif
70
 
68
 
71
 /** @}
69
/** @}
72
 */
70
 */
73
 
-