diff options
author | Tinku Mannan | 2017-03-10 10:28:53 -0600 |
---|---|---|
committer | Tinku Mannan | 2017-03-10 10:28:53 -0600 |
commit | a0574a7442d64670be699e55cac9bf431006c806 (patch) | |
tree | 663d2fe74bda15614a0f22fc9126995ef5467a31 /src | |
parent | 03122fce0f3453e97d0e5f2f7fb5236d2b5e8068 (diff) | |
download | pruss-lld-a0574a7442d64670be699e55cac9bf431006c806.tar.gz pruss-lld-a0574a7442d64670be699e55cac9bf431006c806.tar.xz pruss-lld-a0574a7442d64670be699e55cac9bf431006c806.zip |
Fix PRSDK-1805: Fix for cplusplus_build
Diffstat (limited to 'src')
-rw-r--r-- | src/pruicss_drv.c | 50 | ||||
-rw-r--r-- | src/pruicss_intc.c | 13 |
2 files changed, 31 insertions, 32 deletions
diff --git a/src/pruicss_drv.c b/src/pruicss_drv.c index c89a861..d0f0b05 100644 --- a/src/pruicss_drv.c +++ b/src/pruicss_drv.c | |||
@@ -118,7 +118,7 @@ int32_t PRUICSS_setPRUBuffer( PRUICSS_Handle handle, | |||
118 | 118 | ||
119 | PRUICSS_V1_Object *object; | 119 | PRUICSS_V1_Object *object; |
120 | int32_t ret_val = 0; | 120 | int32_t ret_val = 0; |
121 | object = handle->object; | 121 | object = (PRUICSS_V1_Object*)handle->object; |
122 | 122 | ||
123 | if((pruNum >= PRUICSS_MAX_PRU ) || (buffer == 0)) | 123 | if((pruNum >= PRUICSS_MAX_PRU ) || (buffer == 0)) |
124 | { | 124 | { |
@@ -148,8 +148,8 @@ int32_t PRUICSS_pruReset(PRUICSS_Handle handle,uint8_t pruNum) | |||
148 | PRUICSS_HwAttrs const *hwAttrs; | 148 | PRUICSS_HwAttrs const *hwAttrs; |
149 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 149 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
150 | 150 | ||
151 | object = handle->object; | 151 | object = (PRUICSS_V1_Object*)handle->object; |
152 | hwAttrs = handle->hwAttrs; | 152 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; |
153 | 153 | ||
154 | if(pruNum >= PRUICSS_MAX_PRU) | 154 | if(pruNum >= PRUICSS_MAX_PRU) |
155 | { | 155 | { |
@@ -214,8 +214,8 @@ int32_t PRUICSS_pruReset(PRUICSS_Handle handle,uint8_t pruNum) | |||
214 | PRUICSS_HwAttrs const *hwAttrs; | 214 | PRUICSS_HwAttrs const *hwAttrs; |
215 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 215 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
216 | 216 | ||
217 | object = handle->object; | 217 | object = (PRUICSS_V1_Object*)handle->object; |
218 | hwAttrs = handle->hwAttrs; | 218 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; |
219 | 219 | ||
220 | if(pruNum >= PRUICSS_MAX_PRU) | 220 | if(pruNum >= PRUICSS_MAX_PRU) |
221 | { | 221 | { |
@@ -281,8 +281,8 @@ int32_t PRUICSS_pruEnable(PRUICSS_Handle handle,uint8_t pruNum) | |||
281 | PRUICSS_HwAttrs const *hwAttrs; | 281 | PRUICSS_HwAttrs const *hwAttrs; |
282 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 282 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
283 | 283 | ||
284 | object = handle->object; | 284 | object = (PRUICSS_V1_Object*)handle->object; |
285 | hwAttrs = handle->hwAttrs; | 285 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; |
286 | 286 | ||
287 | if(pruNum >= PRUICSS_MAX_PRU) | 287 | if(pruNum >= PRUICSS_MAX_PRU) |
288 | { | 288 | { |
@@ -365,7 +365,7 @@ int32_t PRUICSS_pruWriteMemory( | |||
365 | PRUICSS_HwAttrs const *hwAttrs; | 365 | PRUICSS_HwAttrs const *hwAttrs; |
366 | uint32_t temp_addr = 0U; | 366 | uint32_t temp_addr = 0U; |
367 | 367 | ||
368 | hwAttrs = handle->hwAttrs; | 368 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; |
369 | uint32_t i, wordlength; | 369 | uint32_t i, wordlength; |
370 | 370 | ||
371 | wordlength = (bytelength + 3U) >> 2U; | 371 | wordlength = (bytelength + 3U) >> 2U; |
@@ -410,8 +410,9 @@ int32_t PRUICSS_pruSendEvent(PRUICSS_Handle handle,uint32_t eventnum) | |||
410 | uint32_t temp_addr = 0U; | 410 | uint32_t temp_addr = 0U; |
411 | uint32_t temp_var = 0U; | 411 | uint32_t temp_var = 0U; |
412 | 412 | ||
413 | object = handle->object; | 413 | object = (PRUICSS_V1_Object*)handle->object; |
414 | hwAttrs = handle->hwAttrs; | 414 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; |
415 | |||
415 | if(object->instance == PRUICCSS_INSTANCE_ONE) | 416 | if(object->instance == PRUICCSS_INSTANCE_ONE) |
416 | { | 417 | { |
417 | baseaddr = hwAttrs->prussIntcRegBase; | 418 | baseaddr = hwAttrs->prussIntcRegBase; |
@@ -458,9 +459,10 @@ int32_t PRUICSS_pruClearEvent(PRUICSS_Handle handle,uint32_t eventnum) | |||
458 | PRUICSS_V1_Object *object; | 459 | PRUICSS_V1_Object *object; |
459 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 460 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
460 | 461 | ||
461 | hwAttrs = handle->hwAttrs; | 462 | object = (PRUICSS_V1_Object*)handle->object; |
463 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; | ||
464 | |||
462 | baseaddr = hwAttrs->baseAddr; | 465 | baseaddr = hwAttrs->baseAddr; |
463 | object = handle->object; | ||
464 | if(object->instance == PRUICCSS_INSTANCE_ONE) | 466 | if(object->instance == PRUICCSS_INSTANCE_ONE) |
465 | { | 467 | { |
466 | baseaddr = hwAttrs->prussIntcRegBase; | 468 | baseaddr = hwAttrs->prussIntcRegBase; |
@@ -495,7 +497,7 @@ int32_t PRUICSS_pruWaitEvent(PRUICSS_Handle handle,uint32_t pruEvtoutNum ) | |||
495 | PRUICSS_V1_Object *object; | 497 | PRUICSS_V1_Object *object; |
496 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 498 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
497 | 499 | ||
498 | object = handle->object; | 500 | object = (PRUICSS_V1_Object*)handle->object; |
499 | 501 | ||
500 | if(pruEvtoutNum >= PRUICSS_MAX_WAIT_EVENTS) | 502 | if(pruEvtoutNum >= PRUICSS_MAX_WAIT_EVENTS) |
501 | { | 503 | { |
@@ -528,7 +530,7 @@ int32_t PRUICSS_mapPruMem(PRUICSS_Handle handle,uint32_t pru_ram_id, void **addr | |||
528 | uint32_t temp_addr = 0U; | 530 | uint32_t temp_addr = 0U; |
529 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 531 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
530 | 532 | ||
531 | hwAttrs = handle->hwAttrs; | 533 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; |
532 | baseaddr = hwAttrs->baseAddr; | 534 | baseaddr = hwAttrs->baseAddr; |
533 | 535 | ||
534 | switch (pru_ram_id) { | 536 | switch (pru_ram_id) { |
@@ -571,9 +573,9 @@ int32_t PRUICSS_mapPruMem(PRUICSS_Handle handle,uint32_t pru_ram_id, void **addr | |||
571 | PRUICSS_HwAttrs const *hwAttrs; | 573 | PRUICSS_HwAttrs const *hwAttrs; |
572 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 574 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
573 | 575 | ||
574 | hwAttrs = handle->hwAttrs; | 576 | object = (PRUICSS_V1_Object*)handle->object; |
577 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; | ||
575 | 578 | ||
576 | object = handle->object; | ||
577 | if(object->instance == PRUICCSS_INSTANCE_ONE) { | 579 | if(object->instance == PRUICCSS_INSTANCE_ONE) { |
578 | switch (per_id) | 580 | switch (per_id) |
579 | { | 581 | { |
@@ -642,9 +644,9 @@ void PRUICSS_enableOCPMasterAccess(PRUICSS_Handle handle ) | |||
642 | PRUICSS_V1_Object *object; | 644 | PRUICSS_V1_Object *object; |
643 | PRUICSS_HwAttrs const *hwAttrs; | 645 | PRUICSS_HwAttrs const *hwAttrs; |
644 | 646 | ||
645 | hwAttrs = handle->hwAttrs; | 647 | object = (PRUICSS_V1_Object*)handle->object; |
648 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; | ||
646 | 649 | ||
647 | object = handle->object; | ||
648 | if(object->instance == PRUICCSS_INSTANCE_ONE) | 650 | if(object->instance == PRUICCSS_INSTANCE_ONE) |
649 | { | 651 | { |
650 | baseaddr = hwAttrs->prussCfgRegBase; | 652 | baseaddr = hwAttrs->prussCfgRegBase; |
@@ -677,7 +679,7 @@ uint32_t PRUICSS_detectHWVersion(void) | |||
677 | uint32_t PRUICSS_getICSSVersion(PRUICSS_Handle handle) | 679 | uint32_t PRUICSS_getICSSVersion(PRUICSS_Handle handle) |
678 | { | 680 | { |
679 | PRUICSS_V1_Object *object; | 681 | PRUICSS_V1_Object *object; |
680 | object = handle->object; | 682 | object = (PRUICSS_V1_Object*)handle->object; |
681 | return object->pruicss_version; | 683 | return object->pruicss_version; |
682 | } | 684 | } |
683 | 685 | ||
@@ -697,8 +699,7 @@ int32_t PRUICSS_pruExecProgram(PRUICSS_Handle handle,int32_t pruNum) | |||
697 | PRUICSS_V1_Object *object; | 699 | PRUICSS_V1_Object *object; |
698 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 700 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
699 | 701 | ||
700 | object = handle->object; | 702 | object = (PRUICSS_V1_Object*)handle->object; |
701 | |||
702 | if((pruNum >= PRUICSS_MAX_PRU) || (object->pruBinBuff[pruNum] == 0) || (object->buffLen[pruNum] == 0)) | 703 | if((pruNum >= PRUICSS_MAX_PRU) || (object->pruBinBuff[pruNum] == 0) || (object->buffLen[pruNum] == 0)) |
703 | { | 704 | { |
704 | ret_val = PRUICSS_RETURN_FAILURE; | 705 | ret_val = PRUICSS_RETURN_FAILURE; |
@@ -755,8 +756,8 @@ void PRUICSS_pinMuxConfig(PRUICSS_Handle handle, uint64_t regVal) | |||
755 | PRUICSS_V1_Object *object; | 756 | PRUICSS_V1_Object *object; |
756 | PRUICSS_HwAttrs const *hwAttrs; | 757 | PRUICSS_HwAttrs const *hwAttrs; |
757 | 758 | ||
758 | hwAttrs = handle->hwAttrs; | 759 | object = (PRUICSS_V1_Object*)handle->object; |
759 | object = handle->object; | 760 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; |
760 | 761 | ||
761 | if(object->instance == PRUICCSS_INSTANCE_ONE) | 762 | if(object->instance == PRUICCSS_INSTANCE_ONE) |
762 | { | 763 | { |
@@ -820,7 +821,6 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32 | |||
820 | uint32_t tempval = 0U; | 821 | uint32_t tempval = 0U; |
821 | uint32_t currentval = 0U; | 822 | uint32_t currentval = 0U; |
822 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 823 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
823 | hwAttrs = handle->hwAttrs; | ||
824 | 824 | ||
825 | /* verify constant table index is within valid range */ | 825 | /* verify constant table index is within valid range */ |
826 | if (((constantTblEntry < 0) || (constantTblEntry > PRUICCSS_ConstTblEntryMax)) || (pruNum > PRUICSS_MAX_PRU)) | 826 | if (((constantTblEntry < 0) || (constantTblEntry > PRUICCSS_ConstTblEntryMax)) || (pruNum > PRUICSS_MAX_PRU)) |
@@ -829,7 +829,7 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32 | |||
829 | } | 829 | } |
830 | else | 830 | else |
831 | { | 831 | { |
832 | hwAttrs = handle->hwAttrs; | 832 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; |
833 | if(PRUICCSS_PRU0 == pruNum) | 833 | if(PRUICCSS_PRU0 == pruNum) |
834 | { | 834 | { |
835 | baseaddr = hwAttrs->prussPru0CtrlRegBase; | 835 | baseaddr = hwAttrs->prussPru0CtrlRegBase; |
diff --git a/src/pruicss_intc.c b/src/pruicss_intc.c index 1159570..cce6112 100644 --- a/src/pruicss_intc.c +++ b/src/pruicss_intc.c | |||
@@ -133,9 +133,9 @@ int32_t PRUICSS_pruIntcInit(PRUICSS_Handle handle, const PRUICSS_IntcInitData * | |||
133 | 133 | ||
134 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 134 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
135 | 135 | ||
136 | hwAttrs = handle->hwAttrs; | 136 | object = (PRUICSS_V1_Object*)handle->object; |
137 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; | ||
137 | baseaddr = hwAttrs->baseAddr; | 138 | baseaddr = hwAttrs->baseAddr; |
138 | object = handle->object; | ||
139 | 139 | ||
140 | if(object->instance == PRUICCSS_INSTANCE_ONE) | 140 | if(object->instance == PRUICCSS_INSTANCE_ONE) |
141 | { | 141 | { |
@@ -263,7 +263,7 @@ int32_t PRUICSS_registerIrqHandler(PRUICSS_Handle handle, | |||
263 | 263 | ||
264 | HwiP_Handle hwiHandle; | 264 | HwiP_Handle hwiHandle; |
265 | void* semHandle = NULL; | 265 | void* semHandle = NULL; |
266 | object = handle->object; | 266 | object = (PRUICSS_V1_Object*)handle->object; |
267 | 267 | ||
268 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 268 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
269 | 269 | ||
@@ -333,12 +333,11 @@ int32_t PRUICSS_registerIrqHandler2(PRUICSS_Handle handle, | |||
333 | SemaphoreP_Params semParams; | 333 | SemaphoreP_Params semParams; |
334 | HwiP_Handle hwiHandle; | 334 | HwiP_Handle hwiHandle; |
335 | void* semHandle = NULL; | 335 | void* semHandle = NULL; |
336 | object = handle->object; | 336 | object = (PRUICSS_V1_Object*)handle->object; |
337 | HwiP_Params hwiInputParams; | 337 | HwiP_Params hwiInputParams; |
338 | MuxIntcP_inParams muxInParams; | 338 | MuxIntcP_inParams muxInParams; |
339 | MuxIntcP_outParams muxOutParams; | 339 | MuxIntcP_outParams muxOutParams; |
340 | HwiP_Fxn hwiFxn; | 340 | HwiP_Fxn hwiFxn; |
341 | |||
342 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 341 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
343 | 342 | ||
344 | if ((intrCfg->pruEvtoutNum >= PRUICSS_MAX_WAIT_EVENTS) || (intrCfg->irqHandler == NULL)) | 343 | if ((intrCfg->pruEvtoutNum >= PRUICSS_MAX_WAIT_EVENTS) || (intrCfg->irqHandler == NULL)) |
@@ -498,8 +497,8 @@ int32_t PRUICSS_pruIntcClear(PRUICSS_Handle handle) | |||
498 | /* verify the handle */ | 497 | /* verify the handle */ |
499 | if (handle != NULL) | 498 | if (handle != NULL) |
500 | { | 499 | { |
501 | hwAttrs = handle->hwAttrs; | 500 | object = (PRUICSS_V1_Object*)handle->object; |
502 | object = handle->object; | 501 | hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; |
503 | /* verify the instance */ | 502 | /* verify the instance */ |
504 | if ((object->instance == PRUICCSS_INSTANCE_ONE) || (object->instance == PRUICCSS_INSTANCE_TWO)) | 503 | if ((object->instance == PRUICCSS_INSTANCE_ONE) || (object->instance == PRUICCSS_INSTANCE_TWO)) |
505 | { | 504 | { |