1 Star 0 Fork 19

张攀/libdrm

forked from src-openEuler/libdrm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
libdrm-2.4.109-sw.patch 3.07 KB
一键复制 编辑 原始数据 按行查看 历史
周文培 提交于 2022-11-18 03:38 . Add sw64 architecture
diff -Nuar libdrm-2.4.109.org/include/drm/drm_sarea.h libdrm-2.4.109.sw/include/drm/drm_sarea.h
--- libdrm-2.4.109.org/include/drm/drm_sarea.h 2022-02-26 01:16:04.810000000 +0000
+++ libdrm-2.4.109.sw/include/drm/drm_sarea.h 2022-02-26 04:13:03.090000000 +0000
@@ -39,7 +39,9 @@
#endif
/* SAREA area needs to be at least a page */
-#if defined(__alpha__)
+#if defined(__sw_64__)
+#define SAREA_MAX 0x2000U
+#elif defined(__alpha__)
#define SAREA_MAX 0x2000U
#elif defined(__mips__)
#define SAREA_MAX 0x4000U
diff -Nuar libdrm-2.4.109.org/xf86drm.c libdrm-2.4.109.sw/xf86drm.c
--- libdrm-2.4.109.org/xf86drm.c 2022-02-26 01:16:04.840000000 +0000
+++ libdrm-2.4.109.sw/xf86drm.c 2022-02-26 02:33:50.700000000 +0000
@@ -1044,7 +1044,7 @@
sv.drm_dd_major = -1; /* Don't care */
sv.drm_dd_minor = -1; /* Don't care */
if (drmSetInterfaceVersion(fd, &sv)) {
-#ifndef __alpha__
+#ifndef __sw_64__
pci_domain_ok = 0;
#endif
sv.drm_di_major = 1;
diff -Nuar libdrm-2.4.109.org/xf86drm.h libdrm-2.4.109.sw/xf86drm.h
--- libdrm-2.4.109.org/xf86drm.h 2022-02-26 01:16:04.840000000 +0000
+++ libdrm-2.4.109.sw/xf86drm.h 2022-02-26 04:11:01.090000000 +0000
@@ -382,6 +382,34 @@
"r" (new)); \
} while (0)
+#elif defined(__sw_64__)
+#define DRM_CAS(lock, old, new, ret) \
+ do{ \
+ int tmp, old32; \
+ int tmp1; \
+ __asm__ __volatile__( \
+ " addw $31, %6, %4\n" \
+ " ldi %1, %3\n" \
+ "1: lldw %0, 0(%1)\n" \
+ " cmpeq %0, %4, %2\n" \
+ " wr_f %2\n" \
+ " mov %5, %0\n" \
+ " lstw %0, 0(%1)\n" \
+ " rd_f %0\n" \
+ " beq %2, 2f\n" \
+ " beq %0, 3f\n" \
+ " memb\n" \
+ "2: cmpeq %2, 0, %2\n" \
+ ".subsection 2\n" \
+ "3: br 1b\n" \
+ ".previous" \
+ : "=&r"(tmp),"=&r"(tmp1), "=&r"(ret), \
+ "=m"(__drm_dummy_lock(lock)), \
+ "=&r"(old32) \
+ : "r"(new), "r"(old) \
+ : "memory"); \
+ } while (0)
+
#elif defined(__alpha__)
#define DRM_CAS(lock, old, new, ret) \
@@ -511,7 +539,9 @@
#define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */
#endif
-#if defined(__alpha__)
+#if defined(__sw_64__)
+#define DRM_CAS_RESULT(_result) long _result
+#elif defined(__alpha__)
#define DRM_CAS_RESULT(_result) long _result
#elif defined(__powerpc__)
#define DRM_CAS_RESULT(_result) int _result
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zppzhangpan/libdrm.git
git@gitee.com:zppzhangpan/libdrm.git
zppzhangpan
libdrm
libdrm
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385