dropped never used future::wait_until and shared_future::wait_until

--- stingraykit/future.h
+++ stingraykit/future.h
@@ -164,9 +164,6 @@
 			future_status wait(const ICancellationToken& token)
 			{ MutexLock l(_mutex); return do_wait(token); }

-			future_status wait_until(const Time& absTime, const ICancellationToken& token)
-			{ MutexLock l(_mutex); return do_timed_wait(absTime - Time::Now(), token); }
-
 			T get()
 			{
 				MutexLock l(_mutex);
@@ -216,18 +213,6 @@

 				return future_status::ready;
 			}
-
-			future_status do_timed_wait(TimeDuration duration, const ICancellationToken& token)
-			{
-				if (is_ready())
-					return future_status::ready;
-
-				while (!is_ready() && token)
-					if (!_condition.TimedWait(_mutex, duration, token))
-						break;
-
-				return is_ready() ?	future_status::ready : future_status::timeout;
-			}
 		};

@@ -291,8 +276,8 @@

 		ResultType get() const			{ check_valid(); return _impl->get(); }

-		future_status wait(const ICancellationToken& token = DummyCancellationToken()) const							{ check_valid(); return _impl->wait(token); }
-		future_status wait_until(const Time& absTime, const ICancellationToken& token = DummyCancellationToken()) const	{ check_valid(); return _impl->wait_until(absTime, token); }
+		future_status wait(const ICancellationToken& token = DummyCancellationToken()) const
+		{ check_valid(); return _impl->wait(token); }

 	private:
 		shared_future(const ImplPtr& impl) : _impl(impl) {}
@@ -333,8 +318,8 @@
 			return impl->get();
 		}

-		future_status wait(const ICancellationToken& token = DummyCancellationToken()) const							{ check_valid(); return _impl->wait(token); }
-		future_status wait_until(const Time& absTime, const ICancellationToken& token = DummyCancellationToken()) const { check_valid(); return _impl->wait_until(absTime, token); }
+		future_status wait(const ICancellationToken& token = DummyCancellationToken()) const
+		{ check_valid(); return _impl->wait(token); }

 	private:
 		future(const ImplTypePtr& impl) : _impl(impl) {}


future: remove ugly callback stuff

future: remove ugly callback stuff

1)this is signal-alike crutch, but signals is better

2)was never used

3)any attempts to use will be rejected on code-review: 'write normal code, not crutches'

4)can cleanup some headers, hehehe

--- stingraykit/future.h
+++ stingraykit/future.h
@@ -9,9 +9,6 @@
 // WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

 #include <stingraykit/exception_ptr.h>
-#include <stingraykit/FunctionToken.h>
-#include <stingraykit/function/bind.h>
-#include <stingraykit/TaskLifeToken.h>
 #include <stingraykit/thread/ConditionVariable.h>
 #include <stingraykit/thread/DummyCancellationToken.h>

@@ -60,29 +57,6 @@
 		};

-		template<typename ResultType>
-		struct future_callback
-		{
-			typedef function<void()> FunctionType;
-
-		private:
-			FunctionType			_function;
-			FutureExecutionTester	_tester;
-
-		public:
-			future_callback(const FunctionType& function, const FutureExecutionTester& tester) : _function(function), _tester(_tester)
-			{ }
-
-			void invoke()
-			{
-				LocalExecutionGuard guard(_tester);
-
-				if (guard)
-					_function();
-			}
-		};
-
-
 		template<typename T>
 		class future_result
 		{
@@ -138,17 +112,12 @@
 		template<typename T>
 		class future_impl_base
 		{
-		public:
-			typedef future_callback<T> Callback;
-			typedef typename Callback::FunctionType CallbackFunction;
-
 		protected:
 			typedef future_result<T> ResultType;

 			Mutex					_mutex;
 			ConditionVariable		_condition;
 			ResultType				_result;
-			optional<Callback>		_callback;

 		public:
 			bool is_ready() const						{ MutexLock l(_mutex); return _result.has_value() || _result.has_exception(); }
@@ -165,18 +134,6 @@
 				return _result.get();
 			}

-			Token set_callback(const CallbackFunction& callback)
-			{
-				MutexLock l(_mutex);
-
-				TaskLifeToken lifeToken;
-
-				_callback.reset();
-				_callback = Callback(callback, lifeToken.GetExecutionTester());
-
-				 return MakeToken<FunctionToken>(bind(&TaskLifeToken::Release, lifeToken));
-			}
-
 			void set_exception(exception_ptr ex)
 			{
 				MutexLock l(_mutex);
@@ -189,11 +146,7 @@

 		protected:
 			void notify_ready()
-			{
-				_condition.Broadcast();
-				if (_callback)
-					_callback->invoke();
-			}
+			{ _condition.Broadcast(); }

 			future_status do_wait(const ICancellationToken& token)
 			{


Print coherency group related information in mali_print_info

--- examples/mali_print_info.c
+++ examples/mali_print_info.c
@@ -42,6 +42,12 @@
 #define MALI_PROPERTY_MAX_TASK_QUEUE 22
 #define MALI_PROPERTY_MAX_THREAD_GROUP_SPLIT 23
 #define MALI_PROPERTY_RAW_GPU_ID 55
+#define MALI_PROPERTY_COHERENCY_NUM_GROUPS 61
+#define MALI_PROPERTY_COHERENCY_NUM_CORE_GROUPS 62
+#define MALI_PROPERTY_COHERENCY_COHERENCY 63
+
+#define MALI_PROPERTY_COHERENCY_GROUP_0 64
+#define MALI_PROPERTY_COHERENCY_GROUP_15 79

 struct mali_device_properties {
   uint32_t id;
@@ -100,6 +106,9 @@
       {MALI_PROPERTY_MAX_TASK_QUEUE, "Max task queue"},
       {MALI_PROPERTY_MAX_THREAD_GROUP_SPLIT, "Max threadgroup split"},
       {MALI_PROPERTY_RAW_GPU_ID, "GPU ID"},
+      {MALI_PROPERTY_COHERENCY_NUM_GROUPS, "Coherency # groups"},
+      {MALI_PROPERTY_COHERENCY_NUM_CORE_GROUPS, "Coherency # core groups"},
+      {MALI_PROPERTY_COHERENCY_COHERENCY, "Coherency status"},
   };

   uint32_t num_properties =
@@ -137,6 +146,11 @@
         printf("  %s: %" PRId64 "\n", selected_properties[i].name, value);
       }
     }
+    if (MALI_PROPERTY_COHERENCY_GROUP_0 <= property_id &&
+        property_id <= MALI_PROPERTY_COHERENCY_GROUP_15) {
+      uint32_t group_id = property_id - MALI_PROPERTY_COHERENCY_GROUP_0;
+      printf("  Coherency group #%d core mask: %" PRId64 "\n", group_id, value);
+    }
   }

   free(buffer);


examples: release the buffer at user callback.

Signed-off-by: Takahiro YAMASHITA <8b9f03f78cb27351a99f79113f99e589b65190d5@gmail.com>

--- examples/out_lib/out_lib.c
+++ examples/out_lib/out_lib.c
@@ -26,7 +26,10 @@
     printf("[%s]",__FUNCTION__);
     msgpack_object_print(stdout, *(msgpack_object*)data);
     printf("\n");
-
+
+    /* User has to release the buffer. */
+    free(data);
+
     return 0;
 }


examples/readme_loop/ray: alternate version for the README

error: pathspec 'examples/readme_loop/ray.c' did not match any file(s) known to git

--- examples/readme_loop/ray.c
+++ examples/readme_loop/ray.c
@@ -0,0 +1,223 @@
+#include "ray.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#include "3dmath.h"
+
+#define LENGTH(array) (sizeof(array) / sizeof(array[0]))
+#define MAX(x, y) (x > y ? x : y)
+#define MIN(x, y) (x < y ? x : y)
+
+#define TAU 6.28318531
+
+#if __GNUC__ >= 3
+#  define unlikely(cond) __builtin_expect ((cond), 0)
+#  define likely(cond)   __builtin_expect ((cond), 1)
+#else
+#  define unlikely(cond) (cond)
+#  define likely(cond) (cond)
+#endif
+
+typedef struct {
+    float position[3];
+    float radius;
+    float diffuse[3];
+    float specular[3];
+    int subtract;
+} Object;
+
+typedef struct {
+    float position[3];
+    float diffuse[3];
+} Light;
+
+typedef struct {
+    pthread_mutex_t mutex;
+
+    int width, height;
+    unsigned char* buffer;
+    long next_line;
+} ThreadArg;
+
+static float* trace_vectors;
+static int trace_vectors_width, trace_vectors_height;
+
+static Object objects[] = {
+    {.position={-1.414, -1, -3}, .radius=1, .diffuse={.8, .0, .8}, .specular={.7, .6, .7}, .subtract=0},
+    {.position={0, 1.414, -3}, .radius=1, .diffuse={.0, .8, .8}, .specular={.6, .7, .7}, .subtract=0},
+    {.position={0, 0, -3}, .radius=1.5, .diffuse={.8, .8, .8}, .specular={.7, .7, .7}, .subtract=1},
+    {.position={1.414, -1, -3}, .radius=1, .diffuse={.8, .8, .0}, .specular={.7, .7, .6}, .subtract=0},
+    {.position={0, 0, -3}, .radius=1.1, .diffuse={.9, .9, .9}, .specular={.9, .9, .9}, .subtract=2}
+};
+static const Light lights[] = {
+    {.position={-3, 3, -4}, .diffuse={0, .6, .6}},
+    {.position={0, 30, -4}, .diffuse={1, 1, 1}}
+};
+static const float ambient[3] = {0.2, 0.1, 0.1};
+
+static void
+trace(const float s[3], const float d[3], float pixel[3], int n) {
+    // Reflections in concave objects can go really deep, so we need to limit
+    // the recursion depth.
+    if (n > 6) return;
+
+    float nearest = HUGE_VAL;
+    int nearest_object = -1;
+    float nearest_y[3];
+    float nearest_r[3];
+
+    for(size_t j = 0; j < LENGTH(objects); ++j) {
+        float r[3], t, y[3];
+
+        if (objects[j].subtract == 1) continue;
+
+        t = sphere_intersect(y, r, s, d, objects[j].position, objects[j].radius, 0);
+
+        if(likely(t <= 0) || t > nearest)
+          continue;
+
+        if (objects[j].subtract == 0) {
+          size_t k;
+          for (k = 0; k < LENGTH(objects); ++k) {
+              if (!objects[k].subtract) continue;
+              if (POW2(y[0] - objects[k].position[0]) + POW2(y[1] - objects[k].position[1]) + POW2(y[2] - objects[k].position[2]) > POW2(objects[k].radius)) continue;
+
+              t = sphere_intersect(y, r, s, d, objects[k].position, objects[k].radius, 1);
+
+              break;
+          }
+
+          if(likely(t <= 0) || t > nearest)
+            continue;
+        }
+
+        nearest = t;
+        nearest_object = j;
+        memcpy(nearest_y, y, sizeof(nearest_y));
+        memcpy(nearest_r, r, sizeof(nearest_y));
+    }
+
+    if (nearest_object == -1) return;
+
+    trace(nearest_y, nearest_r, pixel, n + 1);
+
+    for (int k = 0; k < 3; ++k)
+        pixel[k] = pixel[k] * objects[nearest_object].specular[k] + ambient[k] * objects[nearest_object].diffuse[k];
+
+    for(int m = 0; m < LENGTH(lights); ++m) {
+        float l[3];
+        for(int i = 0; i < 3; ++i)
+            l[i] = lights[m].position[i] - nearest_y[i];
+
+        float lr_dot = dot(l, nearest_r);
+        if (lr_dot <= 0) continue;
+
+        float scale = lr_dot / sqrtf(dot(l, l)) / (1 << n);
+        // The cutoff at 0.05 is for artistic reasons; 0.0 would be more
+        // realistic.
+        if (scale <= 0.05) continue;
+
+        for(int k = 0; k < 3; ++k)
+            pixel[k] += lights[m].diffuse[k] * objects[nearest_object].diffuse[k] * scale;
+    }
+}
+
+static void
+trace_line(int l, int width, unsigned char *buf) {
+    static const float s[3] = {0, 0, 8};
+
+    for(int i = 0; i < width; ++i, buf += 4) {
+        float pixel[3] = { 0, 0, 0 };
+
+        trace(s, &trace_vectors[(l * width + i) * 3], pixel, 1);
+
+        buf[0] = MIN(pixel[0], 1.0f) * 255;
+        buf[1] = MIN(pixel[1], 1.0f) * 255;
+        buf[2] = MIN(pixel[2], 1.0f) * 255;
+    }
+}
+
+static void *
+thread(void *arg) {
+    ThreadArg* thread_arg = arg;
+
+    for (;;) {
+        pthread_mutex_lock(&thread_arg->mutex);
+        if (thread_arg->next_line == thread_arg->height) break;
+        long line = thread_arg->next_line++;
+        pthread_mutex_unlock(&thread_arg->mutex);
+
+        trace_line(line, thread_arg->width, thread_arg->buffer + line * 4 * thread_arg->width);
+    }
+
+    pthread_mutex_unlock(&thread_arg->mutex);
+
+    return NULL;
+}
+
+static void
+initialize_trace_vectors(int width, int height) {
+    trace_vectors = calloc(width * height, 3 * sizeof(float));
+    trace_vectors_width = width;
+    trace_vectors_height = height;
+    for(int y = 0; y < height; ++y) {
+        for(int x = 0; x < width; ++x) {
+          float* d = &trace_vectors[(y * width + x) * 3];
+          d[0] = ((float)x / width - 0.5f) * 0.5f * ((float)width / height);
+          d[1] = ((float)y / height - 0.5f) * 0.5f;
+          d[2] = -1;
+          normalize(d);
+        }
+    }
+}
+
+void
+trace_scene(float time, int width, int height, unsigned char *buf, int threaded) {
+    if (trace_vectors && (trace_vectors_width != width || trace_vectors_height != height)) {
+      free(trace_vectors);
+      trace_vectors = 0;
+    }
+    if (!trace_vectors)
+      initialize_trace_vectors(width, height);
+
+    objects[0].position[0] = (1.5 + 0.35 * sin(1.0 * time + 0.0)) * cos(0.5 * time);
+    objects[0].position[1] = (1.5 + 0.35 * sin(1.0 * time + 2.5)) * sin(0.5 * time);
+    objects[1].position[0] = (1.5 + 0.35 * sin(1.0 * time + 2.0)) * cos(0.5 * time + 1/3. * TAU);
+    objects[1].position[1] = (1.5 + 0.35 * sin(1.0 * time + 1.5)) * sin(0.5 * time + 1/3. * TAU);
+    objects[3].position[0] = (1.5 + 0.35 * sin(1.0 * time + 1.0)) * cos(0.5 * time + 2/3. * TAU);
+    objects[3].position[1] = (1.5 + 0.35 * sin(1.0 * time + 0.5)) * sin(0.5 * time + 2/3. * TAU);
+    objects[2].position[2] = -3 + 0.2 * sin(time * 1.0);
+    memcpy(objects[4].position, objects[2].position, sizeof(objects[4].position));
+
+    if(threaded) {
+        ThreadArg arg;
+        memset(&arg, 0, sizeof(arg));
+        arg.width = width;
+        arg.height = height;
+        pthread_mutex_init(&arg.mutex, NULL);
+        arg.buffer = buf;
+
+        int num_threads = sysconf(_SC_NPROCESSORS_CONF) - 1;
+        pthread_t* threads = NULL;
+        if (num_threads > 0) {
+          threads = calloc(sizeof(*threads), num_threads);
+
+          for (int i = 0; i < num_threads; ++i)
+            pthread_create(&threads[i], NULL, thread, &arg);
+        }
+
+        thread(&arg);
+
+        for(int i = 0; i < num_threads; ++i)
+            pthread_join(threads[i], NULL);
+        free(threads);
+    } else {
+        for(int i = 0; i < height; ++i)
+            trace_line(i, width, buf + i * 4 * width);
+    }
+}


examples: Add missing include for stderr.

This should fix the build on FreeBSD.

--- examples/ssh_server_fork.c
+++ examples/ssh_server_fork.c
@@ -37,6 +37,7 @@
 #endif
 #include <sys/ioctl.h>
 #include <sys/wait.h>
+#include <stdio.h>

 #ifndef KEYS_FOLDER
 #ifdef _WIN32


coap-server: fixed broken ifdef statement

an ifdef was removed leaving the endif in place, this restores
the origin ifdef.

Change-Id: Ibc4863e3d09c1c09525276ca8ae4aa9e52fbd568
Signed-off-by: Anas Nashif <0d9952ec84ac43c159f6b7e7ed99a9080c00dd6e@intel.com>

--- samples/network/coap_server/src/coap-server.c
+++ samples/network/coap_server/src/coap-server.c
@@ -33,6 +33,7 @@

 #include <zephyr.h>

+#ifdef CONFIG_NANOKERNEL
 #if defined(CONFIG_TINYDTLS)
 /* DTLS needs bigger stack */
 #define STACKSIZE 2500


remove global data put since not essential to a barrier test and it breaks on my mac

--- barrier_performance.c
+++ barrier_performance.c
@@ -64,11 +64,13 @@
   time_taken = 0;

   for (i=0;i<10000;i++){
+#if 0
     if (me != 0) {
       shmem_int_p(&x,src*(i+1), me-1);
     }
     else
       shmem_int_p(&x,src*(i+1), npes-1);
+#endif
     shmem_barrier_all();

     gettimeofday(&start, NULL);


From Sergei Linev:
1) In normal constructor I add new argument - mother of directory.
   If it is not specified (for instance, if user creates TDirectory himself), gDirectory will be used.
   In principle, fMother was before, but now it consecutively used in most TDirecory methods, related to
   parent/child relationship.
2) Together with directory fMother member file pointer fFile propogated to all childs.
   Consequently, each directory knows to which file it belongs.
3) When streamed from the file, fFile memeber is assigned from TBuffer::GetParent(). fFile is enougth
   to read keys from the file. Mother directory is assigned later in TKey::ReadObj().

TDirectory::GetPath() uses static variable and will fails in multithread application.
   I introduce new GetPath() method and TString fPathBuffer to produce correct full path.
   Old code was moved in GetPathStatic() method. To optimize memory usage, one can replace TString
   by const char* (as it was before).

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@13910 27541ba8-7e3a-0410-8455-c3a389f83636

--- base/inc/TDirectory.h
+++ base/inc/TDirectory.h
@@ -1,4 +1,4 @@
-// @(#)root/base:$Name:  $:$Id: TDirectory.h,v 1.30 2005/09/30 08:52:23 pcanal Exp $
+// @(#)root/base:$Name:  $:$Id: TDirectory.h,v 1.31 2005/11/18 17:44:16 pcanal Exp $
 // Author: Rene Brun   28/11/94

 /*************************************************************************
@@ -58,12 +58,14 @@
    TList      *fList;            //Pointer to objects list in memory
    TList      *fKeys;            //Pointer to keys list in memory
    TUUID       fUUID;            //Unique identifier
+   TString     fPathBuffer;      //!Buffer for GetPath() function

           Bool_t cd1(const char *path);
    static Bool_t Cd1(const char *path);

    virtual TKey* CreateKey(const TObject* obj, const char* name, Int_t bufsize);
    virtual TKey* CreateKey(const void* obj, const TClass* cl, const char* name, Int_t bufsize);
+          void   FillFullPath(TString& buf) const;

 private:
    TDirectory(const TDirectory &directory);  //Directories cannot be copied
@@ -106,13 +108,13 @@
    };

    TDirectory();
-   TDirectory(const char *name, const char *title, Option_t *option="");
+   TDirectory(const char *name, const char *title, Option_t *option="", TDirectory* motherDir = 0);
    virtual ~TDirectory();
    virtual void        Append(TObject *obj);
            void        Add(TObject *obj) { Append(obj); }
            Int_t       AppendKey(TKey *key);
    virtual void        Browse(TBrowser *b);
-           void        Build();
+           void        Build(TFile* motherFile = 0, TDirectory* motherDir = 0);
    virtual void        Clear(Option_t *option="");
    virtual void        Close(Option_t *option="");
    virtual void        Copy(TObject &) const { MayNotUse("Copy(TObject &)"); }
@@ -136,18 +138,20 @@
    virtual void       *GetObjectChecked(const char *namecycle, const TClass* cl);
    virtual void       *GetObjectUnchecked(const char *namecycle);
    virtual Int_t       GetBufferSize() const;
-   const TDatime      &GetCreationDate() const {return fDatimeC;}
-   virtual TFile      *GetFile() const {return fFile;}
+   const TDatime      &GetCreationDate() const { return fDatimeC; }
+   virtual TFile      *GetFile() const { return fFile; }
    virtual TKey       *GetKey(const char *name, Short_t cycle=9999) const;
    virtual TList      *GetList() const { return fList; }
    virtual TList      *GetListOfKeys() const { return fKeys; }
-   const TDatime      &GetModificationDate() const {return fDatimeM;}
+   const TDatime      &GetModificationDate() const { return fDatimeM; }
    TObject            *GetMother() const { return fMother; }
-   virtual Int_t       GetNbytesKeys() const {return fNbytesKeys;}
-   virtual Int_t       GetNkeys() const {return fKeys->GetSize();}
+   TDirectory         *GetMotherDir() const { return fMother==0 ? 0 : dynamic_cast<TDirectory*>(fMother); }
+   virtual Int_t       GetNbytesKeys() const { return fNbytesKeys; }
+   virtual Int_t       GetNkeys() const { return fKeys->GetSize(); }
    virtual Long64_t    GetSeekDir() const { return fSeekDir; }
    virtual Long64_t    GetSeekParent() const { return fSeekParent; }
    virtual Long64_t    GetSeekKeys() const { return fSeekKeys; }
+   virtual const char *GetPathStatic() const;
    virtual const char *GetPath() const;
    TUUID               GetUUID() const {return fUUID;}
    Bool_t              IsFolder() const { return kTRUE; }


From Sergei Linev:
1) In normal constructor I add new argument - mother of directory.
   If it is not specified (for instance, if user creates TDirectory himself), gDirectory will be used.
   In principle, fMother was before, but now it consecutively used in most TDirecory methods, related to
   parent/child relationship.
2) Together with directory fMother member file pointer fFile propogated to all childs.
   Consequently, each directory knows to which file it belongs.
3) When streamed from the file, fFile memeber is assigned from TBuffer::GetParent(). fFile is enougth
   to read keys from the file. Mother directory is assigned later in TKey::ReadObj().

TDirectory::GetPath() uses static variable and will fails in multithread application.
   I introduce new GetPath() method and TString fPathBuffer to produce correct full path.
   Old code was moved in GetPathStatic() method. To optimize memory usage, one can replace TString
   by const char* (as it was before).

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@13910 27541ba8-7e3a-0410-8455-c3a389f83636


Fix meta_rtp_transport send_to method: use packet size in first modifier too

--- src/rtpsession.c
+++ src/rtpsession.c
@@ -1973,14 +1973,14 @@
 }

 int  meta_rtp_transport_sendto(RtpTransport *t, mblk_t *msg , int flags, const struct sockaddr *to, socklen_t tolen) {
-	int prev_ret=0,ret;
+	int prev_ret,ret;
 	OList *elem;
 	MetaRtpTransportImpl *m = (MetaRtpTransportImpl*)t->data;

 	if (!m->has_set_session){
 		meta_rtp_set_session(t->session,m);
 	}
-
+	prev_ret=msgdsize(msg);
 	for (elem=m->modifiers;elem!=NULL;elem=o_list_next(elem)){
 		RtpTransportModifier *rtm=(RtpTransportModifier*)elem->data;
 		ret = rtm->t_process_on_send(rtm,msg);
@@ -1989,7 +1989,6 @@
 			// something went wrong in the modifier (failed to encrypt for instance)
 			return ret;
 		}
-
 		msg->b_wptr+=(ret-prev_ret);
 		prev_ret=ret;
 	}


- removed unneeded include statement

- removed unneeded include statement

--- storage/Utils/CDgD.h
+++ storage/Utils/CDgD.h
@@ -24,7 +24,6 @@
 #define STORAGE_C_DG_D_H

-#include <libxml/tree.h>
 #include <ostream>
 #include <memory>
 #include <boost/optional.hpp>


Lock weather unit to celsius when querying yahoo weather

Weather information needs to be converted to other units in the JS theme file.

--- src/widgets/weather.c
+++ src/widgets/weather.c
@@ -50,7 +50,7 @@
 	CURL *curl;

 	curl = curl_easy_init();
-	sprintf(query, "use \"http://github.com/yql/yql-tables/raw/master/weather/weather.bylocation.xml\" as we;select * from we where location=\"%s, %s, %s\" and unit=\"%s\"", location->city, location->region_code, location->country_code, unit);
+	sprintf(query, "use \"http://github.com/yql/yql-tables/raw/master/weather/weather.bylocation.xml\" as we;select * from we where location=\"%s, %s, %s\" and unit=\"c\"", location->city, location->region_code, location->country_code);
 	sprintf(request_uri, "http://query.yahooapis.com/v1/public/yql?q=%s&format=json", curl_easy_escape(curl, query, 0));
 	curl_easy_cleanup(curl);
 	curl_global_cleanup();


Remove compiler warning

Remove compiler warning

--- sql/parse_file.h
+++ sql/parse_file.h
@@ -32,7 +32,7 @@

 struct File_option
 {
-  const LEX_STRING name;		/* Name of the option */
+  LEX_STRING name;		/* Name of the option */
   int offset;				/* offset to base address of value */
   enum file_opt_type type;		/* Option type */
 };


*** empty log message ***

*** empty log message ***

git-svn-id: 1b0c1c966ba83e662fc0b3a67ac9bac6ff73fe1f@1271 2f08bc20-984a-4df8-b195-9b5d5d477537

--- src/win/iupwin_list.c
+++ src/win/iupwin_list.c
@@ -55,6 +55,25 @@
 #define WIN_SETITEMHEIGHT(_ih) ((_ih->data->is_dropdown || _ih->data->has_editbox)? CB_SETITEMHEIGHT: LB_SETITEMHEIGHT)

+static void winListDrawBitmap(HDC hDC, HBITMAP hBitmap, int x, int y, int w, int h, int bpp)
+{
+  if(bpp == 32)
+  {
+    HDC hMemDC = CreateCompatibleDC(hDC);
+    HBITMAP oldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);
+
+    SetBkMode(hDC, TRANSPARENT);
+    BitBlt(hDC, x, y, w, h, hMemDC, 0, 0, SRCCOPY);
+
+    SelectObject(hMemDC, oldBitmap);
+    DeleteDC(hMemDC);
+  }
+  else
+  {
+    iupwinDrawBitmap(hDC, hBitmap, NULL, x, y, w, h, bpp);
+  }
+}
+
 static void winListDrawEditBoxIcon(Ihandle* ih)
 {
   if(ih->data->showimage)
@@ -68,7 +87,7 @@
     {
       int img_w, img_h, img_bpp;
       iupdrvImageGetInfo(hbmpPicture, &img_w, &img_h, &img_bpp);
-      iupwinDrawBitmap(dc, hbmpPicture, NULL, 0, 0, img_w, img_h, img_bpp);
+      winListDrawBitmap(dc, hbmpPicture, 0, 0, img_w, img_h, img_bpp);
     }
   }
 }
@@ -1397,7 +1416,7 @@
   ExtTextOut(drawitem->hDC, xPos, yPos, ETO_CLIPPED | ETO_OPAQUE, &drawitem->rcItem, text, len, NULL);

   /* Draw the bitmap associated with the item */
-  iupwinDrawBitmap(drawitem->hDC, hbmpPicture, NULL, drawitem->rcItem.left, drawitem->rcItem.top,
+  winListDrawBitmap(drawitem->hDC, hbmpPicture, drawitem->rcItem.left, drawitem->rcItem.top,
     drawitem->rcItem.right - drawitem->rcItem.left, drawitem->rcItem.bottom - drawitem->rcItem.top, bpp);

   /* Restore the previous colors */
@@ -1616,4 +1635,6 @@

   iupClassRegisterAttribute(ic, "CUEBANNER", NULL, winListSetCueBannerAttrib, NULL, NULL, IUPAF_NO_INHERIT);
   iupClassRegisterAttribute(ic, "FILTER", NULL, winListSetFilterAttrib, NULL, NULL, IUPAF_NO_INHERIT);
-}
+
+  iupClassRegisterAttribute(ic, "FLAT_ALPHA", NULL, NULL, IUPAF_SAMEASSYSTEM, "YES", IUPAF_NOT_MAPPED|IUPAF_NO_INHERIT);
+}


Use forward for loops

Use forward for loops

--- src/samplerate.c
+++ src/samplerate.c
@@ -427,9 +427,8 @@
 void
 src_short_to_float_array (const short *in, float *out, int len)
 {
-	while (len)
-	{	len -- ;
-		out [len] = (float) (in [len] / (1.0 * 0x8000)) ;
+	for (int i = 0 ; i < len ; i++)
+	{	out [i] = (float) (in [i] / (1.0 * 0x8000)) ;
 		} ;

 	return ;
@@ -438,25 +437,23 @@
 void
 src_float_to_short_array (const float *in, short *out, int len)
 {
-	while (len)
+	for (int i = 0 ; i < len ; i++)
 	{	float scaled_value ;
-		len -- ;
-		scaled_value = in [len] * 32768.f ;
+		scaled_value = in [i] * 32768.f ;
 		if (scaled_value >= 32767.f)
-			out [len] = 32767 ;
+			out [i] = 32767 ;
 		else if (scaled_value <= -32768.f)
-			out [len] = -32768 ;
+			out [i] = -32768 ;
 		else
-			out [len] = (short) (lrintf (scaled_value)) ;
+			out [i] = (short) (lrintf (scaled_value)) ;
 	}
 } /* src_float_to_short_array */

 void
 src_int_to_float_array (const int *in, float *out, int len)
 {
-	while (len)
-	{	len -- ;
-		out [len] = (float) (in [len] / (8.0 * 0x10000000)) ;
+	for (int i = 0 ; i < len ; i++)
+	{	out [i] = (float) (in [i] / (8.0 * 0x10000000)) ;
 		} ;

 	return ;
@@ -466,23 +463,21 @@
 src_float_to_int_array (const float *in, int *out, int len)
 {	double scaled_value ;

-	while (len)
-	{	len -- ;
-
-		scaled_value = in [len] * (8.0 * 0x10000000) ;
+	for (int i = 0 ; i < len ; i++)
+	{	scaled_value = in [i] * (8.0 * 0x10000000) ;
 #if CPU_CLIPS_POSITIVE == 0
 		if (scaled_value >= (1.0 * 0x7FFFFFFF))
-		{	out [len] = 0x7fffffff ;
+		{	out [i] = 0x7fffffff ;
 			continue ;
 			} ;
 #endif
 #if CPU_CLIPS_NEGATIVE == 0
 		if (scaled_value <= (-8.0 * 0x10000000))
-		{	out [len] = -1 - 0x7fffffff ;
+		{	out [i] = -1 - 0x7fffffff ;
 			continue ;
 			} ;
 #endif
-		out [len] = (int) lrint (scaled_value) ;
+		out [i] = (int) lrint (scaled_value) ;
 		} ;

 } /* src_float_to_int_array */


* Fix getenv issues

* Fix getenv issues

--- src/win32/uxnt/uxnt.c
+++ src/win32/uxnt/uxnt.c
@@ -837,20 +837,22 @@
   DWORD size;

   if ( !utf8towcs(nm, name, PATH_MAX) )
-    return NULL;
+    return -1;
   size = GetEnvironmentVariable(nm, valp, PATH_MAX);

   if ( size > 0 )
-  { if ( size >= PATH_MAX )
+  { int rc;
+
+    if ( size >= PATH_MAX )
     { if ( (valp = malloc(size+1)) == NULL )
 	return -1;
       size = GetEnvironmentVariable(nm, valp, size+1);
     }

     if ( wcstoutf8(buf, valp, buflen) )
-      rc = strlen(val);
+      rc = strlen(buf);
     else
-      rc = wcutf8len(val);
+      rc = wcutf8len(valp);

     if ( valp != val )
       free(valp);


cosmetic: fit in 80 chars

cosmetic: fit in 80 chars

--- src/wrapper_mplayer.c
+++ src/wrapper_mplayer.c
@@ -1355,8 +1355,7 @@
     return NULL;
   }

-  snprintf (uri, size, "%s%s%s",
-            protocol, track_start, device ? device : "");
+  snprintf (uri, size, "%s%s%s", protocol, track_start, device ? device : "");

   if (device)
     free (device);


fix init in case of malloc error

fix init in case of malloc error

--- string/string_init.c
+++ string/string_init.c
@@ -7,8 +7,12 @@
 {
     s->_u._s.length = 0;
     s->s = malloc(size);
-    if (!s->s) { s->_u._s.size = 0; s->_u._s.growby = growby; }
-    s->_u._s.size = size;
-    s->_u._s.growby = growby;
+    if (!s->s) {
+        s->_u._s.size = 0;
+        s->_u._s.growby = growby;
+    } else {
+        s->_u._s.size = size;
+        s->_u._s.growby = growby;
+    }
     return 0;
 }


Fixed compiler warning

Fixed compiler warning

--- strings/ctype-ucs2.c
+++ strings/ctype-ucs2.c
@@ -46,9 +46,10 @@
 #define LFACTOR1  ULL(10000000000)
 #define LFACTOR2  ULL(100000000000)

+#if defined(HAVE_CHARSET_utf32) || defined(HAVE_CHARSET_mb2)
 static unsigned long lfactor[9]=
 { 1L, 10L, 100L, 1000L, 10000L, 100000L, 1000000L, 10000000L, 100000000L };
-
+#endif

 #ifdef HAVE_CHARSET_mb2_or_mb4


Get rid of using of EOI (EOF) in grammar

--- batch_parser/parser.h
+++ batch_parser/parser.h
@@ -111,7 +111,6 @@
                 using namespace qi::labels;
                 using boost::spirit::eol;
                 using boost::spirit::eps;
-                using boost::spirit::eoi;
                 using boost::spirit::hold;
                 using boost::spirit::omit;
                 using boost::spirit::raw;
@@ -129,9 +128,9 @@
                                             | (eps(phoenix::ref(bracketsLevel) != 0) >> ')')
                                             )
                                     )
-                                 | (omit[char_('^')] >> -(omit[eol] | omit[eoi] | (char_ - blank)))
+                                 | (omit[char_('^')] >> -(omit[eol] | (char_ - blank)))
                                  | raw[(   char_('\"')
-                                        >> *(char_ - (char_('\"') | eol | eoi))
+                                        >> *(char_ - (char_('\"') | eol))
                                         >> -(char_('\"'))
                                         )
                                        ] // I don't know why, but w/o raw[], rule consumes some unprintable char on EOL/EOF


xen: Fix device count on detach

xen: Fix device count on detach

--- src/xen/xm_internal.c
+++ src/xen/xm_internal.c
@@ -3056,6 +3056,7 @@
                             def->disks + i + 1,
                             sizeof(*def->disks) *
                             (def->ndisks - (i + 1)));
+                def->ndisks--;
                 break;
             }
         }
@@ -3074,6 +3075,7 @@
                             def->nets + i + 1,
                             sizeof(*def->nets) *
                             (def->nnets - (i + 1)));
+                def->nnets--;
                 break;
             }
         }


Adding bigbadint

Adding bigbadint

error: pathspec 'exercises/ex04/bigbadint.c' did not match any file(s) known to git

--- exercises/ex04/bigbadint.c
+++ exercises/ex04/bigbadint.c
@@ -0,0 +1,275 @@
+/* Example code for Exercises in C.
+
+This program shows a way to represent a BigInt type (arbitrary length integers)
+using C strings, with numbers represents as a string of decimal digits in reverse order.
+
+This program contains two deliberate errors as a debugging exercise.
+
+1) Compile and run this program like this:
+
+gcc -g -std=c99 bigbadint.c
+./a.out
+
+You should see that reverse_string passes its test,
+but itoc and add_digits don't.
+
+2) Read the GDB tutorial at
+
+http://web.eecs.umich.edu/~sugih/pointers/summary.html
+
+3) Start gdb like this:
+
+gdb a.out
+
+4) At the gdb prompt, type
+
+run
+
+to run the program.  Since itoc is failing, let's look at
+its source code:
+
+list itoc
+
+And set a break point at the beginning of itoc
+
+break itoc
+
+Now if you run the program again, it should stop every time
+itoc is called, and you'll be able to see the value of the parameter.
+
+To run a single line of code, type
+
+step
+
+To print the value of a variable
+
+print i
+
+5) Read the descriptions of step and next, try them out, and make
+sure you know the difference.
+
+6) See if you can find the error in itoc, and fix it.
+
+7) In main, uncomment the line that calls test_reverse_string_again.
+Compile and run the program again.  You should see that
+reverse_string is actually not correct, even though it passes
+its test.  See if you can debug it.
+
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <assert.h>
+
+/* reverse_string: Returns a new string with the characters reversed.
+
+It is the caller's responsibility to free the result.
+
+s: string
+returns: string
+*/
+char *reverse_string(char *s) {
+    int n = strlen(s);
+    char *t = malloc(n+1);
+    char *to = t;
+    char *from = s + n - 1;
+
+    while(1) {
+        *to = *from;
+        to++;
+        from--;
+        if (from < s) {
+            break;
+        }
+    }
+    return t;
+}
+
+/* ctoi: Converts a character to integer.
+
+c: one of the characters '0' to '9'
+returns: integer 0 to 9
+*/
+int ctoi(char c) {
+    assert(isdigit(c));
+    return c - '0';
+}
+
+/* itoc: Converts an integer to character.
+
+i: integer 0 to 9
+returns: character '0' to '9'
+*/
+char itoc(int i) {
+    assert(i >= 0 && i <=9);
+    return 0 + i;
+}
+
+/* add_digits: Adds two decimal digits, returns the total and carry.
+
+For example, if a='5', b='6', and carry='1', the sum is 12, so
+the output value of total should be '2' and carry should be '1'
+
+a: character '0' to '9'
+b: character '0' to '9'
+c: character '0' to '9'
+total: pointer to char
+carry: pointer to char
+
+*/
+void add_digits(char a, char b, char c, char *total, char *carry) {
+    int sum = ctoi(a) + ctoi(b) + ctoi(c);
+    *total = itoc(sum % 10);
+    *carry = itoc(sum / 10);
+}
+
+/* Define a type to represent a BigInt.
+   Internally, a BigInt is a string of digits, with the digits in
+   reverse order.
+*/
+typedef char * BigInt;
+
+/* add_bigint: Adds two BigInts
+
+Stores the result in z.
+
+x: BigInt
+y: BigInt
+carry_in: char
+z: empty buffer
+*/
+void add_bigint(BigInt x, BigInt y, char carry_in, BigInt z) {
+    char total, carry_out;
+    int dx=1, dy=1, dz=1;
+    char a, b;
+
+    /* OPTIONAL TODO: Modify this function to allocate and return z
+    *  rather than taking an empty buffer as a parameter.
+    *  Hint: you might need a helper function.
+    */
+
+    if (*x == '\0') {
+        a = '0';
+        dx = 0;
+    }else{
+        a = *x;
+    }
+    if (*y == '\0') {
+        b = '0';
+        dy = 0;
+    }else{
+        b = *y;
+    }
+
+    // printf("%c %c %c\n", a, b, carry_in);
+    add_digits(a, b, carry_in, &total, &carry_out);
+    // printf("%c %c\n", carry_out, total);
+
+    // if total and carry are 0, we're done
+    if (total == '0' && carry_out == '0') {
+        *z = '\0';
+        return;
+    }
+    // otherwise store the digit we just computed
+    *z = total;
+
+    // and make a recursive call to fill in the rest.
+    add_bigint(x+dx, y+dy, carry_out, z+dz);
+}
+
+/* print_bigint: Prints the digits of BigInt in the normal order.
+
+big: BigInt
+*/
+void print_bigint(BigInt big) {
+    char c = *big;
+    if (c == '\0') return;
+    print_bigint(big+1);
+    printf("%c", c);
+}
+
+/* make_bigint: Creates and returns a BigInt.
+
+Caller is responsible for freeing.
+
+s: string of digits in the usual order
+returns: BigInt
+*/
+BigInt make_bigint(char *s) {
+    char *r = reverse_string(s);
+    return (BigInt) r;
+}
+
+void test_reverse_string() {
+    char *s = "123";
+    char *t = reverse_string(s);
+    if (strcmp(t, "321") == 0) {
+        printf("reverse_string passed\n");
+    } else {
+        printf("reverse_string failed\n");
+    }
+}
+
+void test_itoc() {
+    char c = itoc(3);
+    if (c == '3') {
+        printf("itoc passed\n");
+    } else {
+        printf("itoc failed\n");
+    }
+}
+
+void test_add_digits() {
+    char total, carry;
+    add_digits('7', '4', '1', &total, &carry);
+    if (total == '2' && carry == '1') {
+        printf("add_digits passed\n");
+    } else {
+        printf("add_digits failed\n");
+    }
+}
+
+void test_add_bigint() {
+    char *s = "1";
+    char *t = "99999999999999999999999999999999999999999999";
+    char *res = "000000000000000000000000000000000000000000001";
+
+    BigInt big1 = make_bigint(s);
+    BigInt big2 = make_bigint(t);
+    BigInt big3 = malloc(100);
+
+	add_bigint(big1, big2, '0', big3);
+
+    if (strcmp(big3, res) == 0) {
+        printf("add_bigint passed\n");
+    } else {
+        printf("add_bigint failed\n");
+    }
+}
+
+void test_reverse_string_again() {
+    char *buffer = malloc(400);
+    for (int i=0; i<400; i++) {
+        buffer[i] = i;
+    }
+    free(buffer);
+    char *reversed = reverse_string("123");
+    printf("%s\n", reversed);
+}
+
+int main (int argc, char *argv[])
+{
+    test_reverse_string();
+    test_itoc();
+    test_add_digits();
+
+    //TODO: When you have the first three functions working,
+    //      uncomment the following, and it should work.
+    // test_add_bigint();
+
+    // test_reverse_string_again();
+
+    return 0;
+}


net: nbuf: Removing dead code from net_nbuf_compact()

There is dead code that is never executed so removing it.

Coverity-CID: 157585

Change-Id: I6926289b5735b78fcb99ad493d1b05198b9e36cc
Signed-off-by: Jukka Rissanen <f9f077d1da4c7aa947f9864fa5a28c3588f6a45d@linux.intel.com>

--- subsys/net/ip/nbuf.c
+++ subsys/net/ip/nbuf.c
@@ -791,16 +791,6 @@
 		buf = buf->frags;
 	}

-	/* If the buf exists, then it is the last fragment and can be removed.
-	 */
-	if (buf) {
-		net_nbuf_unref(buf);
-
-		if (prev) {
-			prev->frags = NULL;
-		}
-	}
-
 	return first;
 }


*** empty log message ***

*** empty log message ***

--- src/sensSolver.c
+++ src/sensSolver.c
@@ -1,6 +1,6 @@
 /*
   Last changed Time-stamp: <2006-10-02 17:09:23 raim>
-  $Id: sensSolver.c,v 1.40 2006/11/13 12:46:57 jamescclu Exp $
+  $Id: sensSolver.c,v 1.41 2006/11/13 13:20:43 jamescclu Exp $
 */
 /*
  *
@@ -639,7 +639,7 @@
     {
       if ( line_formula != NULL  )
         free(line_formula);
-      ASSIGN_NEW_MEMORY_BLOCK(line_formula, strlen(line), char, 0);
+      ASSIGN_NEW_MEMORY_BLOCK(line_formula, strlen(line)+1, char, 0);
       strcpy(line_formula, line);
        if ( line != NULL  )
         free(line);


shell: Remove unnecessary function

shell: Remove unnecessary function

The print_cmd_unknown() is just a two-liner and only called from a
single place, so just do the printk calls inline.

Signed-off-by: Johan Hedberg <628991c7b0a19c384f9b99c21ec330ce952bb838@intel.com>

--- subsys/shell/shell.c
+++ subsys/shell/shell.c
@@ -314,12 +314,6 @@
 	return NULL;
 }

-static inline void print_cmd_unknown(char *argv)
-{
-	printk("Unrecognized command: %s\n", argv);
-	printk("Type 'help' for list of available commands\n");
-}
-
 static shell_cmd_function_t get_internal(const char *command)
 {
 	if (!strcmp(command, "help")) {
@@ -379,7 +373,8 @@
 		if (app_cmd_handler != NULL) {
 			cb = app_cmd_handler;
 		} else {
-			print_cmd_unknown(argv[0]);
+			printk("Unrecognized command: %s\n", argv[0]);
+			printk("Type 'help' for list of available commands\n");
 			return -EINVAL;
 		}
 	}


* subversion/svn/svn.c
  (svn_cl__cmd_table): Write some help text for 'blame'.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1661211 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/svn/svn.c
+++ subversion/svn/svn.c
@@ -510,12 +510,27 @@
     },

   { "blame", svn_cl__blame, {"praise", "annotate", "ann"}, N_
-    ("Output the content of specified files or\n"
-     "URLs with revision and author information in-line.\n"
-     "usage: blame TARGET[@REV]...\n"
+    ("Show when each line of a file was last (or\n"
+     "next) changed.\n"
+     "usage: blame [-rM:N] TARGET[@REV]...\n"
+     "\n"
+     "  Annotate each line of a file with the revision number and author of the\n"
+     "  last change (or optionally the next change) to that line.\n"
+     "\n"
+     "  With no revision range (same as -r0:REV), or with '-r M:N' where M < N,\n"
+     "  annotate each line that is present in revision N of the file, with\n"
+     "  the last revision at or before rN that changed or added the line,\n"
+     "  looking back no further than rM.\n"
+     "\n"
+     "  With a reverse revision range '-r M:N' where M > N,\n"
+     "  annotate each line that is present in revision N of the file, with\n"
+     "  the NEXT revision AFTER rN that changed or DELETED the line,\n"
+     "  looking forward no further than rM.\n"
      "\n"
      "  If specified, REV determines in which revision the target is first\n"
-     "  looked up.\n"),
+     "  looked up.\n"
+     "\n"
+     "  Write the annotated result to standard output.\n"),
     {'r', 'v', 'g', opt_incremental, opt_xml, 'x', opt_force} },

   { "cat", svn_cl__cat, {0}, N_


an obsolete header warning

an obsolete header warning

--- src/server/log.h
+++ src/server/log.h
@@ -22,6 +22,7 @@
 #define NEW_EXTERNAL_LOG 1

 #if NEW_EXTERNAL_LOG
+# warning PLEASE INCLUDE <qm/log> instead of "log.h"
 # include <qm/log>
 #else


Concurrency issue might be in the locking mechanism, investigating more

--- src/AlarmClock.h
+++ src/AlarmClock.h
@@ -132,9 +132,9 @@
       // Check to see if the thread is joinable and only join if it is supposed
       // to exit.
       if (mTimerThread.joinable() && mExit) {
-         // cout << "STOPPER: Notifying all threads" << endl;
+         cout << "STOPPER: Notifying all threads" << endl;
          mCondition.notify_all();
-         // cout << "STOPPER: joining with thread" << endl;
+         cout << "STOPPER: joining with thread" << endl;
          mTimerThread.join();
       }
       // cout << "STOPPER: finished and exiting" << endl;


remove ifdefs in ffmpeg_format.c

remove ifdefs in ffmpeg_format.c

--- ext/ffmpeg/ffmpeg_format.c
+++ ext/ffmpeg/ffmpeg_format.c
@@ -109,21 +109,13 @@
 static VALUE
 format_has_video(VALUE self)
 {
-#if LIBAVCODEC_VERSION_MAJOR < 53
     return format_has_stream_with_codec_type(self, CODEC_TYPE_VIDEO);
-#else
-    return format_has_stream_with_codec_type(self, AVMEDIA_TYPE_VIDEO);
-#endif
 }

 static VALUE
 format_has_audio(VALUE self)
 {
-#if LIBAVCODEC_VERSION_MAJOR < 53
     return format_has_stream_with_codec_type(self, CODEC_TYPE_AUDIO);
-#else
-    return format_has_stream_with_codec_type(self, AVMEDIA_TYPE_AUDIO);
-#endif
 }

 // copied from avformat util.c


my bad, CC can happen anywhere (but not for DVD)

Original commit message from CVS:
my bad, CC can happen anywhere (but not for DVD)

--- ext/mpeg2dec/gstmpeg2dec.c
+++ ext/mpeg2dec/gstmpeg2dec.c
@@ -453,15 +453,6 @@
 	GST_DEBUG (0, "sequence repeated");
         break;
       case STATE_GOP:
-        if (info->user_data_len > 0) {
-          if (GST_PAD_IS_USABLE (mpeg2dec->userdatapad)) {
-            GstBuffer *udbuf = gst_buffer_new_and_alloc (info->user_data_len);
-
-            memcpy (GST_BUFFER_DATA (udbuf), info->user_data, info->user_data_len);
-
-            gst_pad_push (mpeg2dec->userdatapad, udbuf);
-          }
-        }
         break;
       case STATE_PICTURE:
       {
@@ -530,7 +521,6 @@
 	  if (picture->flags & PIC_FLAG_SKIP ||
 	      mpeg2dec->discont_pending ||
 	      (mpeg2dec->first && !GST_BUFFER_FLAG_IS_SET (outbuf, GST_BUFFER_KEY_UNIT)))
-	  {
 	  */
 	  if (picture->flags & PIC_FLAG_SKIP ||
 	      !GST_PAD_IS_USABLE (mpeg2dec->srcpad)) {
@@ -563,10 +553,18 @@
         break;
     }

-    /* If there is user data and user data pad is usable, push it.
-     *
+    /*
      * FIXME: should pass more information such as state the user data is from
      */
+    if (info->user_data_len > 0) {
+      if (GST_PAD_IS_USABLE (mpeg2dec->userdatapad)) {
+        GstBuffer *udbuf = gst_buffer_new_and_alloc (info->user_data_len);
+
+        memcpy (GST_BUFFER_DATA (udbuf), info->user_data, info->user_data_len);
+
+        gst_pad_push (mpeg2dec->userdatapad, udbuf);
+      }
+    }
   }
   gst_buffer_unref(buf);
 }


Update the rebase documentation.

Update the rebase documentation.

This makes it match the style that is used elsewhere in Rugged and in MRI.

--- ext/rugged/rugged_rebase.c
+++ ext/rugged/rugged_rebase.c
@@ -128,7 +128,7 @@

 /*
  *  call-seq:
- *    Rebase.new(repo, branch, upstream[, onto][, options]) -> Rebase
+ *    Rebase.new(repo, branch, upstream[, onto][, options]) -> new_rebase
  *
  *  Initialize a new rebase operation. This will put +repo+ in a
  *  rebase state.
@@ -148,8 +148,8 @@
  *
  *  :inmemory ::
  *    Do not put the repository in a rebase state but perform all the
- *    operations in-memory. In case of conflicts, the RebaseOperation
- *    returned by #next will contain the index which can be used to
+ *    operations in-memory. In case of conflicts, the rebase operation
+ *    Hash returned by #next will contain the index which can be used to
  *    resolve conflicts.
  *
  *  :rewrite_notes_ref ::
@@ -252,7 +252,7 @@
 }
 /*
  *  call-seq:
- *    Rebase.inmemory_index -> Index
+ *    rebase.inmemory_index -> index
  *
  *  Gets the index produced by the last operation, which is the result
  *  of +next+ and which will be committed by the next invocation of
@@ -276,12 +276,15 @@

 /*
  *  call-seq:
- *    Rebase.commit(author = nil, committer, message = nil)
+ *    rebase.commit(author: nil, committer: committer, message: nil) -> oid or nil
  *
  *  Commit the current patch. Any conflicts must have been resolved.
  *
  *  If +author+ is +nil+, the existing author for the commit will be
  *  used. If +message+ is +nil+, the existing message will be used.
+ *
+ *  Returns a string containing the oid of the newly created commit,
+ *  or +nil+ if there are no changes to be committed.
  */
 static VALUE rb_git_rebase_commit(int argc, VALUE *argv, VALUE self)
 {
@@ -325,7 +328,7 @@

 /*
  *  call-seq:
- *    Rebase.abort()
+ *    rebase.abort -> nil
  *
  *  Abort the rebase currently in process, resetting the repository
  *  and working directory to their state before the rebase began.
@@ -342,7 +345,7 @@

 /*
  *  call-seq:
- *    Rebase.finish()
+ *    rebase.finish -> nil
  *
  *  Finish the rebase currently in progress once all patches have been
  *  applied.


Optimize Phalcon\Validation\Validator

Optimize Phalcon\Validation\Validator

--- ext/validation/validator.c
+++ ext/validation/validator.c
@@ -80,7 +80,7 @@

 	if (Z_TYPE_P(options) != IS_ARRAY) {
 		if (Z_TYPE_P(options) != IS_NULL) {
-			PHALCON_THROW_EXCEPTION_STRW(phalcon_validation_exception_ce, "The attribute must be a string");
+			PHALCON_THROW_EXCEPTION_STRW(phalcon_validation_exception_ce, "Options must be an array");
 			return;
 		}
 	} else {
@@ -98,19 +98,10 @@

 	zval *key, *options;

-	PHALCON_MM_GROW();
-
-	phalcon_fetch_params(1, 1, 0, &key);
+	phalcon_fetch_params(0, 1, 0, &key);

-	PHALCON_OBS_VAR(options);
-	phalcon_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC);
-	if (Z_TYPE_P(options) == IS_ARRAY) {
-		if (phalcon_array_isset(options, key)) {
-			RETURN_MM_TRUE;
-		}
-	}
-
-	RETURN_MM_FALSE;
+	options = phalcon_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC);
+	RETURN_BOOL(phalcon_array_isset(options, key));
 }

 /**


move to workspace: fix moving floating container to non-empty workspace

moving a container to a non-empty workspace will find a container to move
to in the destination workspace and call container_move_to_container,
which must not just skip floating containers

--- sway/commands/move.c
+++ sway/commands/move.c
@@ -216,6 +216,7 @@
 		return;
 	}
 	if (container_is_floating(container)) {
+		container_move_to_workspace(container, destination->workspace);
 		return;
 	}
 	struct sway_workspace *old_workspace = container->workspace;


FIX: swoole_http_client memleak

FIX: swoole_http_client memleak

--- swoole_http_client.c
+++ swoole_http_client.c
@@ -1309,6 +1309,7 @@
     else if (http->keep_alive == 0)
     {
         http->cli->close(http->cli);
+        sw_zval_ptr_dtor(&zobject);
     }
     return 0;
 }


Fine down the HTTP_UPLOAD_ERR code.

Fine down the HTTP_UPLOAD_ERR code.

--- swoole_http_server.c
+++ swoole_http_server.c
@@ -793,7 +793,7 @@
             sw_add_assoc_string(multipart_header, "name", "", 1);
             sw_add_assoc_string(multipart_header, "type", "", 1);
             sw_add_assoc_string(multipart_header, "tmp_name", "", 1);
-            add_assoc_long(multipart_header, "error", HTTP_UPLOAD_ERR_OK);
+            add_assoc_long(multipart_header, "error", HTTP_UPLOAD_ERR_PARTIAL);
             add_assoc_long(multipart_header, "size", 0);

             strncpy(value_buf, Z_STRVAL_P(filename), Z_STRLEN_P(filename));
@@ -955,6 +955,7 @@
     if (p->fp != NULL)
     {
         long size = swoole_file_get_size((FILE*) p->fp);
+        add_assoc_long(multipart_header, "error", HTTP_UPLOAD_ERR_OK);
         add_assoc_long(multipart_header, "size", size);

         fclose((FILE *) p->fp);


Assert that we have stats counters when we try to get a fd from a backend. (ie: the VCL is warm)

--- bin/varnishd/cache/cache_backend.c
+++ bin/varnishd/cache/cache_backend.c
@@ -90,6 +90,7 @@
 	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
 	CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC);
 	CAST_OBJ_NOTNULL(bp, d->priv, BACKEND_MAGIC);
+	AN(bp->vsc);
 	CAST_OBJ_NOTNULL(vrt, d->priv2, VRT_BACKEND_MAGIC);

 	if (!VBE_Healthy(bp, NULL)) {


Clarify comment

Clarify comment

--- bin/varnishd/cache/cache_rfc2616.c
+++ bin/varnishd/cache/cache_rfc2616.c
@@ -89,7 +89,7 @@

 	/*
 	 * Initial cacheability determination per [RFC2616, 13.4]
-	 * We do not support ranges yet, so 206 is out.
+	 * We do not support ranges to the backend yet, so 206 is out.
 	 */

 	if (http_GetHdr(hp, H_Age, &p)) {


apply clang-tidy modernize-use-override

apply clang-tidy modernize-use-override

Summary: Use clang-tidy to mechanically add missing `override` and remove redundant `virtual`.

Reviewed By: igorsugak

Differential Revision: D5211868

fbshipit-source-id: 4118c4c72f8ec3485507f69679f7e852b3eaeb73

--- bistro/processes/AsyncSubprocess.h
+++ bistro/processes/AsyncSubprocess.h
@@ -161,7 +161,7 @@
     // may already be running, and this may already be destroyed (!!!)
   }

-  virtual void timeoutExpired() noexcept override {
+  void timeoutExpired() noexcept override {
     // No try-except since poll() only throws on usage errors.
     auto ret = subprocess_.poll();
     if (UNLIKELY(!ret.running())) {


honor fixed tx antenna when sending beacon frames

Submitted by:	Michael Stevens (from netbsd)
MFC after:	1 week

--- sys/dev/ath/if_ath.c
+++ sys/dev/ath/if_ath.c
@@ -1949,7 +1949,8 @@
 		 * Switch antenna every 4 beacons.
 		 * XXX assumes two antenna
 		 */
-		antenna = (sc->sc_stats.ast_be_xmit & 4 ? 2 : 1);
+		antenna = sc->sc_txantenna != 0 ? sc->sc_txantenna
+			: (sc->sc_stats.ast_be_xmit & 4 ? 2 : 1);
 	}

 	KASSERT(bf->bf_nseg == 1,


Initialise an uninitialised variable.

Initialise an uninitialised variable.

--- sys/dev/ath/if_ath.c
+++ sys/dev/ath/if_ath.c
@@ -4350,7 +4350,7 @@
 	struct ath_hal *ah = sc->sc_ah;
 	struct ifnet *ifp = sc->sc_ifp;
 	struct ieee80211com *ic = ifp->if_l2com;
-	HAL_BOOL longCal, isCalDone;
+	HAL_BOOL longCal, isCalDone = AH_TRUE;
 	HAL_BOOL aniCal, shortCal = AH_FALSE;
 	int nextcal;

@@ -4400,6 +4400,7 @@

 	/* Only call if we're doing a short/long cal, not for ANI calibration */
 	if (shortCal || longCal) {
+		isCalDone = AH_FALSE;
 		if (ath_hal_calibrateN(ah, sc->sc_curchan, longCal, &isCalDone)) {
 			if (longCal) {
 				/*


Regdomain fixups: o pass country code, outdoor indication, and ecm mode into the hal   when requesting a channel list o add a console msg when regulatory setup fails o add placeholder code to map between Atheros sku's and 802.11 sku's   that handles only the debug country code used to unlock the full   channel list (to be used only for debugging) o fix multiple instances of mismapping the 802.11 location to the   outdoor indication (anywhere may be outdoor also)

--- sys/dev/ath/if_ath.c
+++ sys/dev/ath/if_ath.c
@@ -5873,7 +5873,11 @@
 	}
 	error = 0;
 	if (!ath_hal_init_channels(ah, halchans, IEEE80211_CHAN_MAX, &nhalchans,
-	    NULL, 0, NULL, CTRY_DEFAULT, HAL_MODE_ALL, AH_FALSE, AH_TRUE)) {
+	    NULL, 0, NULL, cc, HAL_MODE_ALL, outdoor, ecm)) {
+		u_int32_t rd;
+		(void) ath_hal_getregdomain(ah, &rd);
+		device_printf(sc->sc_dev, "ath_hal_init_channels failed, "
+		    "rd %d cc %u outdoor %u ecm %u\n", rd, cc, outdoor, ecm);
 		error = EINVAL;
 		goto done;
 	}
@@ -5926,25 +5930,47 @@
 	return error;
 }

+/* XXX hard to include ieee80211_regdomain.h right now */
+#define	SKU_DEBUG	0x1ff
+
+static void
+ath_maprd(const struct ieee80211_regdomain *rd,
+	u_int32_t *ath_rd, u_int32_t *ath_cc)
+{
+	/* map SKU's to Atheros sku's */
+	switch (rd->regdomain) {
+	case SKU_DEBUG:
+		if (rd->country == 0) {
+			*ath_rd = 0;
+			*ath_cc = CTRY_DEBUG;
+			return;
+		}
+		break;
+	}
+	*ath_rd = rd->regdomain;
+	*ath_cc = rd->country;
+}
+
 static int
 ath_setregdomain(struct ieee80211com *ic, struct ieee80211_regdomain *rd,
 	int nchans, struct ieee80211_channel chans[])
 {
 	struct ath_softc *sc = ic->ic_ifp->if_softc;
 	struct ath_hal *ah = sc->sc_ah;
-	u_int32_t ord;
+	u_int32_t ord, regdomain, cc;
 	int error;

 	(void) ath_hal_getregdomain(ah, &ord);
-	/* XXX map sku->rd */
+	ath_maprd(rd, &regdomain, &cc);
 	DPRINTF(sc, ATH_DEBUG_REGDOMAIN,
-	    "%s: rd %u cc %u location %c ecm %u\n",
-	    __func__, rd->regdomain, rd->country, rd->location, rd->ecm);
-	ath_hal_setregdomain(ah, rd->regdomain);
-
-	error = getchannels(sc, &nchans, chans, rd->country,
+	    "%s: rd %u cc %u location %c ecm %u (mapped rd %u cc %u)\n",
+	    __func__, rd->regdomain, rd->country, rd->location, rd->ecm,
+	    regdomain, cc);
+	ath_hal_setregdomain(ah, regdomain);
+
+	error = getchannels(sc, &nchans, chans, cc,
 	     rd->ecm ? AH_TRUE : AH_FALSE,
-	     rd->location == 'O' ? AH_TRUE : AH_FALSE);
+	     rd->location != 'I' ? AH_TRUE : AH_FALSE);
 	if (error != 0) {
 		/*
 		 * Restore previous state.
@@ -5952,7 +5978,7 @@
 		ath_hal_setregdomain(ah, ord);
 		(void) getchannels(sc, NULL, NULL, ic->ic_regdomain.country,
 		     ic->ic_regdomain.ecm ? AH_TRUE : AH_FALSE,
-		     ic->ic_regdomain.location == 'O' ? AH_TRUE : AH_FALSE);
+		     ic->ic_regdomain.location != 'I' ? AH_TRUE : AH_FALSE);
 		return error;
 	}
 	return 0;
@@ -5979,14 +6005,28 @@
 	ath_hal_setregdomain(ah, ord);
 	(void) getchannels(sc, NULL, NULL, ic->ic_regdomain.country,
 	     ic->ic_regdomain.ecm ? AH_TRUE : AH_FALSE,
-	     ic->ic_regdomain.location == 'O' ? AH_TRUE : AH_FALSE);
-}
-
-static int
-ath_mapregdomain(struct ath_softc *sc, u_int32_t rd)
-{
-	/* map Atheros rd's to SKU's */
-	return rd;
+	     ic->ic_regdomain.location != 'I' ? AH_TRUE : AH_FALSE);
+}
+
+static void
+ath_mapsku(u_int32_t ath_rd, u_int32_t ath_cc, struct ieee80211_regdomain *rd)
+{
+	rd->isocc[0] = ' ';	/* XXX don't know */
+	rd->isocc[1] = ' ';
+
+	/* map Atheros sku's to SKU's */
+	switch (ath_rd) {
+	case 0:
+		if (ath_cc == CTRY_DEBUG) {
+			rd->regdomain = SKU_DEBUG;
+			rd->country = 0;
+			return;
+		}
+		break;
+	}
+	/* XXX net80211 types too small */
+	rd->regdomain = (uint16_t) ath_rd;
+	rd->country = (uint16_t) ath_cc;
 }

 static int
@@ -6013,12 +6053,9 @@
 		}
 		return error;
 	}
-	ic->ic_regdomain.regdomain = ath_mapregdomain(sc, sc->sc_eerd);
-	ic->ic_regdomain.country = sc->sc_eecc;
 	ic->ic_regdomain.ecm = 1;
 	ic->ic_regdomain.location = 'I';
-	ic->ic_regdomain.isocc[0] = ' ';	/* XXX don't know */
-	ic->ic_regdomain.isocc[1] = ' ';
+	ath_mapsku(sc->sc_eerd, sc->sc_eecc, &ic->ic_regdomain);

 	DPRINTF(sc, ATH_DEBUG_REGDOMAIN,
 	    "%s: eeprom rd %u cc %u (mapped rd %u cc %u) location %c ecm %u\n",


MFC r181557:   Use device_set_desc() instead of device_set_desc_copy() as we don't   manipulate the verbose description of a device.

--- sys/dev/bfe/if_bfe.c
+++ sys/dev/bfe/if_bfe.c
@@ -177,7 +177,7 @@
 	while (t->bfe_name != NULL) {
 		if (pci_get_vendor(dev) == t->bfe_vid &&
 		    pci_get_device(dev) == t->bfe_did) {
-			device_set_desc_copy(dev, t->bfe_name);
+			device_set_desc(dev, t->bfe_name);
 			return (BUS_PROBE_DEFAULT);
 		}
 		t++;


MFC: 1.119: Make sure we reprogram multicast filter on IFF_ALLMULTI.

Approved by:	re (kensmith)

--- sys/dev/bge/if_bge.c
+++ sys/dev/bge/if_bge.c
@@ -3439,7 +3439,7 @@
 			 * instead of reinitializing the entire NIC. Doing
 			 * a full re-init means reloading the firmware and
 			 * waiting for it to start up, which may take a
-			 * second or two.
+			 * second or two.  Similarly for ALLMULTI.
 			 */
 			if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
 			    ifp->if_flags & IFF_PROMISC &&
@@ -3451,6 +3451,9 @@
 			    sc->bge_if_flags & IFF_PROMISC) {
 				BGE_CLRBIT(sc, BGE_RX_MODE,
 				    BGE_RXMODE_RX_PROMISC);
+			} else if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
+			    (ifp->if_flags ^ sc->bge_if_flags) & IFF_ALLMULTI) {
+				bge_setmulti(sc);
 			} else
 				bge_init_locked(sc);
 		} else {


MFC: r182060

MFC: r182060

- Restore the behavior of enabling the MII buffer for an internal
  PHY only and not also in the case of an external PHY currently
  doing full duplex, which accidentally got broken in r180504.
  It's still not clear to me why we need to enable the buffer for
  an internal PHY though.
- Count excess and late collisions as output errors. [1]
- Count receive errors as input errors. [1]

Obtained from:	NetBSD [1]

--- sys/dev/gem/if_gem.c
+++ sys/dev/gem/if_gem.c
@@ -87,7 +87,7 @@
 #define	TRIES	10000

 /*
- * The GEM hardware support basic TCP/UDP checksum offloading.  However,
+ * The hardware supports basic TCP/UDP checksum offloading.  However,
  * the hardware doesn't compensate the checksum for UDP datagram which
  * can yield to 0x0.  As a safe guard, UDP checksum offload is disabled
  * by default.  It can be reactivated by setting special link option
@@ -537,18 +537,26 @@
 {
 	struct gem_softc *sc = arg;
 	struct ifnet *ifp;
+	uint32_t v;

 	GEM_LOCK_ASSERT(sc, MA_OWNED);

 	ifp = sc->sc_ifp;
 	/*
-	 * Unload collision counters.
+	 * Unload collision and error counters.
 	 */
 	ifp->if_collisions +=
 	    GEM_BANK1_READ_4(sc, GEM_MAC_NORM_COLL_CNT) +
-	    GEM_BANK1_READ_4(sc, GEM_MAC_FIRST_COLL_CNT) +
-	    GEM_BANK1_READ_4(sc, GEM_MAC_EXCESS_COLL_CNT) +
+	    GEM_BANK1_READ_4(sc, GEM_MAC_FIRST_COLL_CNT);
+	v = GEM_BANK1_READ_4(sc, GEM_MAC_EXCESS_COLL_CNT) +
 	    GEM_BANK1_READ_4(sc, GEM_MAC_LATE_COLL_CNT);
+	ifp->if_collisions += v;
+	ifp->if_oerrors += v;
+	ifp->if_ierrors +=
+	    GEM_BANK1_READ_4(sc, GEM_MAC_RX_LEN_ERR_CNT) +
+	    GEM_BANK1_READ_4(sc, GEM_MAC_RX_ALIGN_ERR) +
+	    GEM_BANK1_READ_4(sc, GEM_MAC_RX_CRC_ERR_CNT) +
+	    GEM_BANK1_READ_4(sc, GEM_MAC_RX_CODE_VIOL);

 	/*
 	 * Then clear the hardware counters.
@@ -557,6 +565,10 @@
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_FIRST_COLL_CNT, 0);
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_EXCESS_COLL_CNT, 0);
 	GEM_BANK1_WRITE_4(sc, GEM_MAC_LATE_COLL_CNT, 0);
+	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_LEN_ERR_CNT, 0);
+	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_ALIGN_ERR, 0);
+	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CRC_ERR_CNT, 0);
+	GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CODE_VIOL, 0);

 	mii_tick(sc->sc_mii);

@@ -1826,7 +1838,7 @@
 /*
  * MII interface
  *
- * The GEM MII interface supports at least three different operating modes:
+ * The MII interface supports at least three different operating modes:
  *
  * Bitbang mode is implemented using data, clock and output enable registers.
  *
@@ -2058,12 +2070,12 @@
 	v |= GEM_MAC_XIF_TX_MII_ENA;
 	if ((sc->sc_flags & GEM_SERDES) == 0) {
 		if ((GEM_BANK1_READ_4(sc, GEM_MIF_CONFIG) &
-		    GEM_MIF_CONFIG_PHY_SEL) != 0 &&
-		    (IFM_OPTIONS(sc->sc_mii->mii_media_active) &
-		    IFM_FDX) == 0)
+		    GEM_MIF_CONFIG_PHY_SEL) != 0) {
 			/* External MII needs echo disable if half duplex. */
-			v |= GEM_MAC_XIF_ECHO_DISABL;
-		else
+		    	if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) &
+			    IFM_FDX) == 0)
+				v |= GEM_MAC_XIF_ECHO_DISABL;
+		} else
 			/*
 			 * Internal MII needs buffer enable.
 			 * XXX buffer enable makes only sense for an


fix build

fix build

Submitted by:	delphij

--- sys/dev/iwn/if_iwn.c
+++ sys/dev/iwn/if_iwn.c
@@ -2887,14 +2887,14 @@
 	/* XXX all wrong */
 	/* compute remaining time until next beacon */
 	val = (uint64_t)ni->ni_intval * 1024;	/* msecs -> usecs */
-	DPRINTF(sc, IWN_DEBUG_ANY, "%s: val = %llu %s\n", __func__,
+	DPRINTF(sc, IWN_DEBUG_ANY, "%s: val = %ju %s\n", __func__,
 	    val, val == 0 ? "correcting" : "");
 	if (val == 0)
 		val = 1;
 	mod = le64toh(tsf.tstamp) % val;
 	tsf.binitval = htole32((uint32_t)(val - mod));

-	DPRINTF(sc, IWN_DEBUG_RESET, "TSF bintval=%u tstamp=%llu, init=%u\n",
+	DPRINTF(sc, IWN_DEBUG_RESET, "TSF bintval=%u tstamp=%ju, init=%u\n",
 	    ni->ni_intval, le64toh(tsf.tstamp), (uint32_t)(val - mod));

 	if (iwn_cmd(sc, IWN_CMD_TSF, &tsf, sizeof tsf, 1) != 0)


It's vlan.h, not opt_vlan.h.

It's vlan.h, not opt_vlan.h.

--- sys/dev/nge/if_nge.c
+++ sys/dev/nge/if_nge.c
@@ -75,7 +75,7 @@
  * requirement.
  */

-#include "opt_vlan.h"
+#include "vlan.h"

 #include <sys/param.h>
 #include <sys/systm.h>


Add vendor/device codes for SmartBridges SmartLink USB ethernet adapter
(which is actually a CATC Netmate).

Gee. I don't know why people make such a fuss over supporting USB ethernet
NICs. This is easier than collecting graft.

--- sys/dev/usb/if_cue.c
+++ sys/dev/usb/if_cue.c
@@ -88,6 +88,7 @@
 Static struct cue_type cue_devs[] = {
 	{ USB_VENDOR_CATC, USB_PRODUCT_CATC_NETMATE },
 	{ USB_VENDOR_CATC, USB_PRODUCT_CATC_NETMATE2 },
+	{ USB_VENDOR_SMARTBRIDGES, USB_PRODUCT_SMARTBRIDGES_SMARTLINK },
 	{ 0, 0 }
 };


MFC:	sys/geom/eli/g_eli.c	1.12,1.13

MFC:	sys/geom/eli/g_eli.c	1.12,1.13

- Don't forget to initialize crp_etype field.

  Reported by:	Nick Evans <nevans@syphen.net>

- Fix copy&paste typo.

Approved by:	re (scottl)

--- sys/geom/eli/g_eli.c
+++ sys/geom/eli/g_eli.c
@@ -227,7 +227,7 @@
 	if (pbp->bio_error == 0)
 		pbp->bio_completed = pbp->bio_length;
 	else {
-		G_ELI_LOGREQ(0, pbp, "Crypto READ request failed (error=%d).",
+		G_ELI_LOGREQ(0, pbp, "Crypto WRITE request failed (error=%d).",
 		    pbp->bio_error);
 		pbp->bio_completed = 0;
 	}
@@ -535,6 +535,7 @@
 		    sizeof(crd->crd_iv));
 		crd->crd_next = NULL;

+		crp->crp_etype = 0;
 		err = crypto_dispatch(crp);
 		if (error == 0)
 			error = err;


Correct a bug which wrote the result of devfs_add_devswf() for two
separate devices to the same place

Reviewed by:	Julian Elischer <julian>, Marc G. Fournier <scrappy>


Added character 21 to conf.c table for future ps/2 mouse driver.  This finishes the install of the device short of adding the driver itself to i386/isa/psm.c

--- sys/i386/i386/conf.c
+++ sys/i386/i386/conf.c
@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)conf.c	5.8 (Berkeley) 5/12/91
- *	$Id: conf.c,v 1.11 1993/10/23 10:49:24 jkh Exp $
+ *	$Id: conf.c,v 1.12 1993/10/23 22:13:08 jkh Exp $
  */

 #include "param.h"
@@ -277,6 +277,17 @@
 #define sbread         enxio
 #define sbwrite        enxio
 #define sbselect       seltrue
+#endif
+
+#include "psm.h"
+#if NPSM > 0
+int	psmopen(),psmclose(),psmread(),psmselect(),psmioctl();
+#else
+#define psmopen		enxio
+#define psmclose	enxio
+#define psmread		enxio
+#define psmselect	enxio
+#define psmioctl	enxio
 #endif

 #include "snd.h"                 /* General Sound Driver */
@@ -430,9 +441,9 @@
 	{ sbopen,	sbclose,	sbread,		sbwrite,	/*20*/
 	  sbioctl,	enodev,		enodev,		NULL,	/* soundblaster*/
 	  sbselect,	enodev,		NULL },
-	{ enodev,	enodev,		enodev,		enodev,		/*21*/
-	  enodev,	enodev,		nullop,		NULL,	/* psm */
-	  enodev,	enodev,		enodev },
+	{ psmopen,	psmclose,	psmread,	nullop,		/*21*/
+	  psmioctl,	enodev,		nullop,		NULL,	/* psm mice */
+	  psmselect,	enodev,		NULL },
 	{ fdopen,	enxio,		enxio,		enxio,		/*22*/
 	  enxio,	enxio,		enxio,		NULL,	/* fd (!=Fd) */
 	  enxio,	enxio,		enxio },


Follow-up commit: refactor pmap_kextract() to make it easier to
catch and debug issues like the one fixed in the previous commit:
Replace all return statements with goto statements so that we end
up at a single place with a value for the physical address.
Print a message for all unknown KVA addresses.

Approved by:	re (blanket)

--- sys/ia64/ia64/pmap.c
+++ sys/ia64/ia64/pmap.c
@@ -1217,43 +1217,54 @@
 {
 	struct ia64_lpte *pte;
 	uint64_t *pbvm_pgtbl;
+	vm_paddr_t pa;
 	u_int idx;

 	KASSERT(va >= VM_MAXUSER_ADDRESS, ("Must be kernel VA"));

 	/* Regions 6 and 7 are direct mapped. */
-	if (va >= IA64_RR_BASE(6))
-		return (IA64_RR_MASK(va));
-
-	/* Bail out if the virtual address is beyond our limits. */
+	if (va >= IA64_RR_BASE(6)) {
+		pa = IA64_RR_MASK(va);
+		goto out;
+	}
+
+	/* Region 5 is our KVA. Bail out if the VA is beyond our limits. */
 	if (va >= kernel_vm_end)
-		return (0);
-
+		goto err_out;
 	if (va >= VM_MIN_KERNEL_ADDRESS) {
 		pte = pmap_find_kpte(va);
-		return (pmap_present(pte) ? pmap_ppn(pte)|(va&PAGE_MASK) : 0);
-	}
-
-	/* PBVM page table. */
+		pa = pmap_present(pte) ? pmap_ppn(pte) | (va & PAGE_MASK) : 0;
+		goto out;
+	}
+
+	/* The PBVM page table. */
 	if (va >= IA64_PBVM_PGTBL + bootinfo->bi_pbvm_pgtblsz)
-		return (0);
-	if (va >= IA64_PBVM_PGTBL)
-		return (va - IA64_PBVM_PGTBL) + bootinfo->bi_pbvm_pgtbl;
-
-	/* PBVM. */
+		goto err_out;
+	if (va >= IA64_PBVM_PGTBL) {
+		pa = (va - IA64_PBVM_PGTBL) + bootinfo->bi_pbvm_pgtbl;
+		goto out;
+	}
+
+	/* The PBVM itself. */
 	if (va >= IA64_PBVM_BASE) {
 		pbvm_pgtbl = (void *)IA64_PBVM_PGTBL;
 		idx = (va - IA64_PBVM_BASE) >> IA64_PBVM_PAGE_SHIFT;
 		if (idx >= (bootinfo->bi_pbvm_pgtblsz >> 3))
-			return (0);
+			goto err_out;
 		if ((pbvm_pgtbl[idx] & PTE_PRESENT) == 0)
-			return (0);
-		return ((pbvm_pgtbl[idx] & PTE_PPN_MASK) +
-		    (va & IA64_PBVM_PAGE_MASK));
-	}
-
-	printf("XXX: %s: va=%#lx\n", __func__, va);
-	return (0);
+			goto err_out;
+		pa = (pbvm_pgtbl[idx] & PTE_PPN_MASK) +
+		    (va & IA64_PBVM_PAGE_MASK);
+		goto out;
+	}
+
+ err_out:
+	printf("XXX: %s: va=%#lx is invalid\n", __func__, va);
+	pa = 0;
+	/* FALLTHROUGH */
+
+ out:
+	return (pa);
 }

 /*


sys/include/xtimer.h: fix endif

sys/include/xtimer.h: fix endif

--- sys/include/xtimer.h
+++ sys/include/xtimer.h
@@ -646,7 +646,7 @@
 }
 #endif

-#endif /* MODULE_XTIMER_ON_ZTIMER */
+#endif /* MODULE_ZTIMER_XTIMER_COMPAT */

 /** @} */
 #endif /* XTIMER_H */


Various fixes:

Various fixes:

1. imgp->image_header needs to be cleared for the bp == NULL && `goto
   interpret' case, else exec_fail_dealloc would free it twice after
   an error.

2. Moved the vp->v_writecount check in exec_check_permissions() to
   near the end.  This fixes execve("/dev/null", ...) returning the
   bogus errno ETXTBSY.  ETXTBSY is still returned for attempts to
   exec interpreted files that are open for writing.  The man page
   is very old and wrong here.  It says that ETXTBSY is for pure
   procedure (shared text) files that are open for writing or reading.

3. Moved the setuid disabling in exec_check_permissions() to the end.
   Cosmetic.  It's more natural to dispose of all the error cases
   first.

...plus a couple of other cosmetic changes.

Submitted by:	bde

--- sys/kern/kern_exec.c
+++ sys/kern/kern_exec.c
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$Id: kern_exec.c,v 1.53 1997/03/31 11:10:55 davidg Exp $
+ *	$Id: kern_exec.c,v 1.54 1997/04/04 01:30:33 davidg Exp $
  */

 #include <sys/param.h>
@@ -159,7 +159,6 @@
 	 * Check file permissions (also 'opens' file)
 	 */
 	error = exec_check_permissions(imgp);
-
 	if (error) {
 		VOP_UNLOCK(imgp->vp, 0, p);
 		goto exec_fail_dealloc;
@@ -187,9 +186,8 @@
 		    UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, NULL, p);
 	}
 	VOP_UNLOCK(imgp->vp, 0, p);
-	if (error) {
+	if (error)
 		goto exec_fail_dealloc;
-	}

 	/*
 	 * Loop through list of image activators, calling each one.
@@ -204,7 +202,6 @@
 			error = (*execsw[i]->ex_imgact)(imgp);
 		else
 			continue;
-
 		if (error == -1)
 			continue;
 		if (error)
@@ -216,6 +213,7 @@
 				bp = NULL;
 			} else {
 				free((void *)imgp->image_header, M_TEMP);
+				imgp->image_header = NULL;
 			}
 			/* free old vnode and name buffer */
 			vrele(ndp->ni_vp);
@@ -573,14 +571,6 @@
 	struct vattr *attr = imgp->attr;
 	int error;

-	/*
-	 * Check number of open-for-writes on the file and deny execution
-	 *	if there are any.
-	 */
-	if (vp->v_writecount) {
-		return (ETXTBSY);
-	}
-
 	/* Get file attributes */
 	error = VOP_GETATTR(vp, attr, p->p_ucred, p);
 	if (error)
@@ -607,24 +597,33 @@
 		return (ENOEXEC);

 	/*
-	 * Disable setuid/setgid if the filesystem prohibits it or if
-	 *	the process is being traced.
-	 */
-        if ((vp->v_mount->mnt_flag & MNT_NOSUID) || (p->p_flag & P_TRACED))
-		attr->va_mode &= ~(VSUID | VSGID);
-
-	/*
 	 *  Check for execute permission to file based on current credentials.
-	 *	Then call filesystem specific open routine (which does nothing
-	 *	in the general case).
 	 */
 	error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p);
 	if (error)
 		return (error);

+	/*
+	 * Check number of open-for-writes on the file and deny execution
+	 * if there are any.
+	 */
+	if (vp->v_writecount)
+		return (ETXTBSY);
+
+	/*
+	 * Call filesystem specific open routine (which does nothing in the
+	 * general case).
+	 */
 	error = VOP_OPEN(vp, FREAD, p->p_ucred, p);
 	if (error)
 		return (error);

+	/*
+	 * Disable setuid/setgid if the filesystem prohibits it or if
+	 * the process is being traced.
+	 */
+        if ((vp->v_mount->mnt_flag & MNT_NOSUID) || (p->p_flag & P_TRACED))
+		attr->va_mode &= ~(VSUID | VSGID);
+
 	return (0);
 }


Add an assert for proctree_lock to proc_to_reap().

Discussed with:	kib
MFC after:	1 week

--- sys/kern/kern_exit.c
+++ sys/kern/kern_exit.c
@@ -814,6 +814,8 @@
 {
 	struct proc *q;

+	sx_assert(&proctree_lock, SA_XLOCKED);
+
 	q = td->td_proc;
 	PROC_LOCK(p);
 	if (pid != WAIT_ANY && p->p_pid != pid && p->p_pgid != -pid) {


Do not add handler to event handlers list until ithread is created.

In rare event when fast and ithread interrupts share the same vector
and the fast handler was registered first, we can end up trying to
schedule the ithread that is not created yet. The kernel built with
INVARIANTS then triggers an assertion.

Change the order to create the ithread first and only then add the
handler that needs it to the interrupt event handlers list.

Reviewed by: jhb

--- sys/kern/kern_intr.c
+++ sys/kern/kern_intr.c
@@ -545,17 +545,6 @@
 		}
 	}

-	/* Add the new handler to the event in priority order. */
-	TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) {
-		if (temp_ih->ih_pri > ih->ih_pri)
-			break;
-	}
-	if (temp_ih == NULL)
-		TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next);
-	else
-		TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next);
-	intr_event_update(ie);
-
 	/* Create a thread if we need one. */
 	while (ie->ie_thread == NULL && handler != NULL) {
 		if (ie->ie_flags & IE_ADDING_THREAD)
@@ -572,6 +561,18 @@
 			wakeup(ie);
 		}
 	}
+
+	/* Add the new handler to the event in priority order. */
+	TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) {
+		if (temp_ih->ih_pri > ih->ih_pri)
+			break;
+	}
+	if (temp_ih == NULL)
+		TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next);
+	else
+		TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next);
+	intr_event_update(ie);
+
 	CTR3(KTR_INTR, "%s: added %s to %s", __func__, ih->ih_name,
 	    ie->ie_name);
 	mtx_unlock(&ie->ie_lock);
@@ -618,23 +619,12 @@
 		}
 	}

-	/* Add the new handler to the event in priority order. */
-	TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) {
-		if (temp_ih->ih_pri > ih->ih_pri)
-			break;
-	}
-	if (temp_ih == NULL)
-		TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next);
-	else
-		TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next);
-	intr_event_update(ie);
-
 	/* For filtered handlers, create a private ithread to run on. */
-	if (filter != NULL && handler != NULL) {
+	if (filter != NULL && handler != NULL) {
 		mtx_unlock(&ie->ie_lock);
-		it = ithread_create("intr: newborn", ih);
+		it = ithread_create("intr: newborn", ih);
 		mtx_lock(&ie->ie_lock);
-		it->it_event = ie;
+		it->it_event = ie;
 		ih->ih_thread = it;
 		ithread_update(it); /* XXX - do we really need this?!?!? */
 	} else { /* Create the global per-event thread if we need one. */
@@ -654,6 +644,18 @@
 			}
 		}
 	}
+
+	/* Add the new handler to the event in priority order. */
+	TAILQ_FOREACH(temp_ih, &ie->ie_handlers, ih_next) {
+		if (temp_ih->ih_pri > ih->ih_pri)
+			break;
+	}
+	if (temp_ih == NULL)
+		TAILQ_INSERT_TAIL(&ie->ie_handlers, ih, ih_next);
+	else
+		TAILQ_INSERT_BEFORE(temp_ih, ih, ih_next);
+	intr_event_update(ie);
+
 	CTR3(KTR_INTR, "%s: added %s to %s", __func__, ih->ih_name,
 	    ie->ie_name);
 	mtx_unlock(&ie->ie_lock);


Two changes to vm_pgmoveco():  - Eliminate an initialized but unused variable.  - Eliminate an unnecessary call to clear the page's PG_BUSY flag.  (The    call to vm_page_rename() already clears the page's PG_BUSY flag through    its call to vm_page_remove().)

--- sys/kern/kern_subr.c
+++ sys/kern/kern_subr.c
@@ -76,7 +76,7 @@
 	vm_page_t kern_pg, user_pg;
 	vm_object_t uobject;
 	vm_map_entry_t entry;
-	vm_pindex_t upindex, kpindex;
+	vm_pindex_t upindex;
 	vm_prot_t prot;
 	boolean_t wired;

@@ -112,9 +112,7 @@
 		else
 			panic("vm_pgmoveco: renaming busy page");
 	}
-	kpindex = kern_pg->pindex;
 	vm_page_rename(kern_pg, uobject, upindex);
-	vm_page_flag_clear(kern_pg, PG_BUSY);
 	kern_pg->valid = VM_PAGE_BITS_ALL;
 	vm_page_unlock_queues();
 	VM_OBJECT_UNLOCK(uobject);


- Get rid of the unused DIDRUN flag.  This was really only present to    support sched_4bsd.  - Rename the KTR level for non schedgraph parsed events.  They take event    space from things we'd like to graph.  - Reset our slice value after we sleep.  The slice is simply there to    prevent starvation among equal priorities.  A thread which had almost    exhausted it's slice and then slept doesn't need to be rescheduled a    tick after it wakes up.  - Set the maximum slice value to a more conservative 100ms now that it is    more accurately enforced.

--- sys/kern/sched_ule.c
+++ sys/kern/sched_ule.c
@@ -70,6 +70,8 @@
  *	Implement pick_score.
  */

+#define	KTR_ULE	0x0		/* Enable for pickpri debugging. */
+
 /*
  * Thread scheduler specific section.
  */
@@ -97,7 +99,6 @@
 /* flags kept in ts_flags */
 #define	TSF_BOUND	0x0001		/* Thread can not migrate. */
 #define	TSF_XFERABLE	0x0002		/* Thread was added as transferable. */
-#define	TSF_DIDRUN	0x2000		/* Thread actually ran. */

 static struct td_sched td_sched0;

@@ -670,7 +671,7 @@
 			ts = tdq_steal(steal, 1);
 			if (ts == NULL)
 				continue;
-			CTR5(KTR_SCHED,
+			CTR5(KTR_ULE,
 			    "tdq_idled: stealing td %p(%s) pri %d from %d busy 0x%X",
 			    ts->ts_thread, ts->ts_thread->td_proc->p_comm,
 			    ts->ts_thread->td_priority, cpu, tdq_busy);
@@ -723,9 +724,12 @@
 	 */
 	if (prio > ipi_thresh && td->td_priority < PRI_MIN_IDLE)
 		return;
-	if (ipi_ast)
-		ipi_selected(1 << cpu, IPI_AST);
-	else if (ipi_preempt)
+	if (td->td_priority < PRI_MIN_IDLE) {
+		if (ipi_ast)
+			ipi_selected(1 << cpu, IPI_AST);
+		else if (ipi_preempt)
+			ipi_selected(1 << cpu, IPI_PREEMPT);
+	} else
 		ipi_selected(1 << cpu, IPI_PREEMPT);
 }

@@ -834,7 +838,7 @@
 	 */
 	pcpu = pcpu_find(ts->ts_cpu);
 	if (pcpu->pc_curthread->td_priority > PRI_MIN_IDLE) {
-		CTR5(KTR_SCHED,
+		CTR5(KTR_ULE,
 		    "ts_cpu %d idle, ltick %d ticks %d pri %d curthread %d",
 		    ts->ts_cpu, ts->ts_rltick, ticks, pri,
 		    pcpu->pc_curthread->td_priority);
@@ -844,7 +848,7 @@
 	 * If we have affinity, try to place it on the cpu we last ran on.
 	 */
 	if (SCHED_AFFINITY(ts) && pcpu->pc_curthread->td_priority > pri) {
-		CTR5(KTR_SCHED,
+		CTR5(KTR_ULE,
 		    "affinity for %d, ltick %d ticks %d pri %d curthread %d",
 		    ts->ts_cpu, ts->ts_rltick, ticks, pri,
 		    pcpu->pc_curthread->td_priority);
@@ -862,7 +866,7 @@
 		 */
 		if ((TDQ_SELF()->tdq_load == 1) && (flags & SRQ_YIELDING ||
 		    curthread->td_pri_class == PRI_ITHD)) {
-			CTR2(KTR_SCHED, "tryself load %d flags %d",
+			CTR2(KTR_ULE, "tryself load %d flags %d",
 			    TDQ_SELF()->tdq_load, flags);
 			return (self);
 		}
@@ -870,12 +874,12 @@
 	/*
 	 * Look for an idle group.
 	 */
-	CTR1(KTR_SCHED, "tdq_idle %X", tdq_idle);
+	CTR1(KTR_ULE, "tdq_idle %X", tdq_idle);
 	cpu = ffs(tdq_idle);
 	if (cpu)
 		return (cpu - 1);
 	if (tryselfidle && pri < curthread->td_priority) {
-		CTR1(KTR_SCHED, "tryself %d",
+		CTR1(KTR_ULE, "tryself %d",
 		    curthread->td_priority);
 		return (self);
 	}
@@ -890,7 +894,7 @@
 			continue;
 		pcpu = pcpu_find(cpu);
 		pri = pcpu->pc_curthread->td_priority;
-		CTR4(KTR_SCHED,
+		CTR4(KTR_ULE,
 		    "cpu %d pri %d lowcpu %d lowpri %d",
 		    cpu, pri, lowcpu, lowpri);
 		if (pri < lowpri)
@@ -967,7 +971,7 @@
 	 * in case which sched_clock() called before sched_initticks().
 	 */
 	realstathz = hz;
-	sched_slice = (realstathz/7);	/* 140ms */
+	sched_slice = (realstathz/10);	/* ~100ms */
 	tickincr = 1 << SCHED_TICK_SHIFT;

 #ifdef SMP
@@ -1062,7 +1066,7 @@
 {
 	mtx_lock_spin(&sched_lock);
 	realstathz = stathz ? stathz : hz;
-	sched_slice = (realstathz/7);	/* ~140ms */
+	sched_slice = (realstathz/10);	/* ~100ms */

 	/*
 	 * tickincr is shifted out by 10 to avoid rounding errors due to
@@ -1443,7 +1447,6 @@
 		 * If we bring in a thread account for it as if it had been
 		 * added to the run queue and then chosen.
 		 */
-		newtd->td_sched->ts_flags |= TSF_DIDRUN;
 		TD_SET_RUNNING(newtd);
 		tdq_load_add(TDQ_SELF(), newtd->td_sched);
 	} else
@@ -1491,25 +1494,28 @@
 void
 sched_wakeup(struct thread *td)
 {
+	struct td_sched *ts;
 	int slptime;

 	mtx_assert(&sched_lock, MA_OWNED);
-
+	ts = td->td_sched;
 	/*
 	 * If we slept for more than a tick update our interactivity and
 	 * priority.
 	 */
-	slptime = td->td_sched->ts_slptime;
-	td->td_sched->ts_slptime = 0;
+	slptime = ts->ts_slptime;
+	ts->ts_slptime = 0;
 	if (slptime && slptime != ticks) {
 		u_int hzticks;

 		hzticks = (ticks - slptime) << SCHED_TICK_SHIFT;
-		td->td_sched->skg_slptime += hzticks;
+		ts->skg_slptime += hzticks;
 		sched_interact_update(td);
-		sched_pctcpu_update(td->td_sched);
+		sched_pctcpu_update(ts);
 		sched_priority(td);
 	}
+	/* Reset the slice value after we sleep. */
+	ts->ts_slice = sched_slice;
 	sched_add(td, SRQ_BORING);
 }

@@ -1834,7 +1840,8 @@
 	 */
 	if (THREAD_CAN_MIGRATE(td)) {
 		if (td->td_priority <= PRI_MAX_ITHD) {
-			CTR2(KTR_SCHED, "ithd %d < %d", td->td_priority, PRI_MAX_ITHD);
+			CTR2(KTR_ULE, "ithd %d < %d",
+			    td->td_priority, PRI_MAX_ITHD);
 			ts->ts_cpu = cpuid;
 		}
 		if (pick_pri)
@@ -1842,7 +1849,7 @@
 		else
 			ts->ts_cpu = tdq_pickidle(tdq, ts);
 	} else
-		CTR1(KTR_SCHED, "pinned %d", td->td_pinned);
+		CTR1(KTR_ULE, "pinned %d", td->td_pinned);
 	if (ts->ts_cpu != cpuid)
 		preemptive = 0;
 	tdq = TDQ_CPU(ts->ts_cpu);


Use ANSI function definition for profil.

--- sys/kern/subr_prof.c
+++ sys/kern/subr_prof.c
@@ -404,9 +404,7 @@
 #endif
 /* ARGSUSED */
 int
-profil(td, uap)
-	struct thread *td;
-	register struct profil_args *uap;
+profil(struct thread *td, struct profil_args *uap)
 {
 	struct uprof *upp;
 	struct proc *p;


 - Add KTR_VFS messages for various name cache related events.

Sponsored by:	Isilon Systems, Inc.

--- sys/kern/vfs_cache.c
+++ sys/kern/vfs_cache.c
@@ -271,6 +271,7 @@
 	struct vnode *vp;

 	mtx_assert(&cache_lock, MA_OWNED);
+	CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, ncp->nc_vp);
 	vp = NULL;
 	LIST_REMOVE(ncp, nc_hash);
 	LIST_REMOVE(ncp, nc_src);
@@ -357,6 +358,8 @@
 	if (cnp->cn_nameptr[0] == '.') {
 		if (cnp->cn_namelen == 1) {
 			*vpp = dvp;
+			CTR2(KTR_VFS, "cache_lookup(%p, %s) found via .",
+			    dvp, cnp->cn_nameptr);
 			dothits++;
 			goto success;
 		}
@@ -368,6 +371,8 @@
 				return (0);
 			}
 			*vpp = dvp->v_dd;
+			CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..",
+			    dvp, cnp->cn_nameptr, *vpp);
 			goto success;
 		}
 	}
@@ -407,6 +412,8 @@
 		numposhits++;
 		nchstats.ncs_goodhits++;
 		*vpp = ncp->nc_vp;
+		CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p",
+		    dvp, cnp->cn_nameptr, *vpp, ncp);
 		goto success;
 	}

@@ -474,6 +481,7 @@
 	int zap;
 	int len;

+	CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr);
 	VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp,
 	    ("cahe_enter: Adding a doomed vnode"));

@@ -571,6 +579,7 @@
 {
 	struct namecache *ncp;

+	CTR1(KTR_VFS, "cache_purge(%p)", vp);
 	CACHE_LOCK();
 	while (!LIST_EMPTY(&vp->v_cache_src)) {
 		struct vnode *cvp;


Fix N32/N64 ABIs to use proper registers after recent changes.

Pointy Hat to: imp

--- sys/mips/mips/trap.c
+++ sys/mips/mips/trap.c
@@ -363,10 +363,10 @@
 			/*
 			 * Non-o32 ABIs support more arguments in registers.
 			 */
-			sa->args[3] = locr0->t0;
-			sa->args[4] = locr0->t1;
-			sa->args[5] = locr0->t2;
-			sa->args[6] = locr0->t3;
+			sa->args[3] = locr0->a4;
+			sa->args[4] = locr0->a5;
+			sa->args[5] = locr0->a6;
+			sa->args[6] = locr0->a7;
 			nsaved += 4;
 #ifdef COMPAT_FREEBSD32
 		}
@@ -389,10 +389,10 @@
 			/*
 			 * Non-o32 ABIs support more arguments in registers.
 			 */
-			sa->args[4] = locr0->t0;
-			sa->args[5] = locr0->t1;
-			sa->args[6] = locr0->t2;
-			sa->args[7] = locr0->t3;
+			sa->args[4] = locr0->a4;
+			sa->args[5] = locr0->a5;
+			sa->args[6] = locr0->a6;
+			sa->args[7] = locr0->a7;
 			nsaved += 4;
 #ifdef COMPAT_FREEBSD32
 		}


- convert pspare pointers in inpcb to an llentry and rtentry cache - add flags to indicate their validity

--- sys/netinet/in_pcb.h
+++ sys/netinet/in_pcb.h
@@ -170,7 +170,8 @@
 	u_char	inp_ip_minttl;		/* (i) minimum TTL or drop */
 	uint32_t inp_flowid;		/* (x) flow id / queue id */
 	u_int	inp_refcount;		/* (i) refcount */
-	void	*inp_pspare[2];		/* (x) rtentry / general use */
+	struct llentry	*inp_lle;	/* cached L2 information */
+	struct rtentry	*inp_rt;	/* cached L3 information */

 	/* Local and foreign ports, local and foreign addr. */
 	struct	in_conninfo inp_inc;	/* (i/p) list for PCB's local port */
@@ -433,6 +434,8 @@
 /*
  * Flags for inp_flags2.
  */
+#define	INP_LLE_VALID		0x00000001 /* cached lle is valid */
+#define	INP_RT_VALID		0x00000002 /* cached rtentry is valid */

 #define	INPLOOKUP_WILDCARD	1
 #define	sotoinpcb(so)	((struct inpcb *)(so)->so_pcb)


shuffle code so we don't "continue" and miss a needed unlock operation

Observed by:	Wiktor Niesiobedzki <w@evip.pl>

--- sys/netinet/raw_ip.c
+++ sys/netinet/raw_ip.c
@@ -709,10 +709,8 @@
 	for (inp = LIST_FIRST(ripcbinfo.listhead), i = 0; inp && i < n;
 	     inp = LIST_NEXT(inp, inp_list)) {
 		INP_LOCK(inp);
-		if (inp->inp_gencnt <= gencnt) {
-			if (cr_canseesocket(req->td->td_ucred,
-			    inp->inp_socket))
-				continue;
+		if (inp->inp_gencnt <= gencnt &&
+		    cr_canseesocket(req->td->td_ucred, inp->inp_socket) == 0) {
 			/* XXX held references? */
 			inp_list[i++] = inp;
 		}


fix leak in proc_set_super()

fix leak in proc_set_super()

set_anon_super() can fail...

Signed-off-by: Al Viro <de609eb4d5d70b1d38ec6642adbfc33a2781f63c@zeniv.linux.org.uk>

--- fs/proc/root.c
+++ fs/proc/root.c
@@ -28,11 +28,12 @@

 static int proc_set_super(struct super_block *sb, void *data)
 {
-	struct pid_namespace *ns;
-
-	ns = (struct pid_namespace *)data;
-	sb->s_fs_info = get_pid_ns(ns);
-	return set_anon_super(sb, NULL);
+	int err = set_anon_super(sb, NULL);
+	if (!err) {
+		struct pid_namespace *ns = (struct pid_namespace *)data;
+		sb->s_fs_info = get_pid_ns(ns);
+	}
+	return err;
 }

 static struct dentry *proc_mount(struct file_system_type *fs_type,


s5j/timerisr: add missing initialization on RTC

The first stage bootloader is initializing RTCCON[7:4] to 0x4 before it
jumps to subsequent stages. This is no harm if we clear it while
initializing the RTC, but it is not cleared when CONFIG_RTC is not set
and causing OS timetick to be generated at 2048Hz. To avoid this issue,
we need to clear it always before enabling the timer isr.

Change-Id: Id27a079e35f5d0a93d6a6428117daa3d45b71a61
Signed-off-by: Heesub Shin <45471ea77bd08f3d26635f3f5adb40ba41250a2b@samsung.com>

--- os/arch/arm/src/s5j/s5j_timerisr.c
+++ os/arch/arm/src/s5j/s5j_timerisr.c
@@ -117,7 +117,8 @@
 	/* Configure the RTC timetick to generate periodic interrupts */
 	modifyreg32(S5J_RTC_RTCCON, RTC_RTCCON_TICKEN0_ENABLE, 0);
 	putreg32(SYSTICK_RELOAD, S5J_RTC_TICCNT0);
-	modifyreg32(S5J_RTC_RTCCON, 0, RTC_RTCCON_TICKEN0_ENABLE);
+	modifyreg32(S5J_RTC_RTCCON, RTC_RTCCON_TICCKSEL0_MASK,
+					RTC_RTCCON_TICKEN0_ENABLE | RTC_RTCCON_TICCKSEL0_32768HZ);

 	/* Attach the timer interrupt vector */
 	irq_attach(IRQ_TOP_RTC_TIC, up_timerisr, NULL);


Removed duplicated initialization which is already done in hal

git-svn-id: de15d415ffb1bc5d91a165b5b7d2093897d104a2@7014 35acf78f-673a-0410-8e92-d51de3d6d3f4

--- os/hal/boards/ARDUINO_MEGA/board.c
+++ os/hal/boards/ARDUINO_MEGA/board.c
@@ -72,16 +72,4 @@
   EICRB  = 0x00;
   EIMSK  = 0x00;

-  /*
-   * Timer 0 setup.
-   */
-  TCCR0A  = (1 << WGM01) | (0 << WGM00) |                /* CTC mode.        */
-            (0 << COM0A1) | (0 << COM0A0) |              /* OC0A disabled.   */
-            (0 << COM0B1) | (0 << COM0B0);               /* OC0B disabled.   */
-  TCCR0B  = (0 << WGM02) |                               /* CTC mode.        */
-            (0 << CS02)  | (1 << CS01)  | (1 << CS00);   /* CLK/64 clock.    */
-  OCR0A   = F_CPU / 64 / CH_CFG_ST_FREQUENCY - 1;
-  TCNT0   = 0;                                           /* Reset counter.   */
-  TIFR0   = (1 << OCF0A);                                /* Reset pending.   */
-  TIMSK0  = (1 << OCIE0A);                               /* IRQ on compare.  */
 }


remove unneeded declaration

remove unneeded declaration


Protect (partially) against tick count wrapping around

git-svn-id: e7e61699ce1738538ffebb75374fbea0924bc775@7946 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02

--- otherlibs/win32unix/gettimeofday.c
+++ otherlibs/win32unix/gettimeofday.c
@@ -24,12 +24,13 @@

 CAMLprim value unix_gettimeofday(value unit)
 {
-  if (initial_time == 0) {
-    initial_tickcount = GetTickCount();
+  DWORD tickcount = GetTickCount();
+  if (initial_time == 0 || tickcount < initial_tickcount) {
+    initial_tickcount = tickcount;
     initial_time = time(NULL);
     return copy_double((double) initial_time);
   } else {
-    return copy_double(initial_time +
-                       (GetTickCount() - initial_tickcount) * 1e-3);
+    return copy_double((double) initial_time +
+		       (double) (tickcount - initial_tickcount) * 1e-3);
   }
 }


apel: lower input voltage to 5V when battery full

For ERP compliance, we want to ensure that we are using the least amount
of power when the device is in S5 and plugged into AC power.

BRANCH=octopus
BUG=b:113830171
TEST=passes ERP

Change-Id: I91f44de96bdab86edabc5031cb92eaa70b9a39b3
Signed-off-by: Jett Rink <9d4aef0593e6843318d99df31597fb6153b89787@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1406852
Commit-Ready: ChromeOS CL Exonerator Bot <fa429e5907f00867f797423aea74327bb02c91b6@appspot.gserviceaccount.com>
Reviewed-by: Karthikeyan Ramasubramanian <5f7313966b13e2a933e6857bda169ba157fc04ea@chromium.org>

--- board/ampton/battery.c
+++ board/ampton/battery.c
@@ -6,8 +6,11 @@
  */

 #include "battery_fuel_gauge.h"
+#include "charge_state.h"
+#include "chipset.h"
 #include "common.h"
-#include "util.h"
+#include "hooks.h"
+#include "usb_pd.h"

 /*
  * Battery info for all ampton/apel battery types. Note that the fields
@@ -90,3 +93,26 @@
 BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT);

 const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_C214;
+
+/* Lower our input voltage to 5V in S5/G3 when battery is full. */
+static void reduce_input_voltage_when_full(void)
+{
+	int max_pd_voltage_mv;
+	int port;
+
+	if (charge_get_percent() == 100 &&
+	    chipset_in_or_transitioning_to_state(CHIPSET_STATE_ANY_OFF))
+		max_pd_voltage_mv = 5000;
+	else
+		max_pd_voltage_mv = PD_MAX_VOLTAGE_MV;
+	if (pd_get_max_voltage() != max_pd_voltage_mv) {
+		for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++)
+			pd_set_external_voltage_limit(port, max_pd_voltage_mv);
+	}
+}
+DECLARE_HOOK(HOOK_BATTERY_SOC_CHANGE, reduce_input_voltage_when_full,
+	     HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_CHIPSET_STARTUP, reduce_input_voltage_when_full,
+	     HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, reduce_input_voltage_when_full,
+	     HOOK_PRIO_DEFAULT);


board/kukui_scp/vdec.c: Format with clang-format

BUG=b:236386294
BRANCH=none
TEST=none

Change-Id: I43d7ea0e534144b2cb41b72730846c086d59c891
Signed-off-by: Jack Rosenthal <d3f605bef1867f59845d4ce6e4f83b8dc9e4e0ae@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728598
Reviewed-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>

--- board/kukui_scp/vdec.c
+++ board/kukui_scp/vdec.c
@@ -20,19 +20,23 @@
 static struct consumer const event_vdec_consumer;
 static void event_vdec_written(struct consumer const *consumer, size_t count);

-static struct queue const event_vdec_queue = QUEUE_DIRECT(8,
-	struct vdec_msg, null_producer, event_vdec_consumer);
+static struct queue const event_vdec_queue =
+	QUEUE_DIRECT(8, struct vdec_msg, null_producer, event_vdec_consumer);
 static struct consumer const event_vdec_consumer = {
 	.queue = &event_vdec_queue,
-	.ops = &((struct consumer_ops const) {
+	.ops = &((struct consumer_ops const){
 		.written = event_vdec_written,
 	}),
 };

 /* Stub functions only provided by private overlays. */
 #ifndef HAVE_PRIVATE_MT8183
-void vdec_h264_service_init(void) {}
-void vdec_h264_msg_handler(void *data) {}
+void vdec_h264_service_init(void)
+{
+}
+void vdec_h264_msg_handler(void *data)
+{
+}
 #endif

 static vdec_msg_handler mtk_vdec_msg_handle[VDEC_MAX];


redrix: Update thermal high/halt point

redrix: Update thermal high/halt point

BUG=b:195673113
BRANCH=none
TEST=Thermal team verified thermal policy is expected.

Signed-off-by: Devin Lu <052fe648504800b810f29702ef4f3db83fad68bf@quantatw.com>
Change-Id: I99ec43ebfe2be46b814ab938dc14b3a7e28006f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3501461
Reviewed-by: caveh jalali <08e24a66aefda7a55ca7d73f8903e0fb16eec763@chromium.org>

--- board/redrix/sensors.c
+++ board/redrix/sensors.c
@@ -319,26 +319,21 @@
 BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);

 /*
- * TODO(b/195673113): Need to update for Alder Lake/redrix
- */
-/*
  * TODO(b/202062363): Remove when clang is fixed.
  */
 #define THERMAL_DDR \
 	{ \
 		.temp_host = { \
+			[EC_TEMP_THRESH_HIGH] = C_TO_K(75), \
+			[EC_TEMP_THRESH_HALT] = C_TO_K(80), \
+		}, \
+		.temp_host_release = { \
 			[EC_TEMP_THRESH_HIGH] = C_TO_K(70), \
-			[EC_TEMP_THRESH_HALT] = C_TO_K(80), \
-		}, \
-		.temp_host_release = { \
-			[EC_TEMP_THRESH_HIGH] = C_TO_K(65), \
 		}, \
 	}
 __maybe_unused static const struct ec_thermal_config thermal_ddr = THERMAL_DDR;

 /*
- * TODO(b/195673113): Need to update for Alder Lake/redrix
- *
  * Tiger Lake specifies 100 C as maximum TDP temperature.  THRMTRIP# occurs at
  * 130 C.  However, sensor is located next to SOC, so we need to use the lower
  * SOC temperature limit (85 C)
@@ -349,18 +344,15 @@
 #define THERMAL_CPU \
 	{ \
 		.temp_host = { \
+			[EC_TEMP_THRESH_HIGH] = C_TO_K(75), \
+			[EC_TEMP_THRESH_HALT] = C_TO_K(80), \
+		}, \
+		.temp_host_release = { \
 			[EC_TEMP_THRESH_HIGH] = C_TO_K(70), \
-			[EC_TEMP_THRESH_HALT] = C_TO_K(80), \
-		}, \
-		.temp_host_release = { \
-			[EC_TEMP_THRESH_HIGH] = C_TO_K(65), \
 		}, \
 	}
 __maybe_unused static const struct ec_thermal_config thermal_cpu = THERMAL_CPU;

-/*
- * TODO(b/195673113): Need to update for Alder Lake/redrix
- */
 /*
  * TODO(b/202062363): Remove when clang is fixed.
  */
@@ -377,9 +369,6 @@
 __maybe_unused static const struct ec_thermal_config thermal_charger =
 	THERMAL_CHARGER;

-/*
- * TODO(b/195673113): Need to update for Alder Lake/redrix
- */
 /*
  * TODO(b/202062363): Remove when clang is fixed.
  */


meowth: Enable MKBP support for events.

meowth: Enable MKBP support for events.

Button and switch events will be reported using MKBP.

BUG=b:6914039
BRANCH=None
TEST=make -j buildall

Change-Id: Ieff75fa563ed91c2d33b18caf8942038ab7100bd
Signed-off-by: Aseda Aboagye <12c9b286316a940fd31c24070da5ab64cdd4d0e7@google.com>
Reviewed-on: https://chromium-review.googlesource.com/775477
Commit-Ready: Aseda Aboagye <12c9b286316a940fd31c24070da5ab64cdd4d0e7@chromium.org>
Tested-by: Aseda Aboagye <12c9b286316a940fd31c24070da5ab64cdd4d0e7@chromium.org>
Reviewed-by: Shawn N <5259333ce42e3ace6a73988cec7115ed9d3a661a@chromium.org>

--- board/zoombini/board.h
+++ board/zoombini/board.h
@@ -72,6 +72,13 @@
 #define CONFIG_PWM_KBLIGHT
 #define CONFIG_SWITCH
 #endif /* defined(BOARD_ZOOMBINI) */
+
+/* TODO(aaboagye): Eventually, enable MKBP for zoombini as well. */
+#ifdef BOARD_MEOWTH
+#define CONFIG_MKBP_EVENT
+#define CONFIG_MKBP_USE_HOST_EVENT
+#define CONFIG_KEYBOARD_PROTOCOL_MKBP
+#endif /* defined(BOARD_MEOWTH) */

 #define CONFIG_USB_POWER_DELIVERY
 #define CONFIG_USB_PD_ALT_MODE


entry: use padding on the image area to position the image

Don't assume the padding of the icons is the same padding of the rest of
the entry.
This also allows to set different paddings for left and right icons.

--- gtk/gtkentry.c
+++ gtk/gtkentry.c
@@ -169,7 +169,6 @@
   gint          drag_start_x;
   gint          drag_start_y;
   gint          focus_width;
-  gint          icon_margin;
   gint          insert_pos;
   gint          selection_bound;
   gint          scroll_offset;
@@ -2508,6 +2507,21 @@

   gtk_style_context_set_state (context, state);
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_IMAGE);
+
+  if (gtk_widget_get_direction (GTK_WIDGET (entry)) == GTK_TEXT_DIR_RTL)
+    {
+      if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
+        gtk_style_context_add_class (context, GTK_STYLE_CLASS_RIGHT);
+      else
+        gtk_style_context_add_class (context, GTK_STYLE_CLASS_LEFT);
+    }
+  else
+    {
+      if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
+        gtk_style_context_add_class (context, GTK_STYLE_CLASS_LEFT);
+      else
+        gtk_style_context_add_class (context, GTK_STYLE_CLASS_RIGHT);
+    }
 }

 static gint
@@ -2517,6 +2531,7 @@
   GtkEntryPrivate *priv = entry->priv;
   EntryIconInfo *icon_info = priv->icons[icon_pos];
   GtkStyleContext *context;
+  GtkBorder padding;
   gint width;

   if (!icon_info)
@@ -2524,10 +2539,15 @@

   context = gtk_widget_get_style_context (GTK_WIDGET (entry));
   gtk_entry_prepare_context_for_icon (entry, context, icon_pos);
+  gtk_style_context_get_padding (context, 0, &padding);
+
   _gtk_icon_helper_get_size (icon_info->icon_helper, context,
                              &width, NULL);
   gtk_style_context_restore (context);

+  if (width > 0)
+    width += padding.left + padding.right;
+
   return width;
 }

@@ -2548,14 +2568,10 @@
   primary->y = y;
   primary->height = height;
   primary->width = get_icon_width (entry, GTK_ENTRY_ICON_PRIMARY);
-  if (primary->width > 0)
-    primary->width += 2 * priv->icon_margin;

   secondary->y = y;
   secondary->height = height;
   secondary->width = get_icon_width (entry, GTK_ENTRY_ICON_SECONDARY);
-  if (secondary->width > 0)
-    secondary->width += 2 * priv->icon_margin;

   if (gtk_widget_get_direction (GTK_WIDGET (entry)) == GTK_TEXT_DIR_RTL)
     {
@@ -3133,7 +3149,7 @@
     {
       icon_width = get_icon_width (entry, i);
       if (icon_width > 0)
-        icon_widths += icon_width + 2 * priv->icon_margin;
+        icon_widths += icon_width;
     }

   if (icon_widths > width)
@@ -3386,6 +3402,7 @@
   EntryIconInfo *icon_info = priv->icons[icon_pos];
   gint x, y, width, height, pix_width, pix_height;
   GtkStyleContext *context;
+  GtkBorder padding;

   if (!icon_info)
     return;
@@ -3403,9 +3420,11 @@

   context = gtk_widget_get_style_context (widget);
   gtk_entry_prepare_context_for_icon (entry, context, icon_pos);
-  _gtk_icon_helper_get_size (icon_info->icon_helper, context, &pix_width, &pix_height);
-
-  x = MAX (0, (width  - pix_width) / 2);
+  _gtk_icon_helper_get_size (icon_info->icon_helper, context,
+                             &pix_width, &pix_height);
+  gtk_style_context_get_padding (context, 0, &padding);
+
+  x = MAX (0, padding.left);
   y = MAX (0, (height - pix_height) / 2);

   _gtk_icon_helper_draw (icon_info->icon_helper,
@@ -4523,17 +4542,6 @@
 }

 static void
-icon_margin_changed (GtkEntry *entry)
-{
-  GtkEntryPrivate *priv = entry->priv;
-  GtkBorder border;
-
-  _gtk_entry_get_borders (GTK_ENTRY (entry), &border);
-
-  priv->icon_margin = border.left;
-}
-
-static void
 gtk_entry_update_cached_style_values (GtkEntry *entry)
 {
   GtkEntryPrivate *priv = entry->priv;
@@ -4571,7 +4579,6 @@
   gtk_entry_recompute (entry);

   icon_theme_changed (entry);
-  icon_margin_changed (entry);
 }

 /* GtkCellEditable method implementations


[mpfr] Added mpfr enums and constants

[mpfr] Added mpfr enums and constants

--- modules/mpfr/mpfr.c
+++ modules/mpfr/mpfr.c
@@ -13,6 +13,9 @@
 #define TYPE_EXCEPTION(name, wanted) \
     seed_make_exception(ctx, except, "TypeError", name " expected " wanted ); \
     return seed_make_undefined(ctx);
+
+#define ENUM_MEMBER(holder, name, value) \
+    seed_object_set_property(ctx, holder, name, seed_value_from_long(ctx, value, NULL))

 #if 0 /* TODO: Make this work */
 /* kind of stupid hack */
@@ -424,6 +427,30 @@
     seed_object_set_property(ctx, ns_ref, "mpfr_t", mpfr_constructor);
     seed_object_set_property(ctx, mpfr_constructor, "set", mpfr_constructor_set);

+
+    /* Setup enums */
+    ENUM_MEMBER(ns_ref, "GMP_RNDN", GMP_RNDN);
+    ENUM_MEMBER(ns_ref, "GMP_RNDZ", GMP_RNDZ);
+    ENUM_MEMBER(ns_ref, "GMP_RNDU", GMP_RNDU);
+    ENUM_MEMBER(ns_ref, "GMP_RNDD", GMP_RNDD);
+
+    ENUM_MEMBER(ns_ref, "MPFR_VERSION_MAJOR", MPFR_VERSION_MAJOR);
+    ENUM_MEMBER(ns_ref, "MPFR_VERSION_MINOR", MPFR_VERSION_MINOR);
+    ENUM_MEMBER(ns_ref, "MPFR_VERSION_PATCHLEVEL", MPFR_VERSION_PATCHLEVEL);
+    seed_object_set_property(ctx, ns_ref, "MPFR_VERSION_STRING",
+                             seed_value_from_string(ctx, MPFR_VERSION_STRING, NULL));
+
+    ENUM_MEMBER(ns_ref, "MPFR_PREC_MIN", MPFR_PREC_MIN);
+    ENUM_MEMBER(ns_ref, "MPFR_PREC_MAX", MPFR_PREC_MAX);
+
+    ENUM_MEMBER(ns_ref, "MPFR_EMAX_DEFAULT", MPFR_EMAX_DEFAULT);
+    ENUM_MEMBER(ns_ref, "MPFR_EMIN_DEFAULT", MPFR_EMIN_DEFAULT);
+
+    ENUM_MEMBER(ns_ref, "MPFR_NAN_KIND", MPFR_NAN_KIND);
+    ENUM_MEMBER(ns_ref, "MPFR_INF_KIND", MPFR_INF_KIND);
+    ENUM_MEMBER(ns_ref, "MPFR_ZERO_KIND", MPFR_ZERO_KIND);
+    ENUM_MEMBER(ns_ref, "MPFR_REGULAR_KIND", MPFR_REGULAR_KIND);
+
     return ns_ref;
 }


bump patch version to 13

bump patch version to 13

--- BBFrameworks/BBFrameworksConstants.h
+++ BBFrameworks/BBFrameworksConstants.h
@@ -20,7 +20,7 @@

 static NSInteger const BBFrameworksVersionMajor = 1;
 static NSInteger const BBFrameworksVersionMinor = 4;
-static NSInteger const BBFrameworksVersionPatch = 12;
+static NSInteger const BBFrameworksVersionPatch = 13;

 static NSString *const BBFrameworksResourcesBundleName = @"BBFrameworksResources.bundle";