cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
21,076 Views
Registered: ‎07-15-2008

expected specifier-qualifier-list before 'pthread_t'

Jump to solution

I am trying to port a project from ppc405 to ppc440. I was previously using EDK 9.1 and am currently using 10.1.

 

When i try to compile the code I get this error

 

C:/XilinxProj/ppc440_0/include/sys/ktypes.h:94: error: expected specifier-qualifier-list before 'pthread_t'

 

 

I am using

  • OS option as XilKernel
  • config_sema = true 
  • config_pthread_support = true
  • Has 2 threads in the static_pthread_table
  • config_pthread_mutex = true
  • pthread_stack_size = 0x1000
  • max_pthreads = 10


and have finished Generating software libraries and BSPs.

 

As the code is xilinx generated code, i don't wish to tamper with the generated .h files ... any idea what the problem could be?

 

 

In response to Siva's Question below - there is no error while generating the library. The problem occurs while compiling my project - not while generating the libraries. I have copied the relevant file that is causing the error - ktypes.h

 

 

 

//----------------------------------------------------------------------------------------------------//
//! @file ktypes.h
//! Kernel equivalent of sys/types.h
//----------------------------------------------------------------------------------------------------//

#ifndef _KTYPES_H
#define _KTYPES_H

#include <os_config.h>
#include <sys/arch.h>
#include <sys/types.h>
#include <semaphore.h>
#include <sys/msg.h>
#include <sys/shm.h>
#include <sys/ktypes.h>

#ifdef __cplusplus
extern "C" {
#endif

#define SET_CURRENT_PROCESS(pid)  do {                                                         \
                                        current_pid = pid;                                     \
                                        current_process = (pid == -1) ? NULL:(&ptable[pid]);   \
                                  } while(0)                                                 
                                 
typedef struct _process_struct process_struct ;
typedef struct _process_context process_context ;

struct pthread_info_s;
// Queue Management Data Structures
typedef struct _queue *queuep ;

struct _queue {
    unsigned short item_size ;    //! Size of Queue item
    unsigned char max_items ;    //! Max. number of items in Q
    unsigned char item_count ;    //! Items in the Queue
    unsigned char qfront ;    //! Queue front pointer
    unsigned char qend ;    //! Queue end pointer    
    void *items ;        //! Queue of item's
};   

typedef struct reent_s {
    int _errno;
} reent_t;

//! Process Control Block - Information about the Process
struct _process_struct {
    process_context     pcontext;    //! Context switch store. Keep this at the top of the structure. Context switch relies on this.
    unsigned char     state;        //! Process State
    pid_t               pid;        //! Unique Process Identifier
    signed char     priority;    //! Process Priority
    signed char     is_allocated;    //! If the PCB has been allocated 
                                        //! 0 - Unallocated, 1 - Allocated
    queuep              blockq;         //! Queue on which this process is currently blocked
#ifdef CONFIG_PTHREAD_SUPPORT
    struct pthread_info_s* thread;      //! Pointer to the thread that is currently using this PCB.
                                        //! Kludge ! Used because process and threads are essentially the same now.
#endif
#ifdef CONFIG_TIME 
    unsigned char       timeout;        //! Flag set if this process had a recent timeout
    unsigned int        remain;         //! Number of milliseconds of timeout remaining when this process was unblocked
#endif
#ifdef CONFIG_STATS
    unsigned int        active_ticks;   //! Number of quantums which this process has executed (approx)
#endif   
    reent_t             reent;          //! Re-entrancy information for this process
} __attribute__ ((aligned (4), packed));

//! Kernel pthread info structure
typedef struct pthread_info_s {
    char                        is_allocated;
    process_struct              *parent;                //! pointer back to base process structure
    pthread_t                   tid;                    //! ID of this thread.
    void                        *retval;                //! Return value of thread when it terminates.
    void*                       (*start_func)(void*);   //! Starting function
    void                        *param;                 //! Parameter to starting function
    unsigned char               state;                  //! Thread state
    struct pthread_info_s       *join_thread;           //! Joining thread
    char                        joinq_mem;              //! Just a single byte of memory for the queue
    struct _queue               joinq;                  //! Queue of size 1.
    signed char                 mem_id ;                //! Mem ID of thread context
    pthread_attr_t              thread_attr;            //! Thread attributes
} pthread_info_t;


//! Kernel mutex info structure
typedef struct pthread_mutexinfo_s {
    int                 is_allocated;   
    int                 locked;
    pthread_mutexattr_t attr;                   //! Mutex attributes
    struct _queue       mutex_wait_q ;          //! Queue of waiting threads
    pid_t               owner;                  //! ID of currently locking process
} pthread_mutexinfo_t;


//! Kernel semaphore info structure
typedef struct sem_info_s {
    signed char   sem_id;    //! Semaphore ID. -1 -> uninitialized
    signed char   sem_value;    //! Resource count
    struct _queue sem_wait_q ;    //! Queue of waiting processes
    pid_t         owner;        //! PID of process owning this semaphore. if -1 , 
                                //! then any process can access this sem.
    unsigned char unlink;       //! Unlink status
} sem_info_t;

//! Semaphore symbolic name mapping table
typedef struct sem_map_s {
    char name[SEM_NAME_MAX];
    sem_t sem;
} sem_map_t;

//! Message queue buffer structure
typedef struct msg_s {
    char*  msg_buf;
    size_t msg_len;
} msg_t;

//! Kernel message queue info structure
typedef struct  msgid_s {
    int    msgid ;             //! Message Queue ID
    key_t  key ;           //! Key used to identify the MsgQ
    //unsigned char msgsize ;  //! The size of the Message
    unsigned char msgq_len ;   //! Message Queue depth
    sem_t full ;               //! Semaphore used by the producer
    sem_t empty ;              //! Semaphore used by the consumer
    struct _queue msg_q ;      //! Queue of Messages
    struct msqid_ds stats;     //! Statistics about message queue
} msgid_ds;


//! Kernel shared memory info structure
typedef struct shm_info_s {
    size_t     shm_segsz;           //! Size of segment in bytes.
    pid_t      shm_lpid;            //! Process ID of last shared memory operation.
    pid_t      shm_cpid;            //! Process ID of creator.
    shmatt_t   shm_nattch;          //! Number of current attaches.
    void*      shm_addr;            //! Shared memory pointer
    int        shm_id;              //! ID of this SHM struct
    key_t      shm_key;             //! Associated key
} shm_info_t;

#ifdef __cplusplus
}      
#endif

#endif // _KTYPES_H

 

Message Edited by palani.ts on 12-18-2008 01:27 AM
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Visitor
Visitor
23,376 Views
Registered: ‎07-15-2008

I added 'xil' library to libraries compiled with earlier - i.e xilkernel and lwip4, and the problem was solved

 

 

I haven't included xmk.h, but the code is compiled with the libraries lxilkernel and llwip4, Do I still need to include xmk.h?

 

Inclusion of this header file makes no difference to the result when i compile the code. :|

Message Edited by palani.ts on 12-18-2008 01:54 AM
Message Edited by palani.ts on 01-14-2009 04:11 AM

View solution in original post

0 Kudos
7 Replies
Highlighted
Xilinx Employee
Xilinx Employee
21,068 Views
Registered: ‎01-18-2008

Do you see the error when you are compiling your code, or when you are generating libraries?

 

If it is your code, then check if xmk.h is included as your first header file.

 

It would also help if you could post a small example of a C file that shows the error when compiled.

0 Kudos
Highlighted
Visitor
Visitor
23,377 Views
Registered: ‎07-15-2008

I added 'xil' library to libraries compiled with earlier - i.e xilkernel and lwip4, and the problem was solved

 

 

I haven't included xmk.h, but the code is compiled with the libraries lxilkernel and llwip4, Do I still need to include xmk.h?

 

Inclusion of this header file makes no difference to the result when i compile the code. :|

Message Edited by palani.ts on 12-18-2008 01:54 AM
Message Edited by palani.ts on 01-14-2009 04:11 AM

View solution in original post

0 Kudos
Highlighted
Explorer
Explorer
19,311 Views
Registered: ‎01-09-2009

palani.ts

 

I have the same problem, Could you elaborate how you did that? because I add xil library, but it does not work. Would you let me know where you specify that?

 

Thanks,

0 Kudos
Highlighted
Anonymous
Not applicable
18,211 Views

can u please elaborate...im still getting the same error

thank you

0 Kudos
Highlighted
Newbie
Newbie
17,503 Views
Registered: ‎12-14-2010

You have to include "xmk.h" before <stdio.h>.

 

0 Kudos
Highlighted
Observer
Observer
16,884 Views
Registered: ‎12-24-2009

it worked for me too, thanks a lot!

0 Kudos
Highlighted
Visitor
Visitor
1,671 Views
Registered: ‎06-09-2019

Hello I think I have almost a similer problem, and I can,t solve it. which is "expected specifier-qualifier-list before ‘UINTPTR’" Anyone has come accrose this problem please help. I'm really stuck  on it for the whole day today.

 

Thanks a lot in advance.

0 Kudos