back ported setsched syscall for new scheduler
Marc Fiuczynski [Sat, 18 Jun 2005 05:56:14 +0000 (05:56 +0000)]
lib/Makefile-files
lib/vserver-internal.h
lib/vserver.h

index c193cd6..5404f72 100644 (file)
@@ -19,6 +19,7 @@
 
 lib_SRCS                       =  lib/syscall.c \
                                   lib/syscall_rlimit.c \
+                                  lib/syscall_setsched.c \
                                   lib/syscall_kill.c \
                                   lib/checkversion.c \
                                   lib/getctx.c \
@@ -30,6 +31,7 @@ lib_HDRS                      =  lib/vserver.h
 lib_XHDRS                       =  lib/syscall-compat.hc \
                                   lib/syscall-legacy.hc \
                                   lib/syscall_rlimit-v11.hc \
+                                  lib/syscall_setsched-v13.hc \
                                   lib/syscall_kill-v11.hc \
                                   lib/getctx-compat.hc \
                                   lib/getctx-legacy.hc \
index bb9b7db..972f301 100644 (file)
 extern "C" {
 #endif
 
+#define ENSC_STRUCT_IDX(STRUCT,ATTR)                   \
+  ((char*)(&(STRUCT).ATTR) - (char*)(&(STRUCT)))
+#define ENSC_SAME_STRUCT_IDX(LHS,RHS,ATTR)                     \
+  (ENSC_STRUCT_IDX(LHS,ATTR) == ENSC_STRUCT_IDX(RHS,ATTR))
+#define ENSC_SAME_STRUCT_ITEM(LHS,RHS,ATTR)    \
+  (ENSC_SAME_STRUCT_IDX(LHS,RHS,ATTR) &&       \
+   sizeof((LHS).ATTR)==sizeof((RHS).ATTR) &&   \
+   sizeof(LHS)==sizeof(RHS))
+
 #ifndef HAVE_VSERVER
 #ifdef ENSC_SYSCALL_TRADITIONAL
 inline static UNUSED ALWAYSINLINE
index 284f4a4..4f9205a 100644 (file)
 #define VC_LIM_INFINITY                (~0ULL)
 #define VC_LIM_KEEP            (~1ULL)
 
+#define VC_VXSM_FILL_RATE              0x0001
+#define VC_VXSM_INTERVAL               0x0002
+#define VC_VXSM_TOKENS                 0x0010
+#define VC_VXSM_TOKENS_MIN             0x0020
+#define VC_VXSM_TOKENS_MAX             0x0040
+#define VC_VXSM_PRIO_BIAS              0x0100
+
+
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -81,6 +90,19 @@ extern "C" {
   int  vc_get_rlimit_mask(xid_t ctx, struct vc_rlimit_mask *lim);
 
 
+#define VC_CAT_SCHED           14
+  struct vc_set_sched {
+      uint_least32_t   set_mask;
+      int_least32_t    fill_rate;
+      int_least32_t    interval;
+      int_least32_t    tokens;
+      int_least32_t    tokens_min;
+      int_least32_t    tokens_max;
+      int_least32_t    priority_bias;
+  };
+
+  int          vc_set_sched(xid_t xid, struct vc_set_sched const *);
+
   /** sends a signal to a context/pid
       Special values for pid are:
       * -1   which means every process in ctx except the init-process