Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove CONFIG_CAN_PASS_STRUCT #766

Merged
merged 3 commits into from
Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 13 additions & 20 deletions arch/arm/src/cxd56xx/cxd56_gnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ struct cxd56_gnss_shared_info_s
uint32_t argv[GNSS_SHARED_INFO_MAX_ARGC];
};

struct cxd56_devsig_table_s
{
uint8_t sigtype;
cxd56_cpu1sighandler_t handler;
};

struct cxd56_gnss_dev_s
{
sem_t devsem;
Expand Down Expand Up @@ -2037,7 +2043,9 @@ static FAR char *cxd56_gnss_read_cep_file(FAR FILE *fp, int32_t offset,

return buf;

/* send signal to CPU1 in error for just notify completion of read sequence */
/* Send signal to CPU1 in error for just notify completion of read
* sequence.
*/

_err1:
free(buf);
Expand Down Expand Up @@ -2154,13 +2162,10 @@ static void cxd56_gnss_common_signalhandler(uint32_t data,
struct cxd56_gnss_sig_s *sig = &priv->sigs[i];
if (sig->enable && sig->info.gnsssig == sigtype)
{
#ifdef CONFIG_CAN_PASS_STRUCTS
union sigval value;

value.sival_ptr = &sig->info;
sigqueue(sig->pid, sig->info.signo, value);
#else
sigqueue(sig->pid, sig->info.signo, &sig->info);
#endif
issetmask = 1;
}
}
Expand Down Expand Up @@ -2832,62 +2837,50 @@ static int cxd56_gnss_register(FAR const char *devpath)
FAR struct cxd56_gnss_dev_s *priv;
int i;
int ret;
static struct

static struct cxd56_devsig_table_s devsig_table[] =
{
uint8_t sigtype;
cxd56_cpu1sighandler_t handler;
} devsig_table[] =
{
{
CXD56_CPU1_DATA_TYPE_GNSS,
cxd56_gnss_default_sighandler
},

{
CXD56_CPU1_DATA_TYPE_AGPS,
cxd56_gnss_common_signalhandler
},

{
CXD56_CPU1_DATA_TYPE_RTK,
cxd56_gnss_common_signalhandler
},

{
CXD56_CPU1_DATA_TYPE_GPSEPHEMERIS,
cxd56_gnss_common_signalhandler
},

{
CXD56_CPU1_DATA_TYPE_GLNEPHEMERIS,
cxd56_gnss_common_signalhandler
},

{
CXD56_CPU1_DATA_TYPE_SPECTRUM,
cxd56_gnss_common_signalhandler
},

{
CXD56_CPU1_DATA_TYPE_PVTLOG,
cxd56_gnss_common_signalhandler
},

{
CXD56_CPU1_DATA_TYPE_CPUFIFOAPI,
cxd56_gnss_cpufifoapi_signalhandler
},

{
CXD56_CPU1_DATA_TYPE_SBAS,
cxd56_gnss_common_signalhandler
},

{
CXD56_CPU1_DATA_TYPE_DCREPORT,
cxd56_gnss_common_signalhandler
}
};
};

priv = (FAR struct cxd56_gnss_dev_s *)kmm_malloc(
sizeof(struct cxd56_gnss_dev_s));
Expand Down
5 changes: 1 addition & 4 deletions arch/arm/src/cxd56xx/cxd56_icc.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,10 @@ static int icc_irqhandler(int cpuid, uint32_t word[2])
#ifndef CONFIG_DISABLE_SIGNAL
if (priv->pid != INVALID_PROCESS_ID)
{
# ifdef CONFIG_CAN_PASS_STRUCTS
union sigval value;

value.sival_ptr = priv->sigdata;
sigqueue(priv->pid, priv->signo, value);
# else
sigqueue(priv->pid, priv->signo, priv->sigdata);
# endif
}
#endif

Expand Down
13 changes: 2 additions & 11 deletions arch/arm/src/cxd56xx/cxd56_scu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1490,9 +1490,7 @@ static void seq_handlefifointr(FAR struct cxd56_scudev_s *priv,
int i;
#ifndef CONFIG_DISABLE_SIGNAL
struct wm_notify_s *notify;
# ifdef CONFIG_CAN_PASS_STRUCTS
union sigval value;
# endif
#endif

if ((intr & 0x007ffe00) == 0)
Expand Down Expand Up @@ -1520,12 +1518,8 @@ static void seq_handlefifointr(FAR struct cxd56_scudev_s *priv,

DEBUGASSERT(notify->pid != 0);

# ifdef CONFIG_CAN_PASS_STRUCTS
value.sival_ptr = notify->ts;
sigqueue(notify->pid, notify->signo, value);
# else
sigqueue(notify->pid, notify->signo, (FAR void *)notify->ts);
# endif
#endif
}
}
Expand Down Expand Up @@ -1611,15 +1605,12 @@ static void seq_handlemathfintr(FAR struct cxd56_scudev_s *priv,
#ifndef CONFIG_DISABLE_SIGNAL
if (detected)
{
union sigval value;

DEBUGASSERT(notify->pid != 0);

# ifdef CONFIG_CAN_PASS_STRUCTS
union sigval value;
value.sival_ptr = notify->arg;
sigqueue(notify->pid, notify->signo, value);
# else
sigqueue(notify->pid, notify->signo, (FAR void *)notify->arg);
# endif
detected = 0;
}
#endif
Expand Down
24 changes: 15 additions & 9 deletions arch/arm/src/cxd56xx/cxd56_usbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,9 @@ static const struct usbdev_ops_s g_devops =
.pullup = cxd56_pullup,
};

/* There is only one, single, pre-allocated instance of the driver structure */
/* There is only one, single, pre-allocated instance of the driver
* structure.
*/

static struct cxd56_usbdev_s g_usbdev;

Expand Down Expand Up @@ -1622,7 +1624,9 @@ static int cxd56_epinterrupt(int irq, FAR void *context)

cxd56_txdmacomplete(privep);

/* Clear NAK to raise IN interrupt for send next IN packets */
/* Clear NAK to raise IN interrupt for send next IN
* packets.
*/

putreg32(ctrl | USB_CNAK, CXD56_USB_IN_EP_CONTROL(n));
}
Expand Down Expand Up @@ -1718,7 +1722,9 @@ static int cxd56_epinterrupt(int irq, FAR void *context)
priv->ep0datlen += len;
}

/* Dispatch to cxd56_ep0setup if received all OUT data */
/* Dispatch to cxd56_ep0setup if received all OUT
* data.
*/

if (priv->ep0datlen == priv->ep0reqlen)
{
Expand Down Expand Up @@ -1791,7 +1797,9 @@ static int cxd56_epinterrupt(int irq, FAR void *context)

if (!(stat & USB_INT_MRXFIFOEMPTY))
{
/* Flush Receive FIFO and clear NAK to finish status stage */
/* Flush Receive FIFO and clear NAK to finish status
* stage.
*/

putreg32(ctrl | USB_MRXFLUSH,
CXD56_USB_OUT_EP_CONTROL(n));
Expand Down Expand Up @@ -2467,7 +2475,9 @@ static int cxd56_epsubmit(FAR struct usbdev_ep_s *ep,
if (priv->ctrl.req == USB_REQ_SETCONFIGURATION ||
priv->ctrl.req == USB_REQ_SETINTERFACE)
{
/* Nothing to transfer -- exit success, with zero bytes transferred */
/* Nothing to transfer -- exit success, with zero bytes
* transferred
*/

usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd);
cxd56_reqcomplete(privep, OK);
Expand Down Expand Up @@ -3392,13 +3402,9 @@ static void cxd56_notify_signal(uint16_t state, uint16_t power)

if (priv->signo > 0)
{
#ifdef CONFIG_CAN_PASS_STRUCTS
union sigval value;
value.sival_int = state << 16 | power;
sigqueue(priv->pid, priv->signo, value);
#else
sigqueue(priv->pid, priv->signo, state << 16 | power);
#endif
}
}

Expand Down
Loading