Skip to contentSkip to conversation

updated salinfo patch

Linux-ia64 Jesse Barnes 2 participants 3 messages Dec 12, 2001

lore
Share & tools
lore
#0 lore raw

David, you mentioned that I should resend this patch, so here it is. It's against 2.4.16 with the latest ia64 patch applied.

Jesse

arch/ia64/kernel/Makefile +1 -1
diff -Naur linux-2.4.16-ia64/arch/ia64/kernel/Makefile linux-2.4.16-salinfo/arch/ia64/kernel/Makefile
@@ -15,7 +15,7 @@
 
 obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o irq.o irq_ia64.o irq_lsapic.o ivt.o \
 	 machvec.o pal.o process.o perfmon.o ptrace.o sal.o semaphore.o setup.o	\
-	 signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o
+	 signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o salinfo.o
 obj-$(CONFIG_IA64_GENERIC) += iosapic.o
 obj-$(CONFIG_IA64_DIG) += iosapic.o
 obj-$(CONFIG_IA64_PALINFO) += palinfo.o
arch/ia64/kernel/sal.c +7 -4
diff -Naur linux-2.4.16-ia64/arch/ia64/kernel/sal.c linux-2.4.16-salinfo/arch/ia64/kernel/sal.c
@@ -19,6 +19,7 @@
 #include <asm/pal.h>
 
 spinlock_t sal_lock = SPIN_LOCK_UNLOCKED;
+unsigned long sal_platform_features = 0;
 
 static struct {
 	void *addr;	/* function entry point */
@@ -152,12 +153,12 @@
 		      case SAL_DESC_PLATFORM_FEATURE:
 		      {
 			      struct ia64_sal_desc_platform_feature *pf = (void *) p;
+			      sal_platform_features = pf->feature_mask;
 			      printk("SAL: Platform features ");
 
-			      if (pf->feature_mask & (1 << 0))
+			      if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_BUS_LOCK)
 				      printk("BusLock ");
-
-			      if (pf->feature_mask & (1 << 1)) {
+			      if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT) {
 				      printk("IRQ_Redirection ");
 #ifdef CONFIG_SMP
 				      if (no_int_routing)
@@ -166,7 +167,7 @@
 					      smp_int_redirect |= SMP_IRQ_REDIRECTION;
 #endif
 			      }
-			      if (pf->feature_mask & (1 << 2)) {
+			      if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT) {
 				      printk("IPI_Redirection ");
 #ifdef CONFIG_SMP
 				      if (no_int_routing) 
@@ -175,6 +176,8 @@
 					      smp_int_redirect |= SMP_IPI_REDIRECTION;
 #endif
 			      }
+			      if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_ITC_MAY_DRIFT)
+				      printk("ITC_may_drift ");
 			      printk("\n");
 			      break;
  		      }
arch/ia64/kernel/salinfo.c +104 -0

104 lines not on this page · raw message

include/asm-ia64/sal.h +3 -0
diff -Naur linux-2.4.16-ia64/include/asm-ia64/sal.h linux-2.4.16-salinfo/include/asm-ia64/sal.h
@@ -149,6 +149,7 @@
 #define IA64_SAL_PLATFORM_FEATURE_BUS_LOCK		(1 << 0)
 #define IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT	(1 << 1)
 #define IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT	(1 << 2)
+#define IA64_SAL_PLATFORM_FEATURE_ITC_MAY_DRIFT 	(1 << 3)
 
 typedef struct ia64_sal_desc_platform_feature {
 	u8 type;
@@ -775,5 +776,7 @@
 		*scratch_buf_size_needed = isrv.v1;
 	return isrv.status;
 }
+
+extern unsigned long sal_platform_features;
 
 #endif /* _ASM_IA64_PAL_H */
#1 lore raw

arch/ia64/kernel/salinfo.c line 19

Quoted 2 lines · Jesse Barnes
arch/ia64/kernel/salinfo.c +2 -0
+MODULE_AUTHOR("Jesse Barnes <[email protected]>");
+MODULE_DESCRIPTION("/proc interface to IA-64 SAL features");

Better add MODULE_LICENSE("GPL");

Quoted 1 line

+int salinfo_read(char *page, char **start, off_t off, int count, int *eof, void *data);

Is there any reason to expose salinfo_read, AFAICT it can be static. If you want to expose that function, you need EXPORT_SYMBOL(salinfo_read) and salinfo.o must be added to export-objs.

#2 lore raw
In reply to Jesse Barnes

Thanks for the feedback. Here's another one.

Jesse

Quoted 7 lines · Keith Owens

Review

Quoted 2 lines · Jesse Barnes
(quoted diff) +2 -0
+MODULE_AUTHOR("Jesse Barnes <[email protected]>");
+MODULE_DESCRIPTION("/proc interface to IA-64 SAL features");

Better add MODULE_LICENSE("GPL");

Quoted 5 lines
Quoted 1 line

+int salinfo_read(char *page, char **start, off_t off, int count, int *eof, void *data);

Is there any reason to expose salinfo_read, AFAICT it can be static. If you want to expose that function, you need EXPORT_SYMBOL(salinfo_read) and salinfo.o must be added to export-objs.

arch/ia64/kernel/Makefile +1 -1
diff -Naur linux-2.4.16-ia64/arch/ia64/kernel/Makefile linux-2.4.16-salinfo/arch/ia64/kernel/Makefile
@@ -15,7 +15,7 @@
 
 obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o irq.o irq_ia64.o irq_lsapic.o ivt.o \
 	 machvec.o pal.o process.o perfmon.o ptrace.o sal.o semaphore.o setup.o	\
-	 signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o
+	 signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o salinfo.o
 obj-$(CONFIG_IA64_GENERIC) += iosapic.o
 obj-$(CONFIG_IA64_DIG) += iosapic.o
 obj-$(CONFIG_IA64_PALINFO) += palinfo.o
arch/ia64/kernel/sal.c +7 -4
diff -Naur linux-2.4.16-ia64/arch/ia64/kernel/sal.c linux-2.4.16-salinfo/arch/ia64/kernel/sal.c
@@ -19,6 +19,7 @@
 #include <asm/pal.h>
 
 spinlock_t sal_lock = SPIN_LOCK_UNLOCKED;
+unsigned long sal_platform_features = 0;
 
 static struct {
 	void *addr;	/* function entry point */
@@ -152,12 +153,12 @@
 		      case SAL_DESC_PLATFORM_FEATURE:
 		      {
 			      struct ia64_sal_desc_platform_feature *pf = (void *) p;
+			      sal_platform_features = pf->feature_mask;
 			      printk("SAL: Platform features ");
 
-			      if (pf->feature_mask & (1 << 0))
+			      if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_BUS_LOCK)
 				      printk("BusLock ");
-
-			      if (pf->feature_mask & (1 << 1)) {
+			      if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT) {
 				      printk("IRQ_Redirection ");
 #ifdef CONFIG_SMP
 				      if (no_int_routing)
@@ -166,7 +167,7 @@
 					      smp_int_redirect |= SMP_IRQ_REDIRECTION;
 #endif
 			      }
-			      if (pf->feature_mask & (1 << 2)) {
+			      if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT) {
 				      printk("IPI_Redirection ");
 #ifdef CONFIG_SMP
 				      if (no_int_routing) 
@@ -175,6 +176,8 @@
 					      smp_int_redirect |= SMP_IPI_REDIRECTION;
 #endif
 			      }
+			      if (pf->feature_mask & IA64_SAL_PLATFORM_FEATURE_ITC_MAY_DRIFT)
+				      printk("ITC_may_drift ");
 			      printk("\n");
 			      break;
  		      }
arch/ia64/kernel/salinfo.c +105 -0

105 lines not on this page · raw message

include/asm-ia64/sal.h +3 -0
diff -Naur linux-2.4.16-ia64/include/asm-ia64/sal.h linux-2.4.16-salinfo/include/asm-ia64/sal.h
@@ -149,6 +149,7 @@
 #define IA64_SAL_PLATFORM_FEATURE_BUS_LOCK		(1 << 0)
 #define IA64_SAL_PLATFORM_FEATURE_IRQ_REDIR_HINT	(1 << 1)
 #define IA64_SAL_PLATFORM_FEATURE_IPI_REDIR_HINT	(1 << 2)
+#define IA64_SAL_PLATFORM_FEATURE_ITC_MAY_DRIFT 	(1 << 3)
 
 typedef struct ia64_sal_desc_platform_feature {
 	u8 type;
@@ -775,5 +776,7 @@
 		*scratch_buf_size_needed = isrv.v1;
 	return isrv.status;
 }
+
+extern unsigned long sal_platform_features;
 
 #endif /* _ASM_IA64_PAL_H */