This discussion is archived
0 Replies Latest reply: Nov 24, 2011 5:45 AM by 902032 RSS

Getting compilation error while writing standalone for ddi_get8

902032 Newbie
Currently Being Moderated
Hi All,

I have already posted a thread regarding ddi_regs_map_setup solaris system call guidance.

[Previous Query|https://forums.oracle.com/forums/thread.jspa?threadID=2314211&tstart=0]


I am writing a standalone to use this system call.

Below is my partial standalone where i have only the declaration part:

#include <stdio.h>
#include <sys/dditypes.h>
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>

int main()
{
dev_info_t *dip;
uint_t rnumber;
ushort_t *dev_addr;
offset_t offset;
offset_t len;
ushort_t dev_command;
ddi_device_acc_attr_t dev_attr;
ddi_acc_handle_t handle;
dev_attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
dev_attr.devacc_attr_endian_flags = DDI_STRUCTURE_LE_ACC;
dev_attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;

return 0;
}


The standalone give the following compilation errors:

ddiSystemcall.c: In function `main':
ddiSystemcall.c:15: error: `ddi_device_acc_attr_t' undeclared (first use in this function)
ddiSystemcall.c:15: error: (Each undeclared identifier is reported only once
ddiSystemcall.c:15: error: for each function it appears in.)
ddiSystemcall.c:15: error: syntax error before "dev_attr"
ddiSystemcall.c:16: error: `ddi_acc_handle_t' undeclared (first use in this function)
ddiSystemcall.c:17: error: `dev_attr' undeclared (first use in this function)
ddiSystemcall.c:17: error: `DDI_DEVICE_ATTR_V0' undeclared (first use in this function)
ddiSystemcall.c:18: error: `DDI_STRUCTURE_LE_ACC' undeclared (first use in this function)
ddiSystemcall.c:19: error: `DDI_STRICTORDER_ACC' undeclared (first use in this function)

Please let me know where am i going wrong.

Thanks in advance.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points