Skip to content
Snippets Groups Projects
Select Git revision
  • bpftask
  • bpf-spectre default protected
  • bpf-spectre-baseline
  • pkt-ptr-revert-v1
  • v6.5-rc6-bpf-spectre-nospec
  • master
  • spectector-bpf
  • bpftask-no-unused-args
  • bpftask-master
  • v5.9-bpftask
  • v5.8-amd-17h-em protected
  • v5.8-amd-17h-eas protected
  • freqinv-amd3950x-v5.8
  • v5.8-scale-inv-acc-amd-ryzen-3950x
  • 23186e43-amd-17h-eas protected
  • caffb99b6929-perf-x86-rapl-Enable-RAPL-for-AMD-Fam17h
  • 6a9ee74800a1-amd-17h-eas protected
  • add2fae34926-amd_17h_em
  • 3643c88e5545-Add-support-for-frequency-invariance-for-some-x86
  • 0d8e630a1e14-CPPC-optional-registers-AMD-support
  • v5.7-rc6
21 results

Kbuild

Blame
    • Masahiro Yamada's avatar
      5f2fb52f
      kbuild: rename hostprogs-y/always to hostprogs/always-y · 5f2fb52f
      Masahiro Yamada authored
      
      In old days, the "host-progs" syntax was used for specifying host
      programs. It was renamed to the current "hostprogs-y" in 2004.
      
      It is typically useful in scripts/Makefile because it allows Kbuild to
      selectively compile host programs based on the kernel configuration.
      
      This commit renames like follows:
      
        always       ->  always-y
        hostprogs-y  ->  hostprogs
      
      So, scripts/Makefile will look like this:
      
        always-$(CONFIG_BUILD_BIN2C) += ...
        always-$(CONFIG_KALLSYMS)    += ...
            ...
        hostprogs := $(always-y) $(always-m)
      
      I think this makes more sense because a host program is always a host
      program, irrespective of the kernel configuration. We want to specify
      which ones to compile by CONFIG options, so always-y will be handier.
      
      The "always", "hostprogs-y", "hostprogs-m" will be kept for backward
      compatibility for a while.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      5f2fb52f
      History
      kbuild: rename hostprogs-y/always to hostprogs/always-y
      Masahiro Yamada authored
      
      In old days, the "host-progs" syntax was used for specifying host
      programs. It was renamed to the current "hostprogs-y" in 2004.
      
      It is typically useful in scripts/Makefile because it allows Kbuild to
      selectively compile host programs based on the kernel configuration.
      
      This commit renames like follows:
      
        always       ->  always-y
        hostprogs-y  ->  hostprogs
      
      So, scripts/Makefile will look like this:
      
        always-$(CONFIG_BUILD_BIN2C) += ...
        always-$(CONFIG_KALLSYMS)    += ...
            ...
        hostprogs := $(always-y) $(always-m)
      
      I think this makes more sense because a host program is always a host
      program, irrespective of the kernel configuration. We want to specify
      which ones to compile by CONFIG options, so always-y will be handier.
      
      The "always", "hostprogs-y", "hostprogs-m" will be kept for backward
      compatibility for a while.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    diff-delta.c 7.14 KiB
    /*
     * diff-delta.c: generate a delta between two buffers
     *
     *  Many parts of this file have been lifted from LibXDiff version 0.10.
     *  http://www.xmailserver.org/xdiff-lib.html
     *
     *  LibXDiff was written by Davide Libenzi <davidel@xmailserver.org>
     *  Copyright (C) 2003	Davide Libenzi
     *
     *  Many mods for GIT usage by Nicolas Pitre <nico@cam.org>, (C) 2005.
     *
     *  This file is free software; you can redistribute it and/or
     *  modify it under the terms of the GNU Lesser General Public
     *  License as published by the Free Software Foundation; either
     *  version 2.1 of the License, or (at your option) any later version.
     *
     *  Use of this within git automatically means that the LGPL
     *  licensing gets turned into GPLv2 within this project.
     */
    
    #include <stdlib.h>
    #include "delta.h"
    
    
    /* block size: min = 16, max = 64k, power of 2 */
    #define BLK_SIZE 16
    
    #define MIN(a, b) ((a) < (b) ? (a) : (b))
    
    #define GR_PRIME 0x9e370001
    #define HASH(v, b) (((unsigned int)(v) * GR_PRIME) >> (32 - (b)))
    	
    /* largest prime smaller than 65536 */
    #define BASE 65521
    
    /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
    #define NMAX 5552
    
    #define DO1(buf, i)  { s1 += buf[i]; s2 += s1; }
    #define DO2(buf, i)  DO1(buf, i); DO1(buf, i + 1);
    #define DO4(buf, i)  DO2(buf, i); DO2(buf, i + 2);
    #define DO8(buf, i)  DO4(buf, i); DO4(buf, i + 4);
    #define DO16(buf)    DO8(buf, 0); DO8(buf, 8);
    
    static unsigned int adler32(unsigned int adler, const unsigned char *buf, int len)
    {
    	int k;
    	unsigned int s1 = adler & 0xffff;
    	unsigned int s2 = adler >> 16;
    
    	while (len > 0) {
    		k = MIN(len, NMAX);
    		len -= k;
    		while (k >= 16) {
    			DO16(buf);
    			buf += 16;
    			k -= 16;
    		}
    		if (k != 0)
    			do {
    				s1 += *buf++;
    				s2 += s1;
    			} while (--k);
    		s1 %= BASE;
    		s2 %= BASE;
    	}
    
    	return (s2 << 16) | s1;
    }