1 Index: libgm/gm_register.c
2 ===================================================================
3 RCS file: /repository/gm/libgm/gm_register.c,v
4 retrieving revision 1.9.16.3
5 diff -u -r1.9.16.3 gm_register.c
6 --- libgm/gm_register.c 9 Aug 2005 14:37:02 -0000 1.9.16.3
7 +++ libgm/gm_register.c 25 Aug 2005 21:35:58 -0000
14 -gm_register_memory_ex (gm_port_t *p, void *_ptr, gm_size_t length, void *_pvma)
16 +_gm_register_memory (gm_port_t *p, int is_physical, gm_u64_t ptr, gm_size_t length, gm_up_t pvma)
22 GM_CALLED_WITH_ARGS (("%p,%p,"GM_U64_TMPL",%p",
23 p, _ptr, GM_U64_ARG (length), _pvma));
25 - ptr = GM_PTR_TO_UP (_ptr);
26 - pvma = GM_PTR_TO_UP (_pvma);
28 #if !GM_KERNEL && !GM_CAN_REGISTER_MEMORY
29 GM_PARAMETER_MAY_BE_UNUSED (p);
30 GM_PARAMETER_MAY_BE_UNUSED (ptr);
32 status = gm_add_mapping_to_page_table (ps,
35 - GM_INVALID_DMA_PAGE);
36 + is_physical ? ptr + offset : GM_INVALID_DMA_PAGE);
37 if (status != GM_SUCCESS)
39 status = GM_INVALID_PARAMETER;
44 +#if GM_KERNEL && (GM_CPU_x86 || GM_CPU_x86_64 || GM_CPU_ia64)
45 +/* only architecture where pci bus addr == physical address can use
46 + such a simple scheme */
47 +GM_ENTRY_POINT gm_status_t
48 +gm_register_memory_ex_phys (struct gm_port *p,
49 + gm_u64_t phys, gm_size_t length,
52 + return _gm_register_memory(p, 1, phys, length, (gm_size_t)pvma);
56 +GM_ENTRY_POINT gm_status_t
57 +gm_register_memory_ex (gm_port_t *p, void *ptr, gm_size_t length, void *pvma)
59 + return _gm_register_memory(p, 0, (gm_size_t)ptr, length, (gm_size_t)pvma);
62 GM_ENTRY_POINT gm_status_t
63 gm_register_memory (gm_port_t *p, void *ptr, gm_size_t length)
67 GM_CALLED_WITH_ARGS (("%p,%p,"GM_U64_TMPL, p, ptr, GM_U64_ARG (length)));
68 - status = gm_register_memory_ex (p, ptr, length, ptr);
69 + status = _gm_register_memory(p, 0, (gm_size_t)ptr, length, (gm_size_t)ptr);
70 GM_RETURN_STATUS (status);
74 ===================================================================
75 RCS file: /repository/gm/include/gm.h,v
76 retrieving revision 1.25.10.11
77 diff -u -r1.25.10.11 gm.h
78 --- include/gm.h 14 Mar 2005 21:42:41 -0000 1.25.10.11
79 +++ include/gm.h 25 Aug 2005 21:35:58 -0000
80 @@ -2676,6 +2676,10 @@
81 GM_ENTRY_POINT gm_status_t gm_register_memory_ex (struct gm_port *p,
82 void *ptr, gm_size_t length,
85 +GM_ENTRY_POINT gm_status_t gm_register_memory_ex_phys (struct gm_port *p,
86 + gm_u64_t phys, gm_size_t length,
88 #endif /* GM_API_VERSION >= GM_API_VERSION_2_0_6 */
90 #if GM_API_VERSION >= GM_API_VERSION_2_1_0
91 Index: libgm/gm_reference_api.c
92 ===================================================================
93 RCS file: /repository/gm/libgm/gm_reference_api.c,v
94 retrieving revision 1.3.14.1
95 diff -u -r1.3.14.1 gm_reference_api.c
96 --- libgm/gm_reference_api.c 23 Apr 2004 20:27:29 -0000 1.3.14.1
97 +++ libgm/gm_reference_api.c 25 Aug 2005 22:39:20 -0000
99 GM_REF (gm_register_buffer);
100 GM_REF (gm_register_memory);
101 GM_REF (gm_register_memory_ex);
102 +#if GM_KERNEL && (GM_CPU_x86 || GM_CPU_x86_64 || GM_CPU_ia64)
103 +GM_REF (gm_register_memory_ex_phys);
105 GM_REF (gm_resume_sending);
107 GM_REF (gm_send_to_peer);