BNX2X: limit queues to 2
[akaros.git] / kern / include / ros / event.h
index 08bdab4..44327af 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <ros/common.h>
 #include <ros/atomic.h>
-#include <ros/arch/trapframe.h>
+#include <ros/trapframe.h>
 /* #include <ros/ucq.h> included below */
 
 /* Event Delivery Flags from the process to the kernel */
@@ -46,7 +46,8 @@
 #define EV_FREE_APPLE_PIE               9
 #define EV_SYSCALL                             10
 #define EV_CHECK_MSGS                  11
-#define NR_EVENT_TYPES                 12 /* keep me last */
+#define EV_POSIX_SIGNAL                        12
+#define NR_EVENT_TYPES                 25 /* keep me last (and 1 > the last one) */
 
 /* Will probably have dynamic notifications later */
 #define MAX_NR_DYN_EVENT               25
@@ -91,6 +92,7 @@ struct event_queue {
 struct event_queue_big {
        struct event_mbox                       *ev_mbox;
        int                                                     ev_flags;
+       bool                                            ev_alert_pending;
        uint32_t                                        ev_vcore;
        void                                            (*ev_handler)(struct event_queue *);
        struct event_mbox                       ev_imbox;
@@ -99,19 +101,24 @@ struct event_queue_big {
 /* Vcore state flags.  K_LOCK means the kernel is writing */
 #define VC_K_LOCK                              0x001                           /* CASing with the kernel */
 #define VC_PREEMPTED                   0x002                           /* VC is preempted */
-#define VC_RECOVERING                  0x004                           /* VC being recovered */
+#define VC_CAN_RCV_MSG                 0x004                           /* can receive FALLBACK */
 #define VC_UTHREAD_STEALING            0x008                           /* Uthread being stolen */
+#define VC_SCP_NOVCCTX                 0x010                           /* can't go into vc ctx */
+
+/* Racy flags, where we don't need the atomics */
+#define VC_FPU_SAVED                   0x1000                          /* valid FPU state in anc */
 
 /* Per-core data about preemptions and notifications */
 struct preempt_data {
-       struct user_trapframe           preempt_tf;                     /* slot for vcore ctx */
+       struct user_context                     vcore_ctx;                      /* for preemptions */
        struct ancillary_state          preempt_anc;
-       struct user_trapframe           notif_tf;                       /* slot for uthread ctx */
+       struct user_context                     uthread_ctx;            /* for preempts or notifs */
        uintptr_t                                       transition_stack;       /* advertised by the user */
+       uintptr_t                                       vcore_tls_desc;         /* advertised by the user */
        atomic_t                                        flags;
+       int                                                     rflags;                         /* racy flags */
        bool                                            notif_disabled;         /* vcore unwilling to recv*/
        bool                                            notif_pending;          /* notif k_msg on the way */
-       bool                                            can_rcv_msg;            /* can receive FALLBACK */
        struct event_mbox                       ev_mbox_public;         /* can be read remotely */
        struct event_mbox                       ev_mbox_private;        /* for this vcore only */
 };