Skip to content

Commit

Permalink
drm: Fix drm.h uapi header for Windows
Browse files Browse the repository at this point in the history
This will allow Mesa to port code to Windows more easily.

Hide BSD header and drm_handle_t behind _WIN32 check.

Change __volatile__ to volatile, which is standard.

Signed-off-by: James Park <jpark37@lagfreegames.com>
  • Loading branch information
James Park committed Dec 2, 2020
1 parent b650545 commit 648e928
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions include/uapi/drm/drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ typedef unsigned int drm_handle_t;
#include <asm/ioctl.h>
typedef unsigned int drm_handle_t;

#else /* One of the BSDs */
#else

#include <stdint.h>
#include <sys/ioccom.h>
#include <sys/types.h>
typedef int8_t __s8;
typedef uint8_t __u8;
Expand All @@ -62,10 +61,16 @@ typedef uint32_t __u32;
typedef int64_t __s64;
typedef uint64_t __u64;
typedef size_t __kernel_size_t;

#ifndef _WIN32 /* One of the BSDs */

#include <sys/ioccom.h>
typedef unsigned long drm_handle_t;

#endif

#endif

#if defined(__cplusplus)
extern "C" {
#endif
Expand Down Expand Up @@ -128,7 +133,7 @@ struct drm_tex_region {
* other data stored in the same cache line.
*/
struct drm_hw_lock {
__volatile__ unsigned int lock; /**< lock variable */
volatile unsigned int lock; /**< lock variable */
char padding[60]; /**< Pad to cache line */
};

Expand Down

0 comments on commit 648e928

Please sign in to comment.