本文整理汇总了C++中P1275_ARG函数的典型用法代码示例。如果您正苦于以下问题:C++ P1275_ARG函数的具体用法?C++ P1275_ARG怎么用?C++ P1275_ARG使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了P1275_ARG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prom_set_trap_table_sun4v
void prom_set_trap_table_sun4v(unsigned long tba, unsigned long mmfsa)
{
p1275_cmd("SUNW,set-trap-table",
(P1275_ARG(0, P1275_ARG_IN_64B) |
P1275_ARG(1, P1275_ARG_IN_64B) |
P1275_INOUT(2, 0)), tba, mmfsa);
}
示例2: prom_unmap
void prom_unmap(unsigned long size, unsigned long vaddr)
{
p1275_cmd("call-method",
(P1275_ARG(0, P1275_ARG_IN_STRING) |
P1275_ARG(2, P1275_ARG_IN_64B) |
P1275_ARG(3, P1275_ARG_IN_64B) |
P1275_INOUT(4, 0)),
"unmap",
prom_get_mmu_ihandle(),
size,
vaddr);
}
示例3: prom_puts
void
prom_puts(char *s, int len)
{
p1275_cmd("write", P1275_ARG(1,P1275_ARG_IN_BUF)|
P1275_INOUT(3,1),
prom_stdout, s, P1275_SIZE(len));
}
示例4: prom_ihandle2path
int prom_ihandle2path(int handle, char *buffer, int bufsize)
{
return p1275_cmd("instance-to-path",
P1275_ARG(1,P1275_ARG_OUT_BUF)|
P1275_INOUT(3, 1),
handle, buffer, P1275_SIZE(bufsize));
}
示例5: prom_devopen
/* Open the device described by the string 'dstr'. Returns the handle
* to that device used for subsequent operations on that device.
* Returns 0 on failure.
*/
int
prom_devopen(const char *dstr)
{
return p1275_cmd ("open", P1275_ARG(0,P1275_ARG_IN_STRING)|
P1275_INOUT(1,1),
dstr);
}
示例6: prom_getproperty
/* Acquire a property 'prop' at node 'node' and place it in
* 'buffer' which has a size of 'bufsize'. If the acquisition
* was successful the length will be returned, else -1 is returned.
*/
inline int prom_getproperty(int node, const char *prop,
char *buffer, int bufsize)
{
int plen;
plen = prom_getproplen(node, prop);
if ((plen > bufsize) || (plen == 0) || (plen == -1)) {
return -1;
} else {
/* Ok, things seem all right. */
return p1275_cmd(prom_getprop_name,
P1275_ARG(1,P1275_ARG_IN_STRING)|
P1275_ARG(2,P1275_ARG_OUT_BUF)|
P1275_INOUT(4, 1),
node, prop, buffer, P1275_SIZE(plen));
}
}
示例7: prom_getproplen
/* Return the length in bytes of property 'prop' at node 'node'.
* Return -1 on error.
*/
inline int prom_getproplen(int node, const char *prop)
{
if((!node) || (!prop)) return -1;
return p1275_cmd ("getproplen",
P1275_ARG(1,P1275_ARG_IN_STRING)|
P1275_INOUT(2, 1),
node, prop);
}
示例8: strcpy
/* Return the property type string after property type 'oprop'
* at node 'node' . Returns NULL string if no more
* property types for this node.
*/
inline char *prom_nextprop(int node, const char *oprop, char *buffer)
{
char buf[32];
if(node == -1) {
*buffer = 0;
return buffer;
}
if (oprop == buffer) {
strcpy (buf, oprop);
oprop = buf;
}
p1275_cmd ("nextprop", P1275_ARG(1,P1275_ARG_IN_STRING)|
P1275_ARG(2,P1275_ARG_OUT_32B)|
P1275_INOUT(3, 0),
node, oprop, buffer);
return buffer;
}
示例9: prom_reboot
/* Reset and reboot the machine with the command 'bcommand'. */
void prom_reboot(const char *bcommand)
{
#ifdef CONFIG_SUN_LDOMS
if (ldom_domaining_enabled)
ldom_reboot(bcommand);
#endif
p1275_cmd("boot", P1275_ARG(0, P1275_ARG_IN_STRING) |
P1275_INOUT(1, 0), bcommand);
}
示例10: prom_service_exists
int prom_service_exists(const char *service_name)
{
int err = p1275_cmd("test", P1275_ARG(0, P1275_ARG_IN_STRING) |
P1275_INOUT(1, 1), service_name);
if (err)
return 0;
return 1;
}
示例11: p1275_cmd
/* Return the first property type for node 'node'.
* buffer should be at least 32B in length
*/
inline char *prom_firstprop(int node, char *buffer)
{
*buffer = 0;
if(node == -1) return buffer;
p1275_cmd ("nextprop", P1275_ARG(2,P1275_ARG_OUT_32B)|
P1275_INOUT(3, 0),
node, (char *) 0x0, buffer);
return buffer;
}
示例12: prom_setprop
/* Set property 'pname' at node 'node' to value 'value' which has a length
* of 'size' bytes. Return the number of bytes the prom accepted.
*/
int
prom_setprop(int node, const char *pname, char *value, int size)
{
if (size == 0)
return 0;
if ((pname == 0) || (value == 0))
return 0;
#ifdef CONFIG_SUN_LDOMS
if (ldom_domaining_enabled) {
ldom_set_var(pname, value);
return 0;
}
#endif
return p1275_cmd ("setprop", P1275_ARG(1,P1275_ARG_IN_STRING)|
P1275_ARG(2,P1275_ARG_IN_BUF)|
P1275_INOUT(4, 1),
node, pname, value, P1275_SIZE(size));
}
示例13: prom_finddevice
int
prom_finddevice(const char *name)
{
if (!name)
return 0;
return p1275_cmd(prom_finddev_name,
P1275_ARG(0,P1275_ARG_IN_STRING)|
P1275_INOUT(1, 1),
name);
}
示例14: prom_nbgetchar
/* Non blocking get character from console input device, returns -1
* if no input was taken. This can be used for polling.
*/
__inline__ int
prom_nbgetchar(void)
{
char inc;
if (p1275_cmd("read", P1275_ARG(1,P1275_ARG_OUT_BUF)|
P1275_INOUT(3,1),
prom_stdin, &inc, P1275_SIZE(1)) == 1)
return inc;
else
return -1;
}
示例15: prom_nbputchar
/* Non blocking put character to console device, returns -1 if
* unsuccessful.
*/
__inline__ int
prom_nbputchar(char c)
{
char outc;
outc = c;
if (p1275_cmd("write", P1275_ARG(1,P1275_ARG_IN_BUF)|
P1275_INOUT(3,1),
prom_stdout, &outc, P1275_SIZE(1)) == 1)
return 0;
else
return -1;
}