/* SPDX-License-Identifier: GPL-2.0 */ /* * oplib.h: Describes the interface and available routines in the * Linux Prom library. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
#ifndef __SPARC_OPLIB_H #define __SPARC_OPLIB_H
#include <linux/compiler.h>
#include <asm/openprom.h>
/* The master romvec pointer... */ externstruct linux_romvec *romvec;
/* Enumeration to describe the prom major version we have detected. */ enum prom_major_version {
PROM_V0, /* Original sun4c V0 prom */
PROM_V2, /* sun4c and early sun4m V2 prom */
PROM_V3, /* sun4m and later, up to sun4d/sun4e machines V3 */
PROM_P1275, /* IEEE compliant ISA based Sun PROM, only sun4u */
};
/* Root node of the prom device tree, this stays constant after * initialization is complete.
*/ externint prom_root_node;
/* Pointer to prom structure containing the device tree traversal * and usage utility functions. Only prom-lib should use these, * users use the interface defined by the library only!
*/ externstruct linux_nodeops *prom_nodeops;
/* The functions... */
/* You must call prom_init() before using any of the library services, * preferably as early as possible. Pass it the romvec pointer.
*/ externvoid prom_init(struct linux_romvec *rom_ptr);
/* Boot argument acquisition, returns the boot command line string. */ externchar *prom_getbootargs(void);
/* Device utilities. */
/* Map and unmap devices in IO space at virtual addresses. Note that the * virtual address you pass is a request and the prom may put your mappings * somewhere else, so check your return value as that is where your new * mappings really are! * * Another note, these are only available on V2 or higher proms!
*/ externchar *prom_mapio(char *virt_hint, int io_space, unsignedint phys_addr, unsignedint num_bytes); externvoid prom_unmapio(char *virt_addr, unsignedint num_bytes);
/* Device operations. */
/* Open the device described by the passed string. Note, that the format * of the string is different on V0 vs. V2->higher proms. The caller must * know what he/she is doing! Returns the device descriptor, an int.
*/ externint prom_devopen(char *device_string);
/* Close a previously opened device described by the passed integer * descriptor.
*/ externint prom_devclose(int device_handle);
/* Do a seek operation on the device described by the passed integer * descriptor.
*/ externvoid prom_seek(int device_handle, unsignedint seek_hival, unsignedint seek_lowval);
/* Machine memory configuration routine. */
/* This function returns a V0 format memory descriptor table, it has three * entries. One for the total amount of physical ram on the machine, one * for the amount of physical ram available, and one describing the virtual * areas which are allocated by the prom. So, in a sense the physical * available is a calculation of the total physical minus the physical mapped * by the prom with virtual mappings. * * These lists are returned pre-sorted, this should make your life easier * since the prom itself is way too lazy to do such nice things.
*/ externstruct linux_mem_v0 *prom_meminfo(void);
/* Miscellaneous routines, don't really fit in any category per se. */
/* Reboot the machine with the command line passed. */ externvoid prom_reboot(char *boot_command);
/* Evaluate the forth string passed. */ externvoid prom_feval(char *forth_string);
/* Enter the prom, with possibility of continuation with the 'go' * command in newer proms.
*/ externvoid prom_cmdline(void);
/* Enter the prom, with no chance of continuation for the stand-alone * which calls this.
*/ externvoid prom_halt(void);
/* Set the PROM 'sync' callback function to the passed function pointer. * When the user gives the 'sync' command at the prom prompt while the * kernel is still active, the prom will call this routine. * * XXX The arguments are different on V0 vs. V2->higher proms, grrr! XXX
*/ typedefvoid (*sync_func_t)(void); externvoid prom_setsync(sync_func_t func_ptr);
/* Acquire the IDPROM of the root node in the prom device tree. This * gets passed a buffer where you would like it stuffed. The return value * is the format type of this idprom or 0xff on error.
*/ externunsignedchar prom_get_idprom(char *idp_buffer, int idpbuf_size);
/* Get the prom major version. */ externint prom_version(void);
/* Get the prom plugin revision. */ externint prom_getrev(void);
/* Get the prom firmware revision. */ externint prom_getprev(void);
/* Character operations to/from the console.... */
/* Non-blocking get character from console. */ externint prom_nbgetchar(void);
/* Non-blocking put character to console. */ externint prom_nbputchar(char character);
/* Blocking get character from console. */ externchar prom_getchar(void);
/* Blocking put character to console. */ externvoid prom_putchar(char character);
/* Prom's internal printf routine, don't use in kernel/boot code. */
__printf(1, 2) void prom_printf(char *fmt, ...);
/* Query for input device type */
enum prom_input_device {
PROMDEV_IKBD, /* input from keyboard */
PROMDEV_ITTYA, /* input from ttya */
PROMDEV_ITTYB, /* input from ttyb */
PROMDEV_I_UNK,
};
/* Start the CPU with the given device tree node, context table, and context * at the passed program counter.
*/ externint prom_startcpu(int cpunode, struct linux_prom_registers *context_table, int context, char *program_counter);
/* Stop the CPU with the passed device tree node. */ externint prom_stopcpu(int cpunode);
/* Idle the CPU with the passed device tree node. */ externint prom_idlecpu(int cpunode);
/* Re-Start the CPU with the passed device tree node. */ externint prom_restartcpu(int cpunode);
/* PROM memory allocation facilities... */
/* Allocated at possibly the given virtual address a chunk of the * indicated size.
*/ externchar *prom_alloc(char *virt_hint, unsignedint size);
/* Sun4/sun4c specific memory-management startup hook. */
/* Map the passed segment in the given context at the passed * virtual address.
*/ externvoid prom_putsegment(int context, unsignedlong virt_addr, int physical_segment);
/* PROM device tree traversal functions... */
/* Get the child node of the given node, or zero if no child exists. */ externint prom_getchild(int parent_node);
/* Get the next sibling node of the given node, or zero if no further * siblings exist.
*/ externint prom_getsibling(int node);
/* Get the length, at the passed node, of the given property type. * Returns -1 on error (ie. no such property at this node).
*/ externint prom_getproplen(int thisnode, char *property);
/* Fetch the requested property using the given buffer. Returns * the number of bytes the prom put into your buffer or -1 on error.
*/ externint prom_getproperty(int thisnode, char *property, char *prop_buffer, int propbuf_size);
/* Acquire a string property, null string on error. */ externvoid prom_getstring(int node, char *prop, char *buf, int bufsize);
/* Does the passed node have the given "name"? YES=1 NO=0 */ externint prom_nodematch(int thisnode, char *name);
/* Search all siblings starting at the passed node for "name" matching * the given string. Returns the node on success, zero on failure.
*/ externint prom_searchsiblings(int node_start, char *name);
/* Return the first property type, as a string, for the given node. * Returns a null string on error.
*/ externchar *prom_firstprop(int node);
/* Returns the next property after the passed property for the given * node. Returns null string on failure.
*/ externchar *prom_nextprop(int node, char *prev_property);
/* Returns 1 if the specified node has given property. */ externint prom_node_has_property(int node, char *property);
/* Set the indicated property at the given node with the passed value. * Returns the number of bytes of your value that the prom took.
*/ externint prom_setprop(int node, char *prop_name, char *prop_value, int value_size);
/* Adjust reg values with the passed ranges. */ externvoid prom_adjust_regs(struct linux_prom_registers *regp, int nregs, struct linux_prom_ranges *rangep, int nranges);
/* Adjust child ranges with the passed parent ranges. */ externvoid prom_adjust_ranges(struct linux_prom_ranges *cranges, int ncranges, struct linux_prom_ranges *pranges, int npranges);
/* Apply promlib probed OBIO ranges to registers. */ externvoid prom_apply_obio_ranges(struct linux_prom_registers *obioregs, int nregs);
/* Apply ranges of any prom node (and optionally parent node as well) to registers. */ externvoid prom_apply_generic_ranges(int node, int parent, struct linux_prom_registers *sbusregs, int nregs);
#endif/* !(__SPARC_OPLIB_H) */
Messung V0.5
¤ Dauer der Verarbeitung: 0.21 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.